RE: secure unpickle?

From: Tim Peters (tim.one_at_comcast.net)
Date: 01/19/04


Date: Mon, 19 Jan 2004 16:41:35 -0500
To: <python-list@python.org>


[John J. Lee, on Gandalf's safe(r) restricted unpickling code,
 which assigns None to an unpickler's .find_global attr]

> Aha.
>
> I see from past messages that this is thought to solve the security
> problems (for this restricted case), at least by Martin v. Loewis, but
> also that Paul Rubin believes a careful audit would be required to
> have confidence in it (whether that's FUD, as Martin accuses, or
> sensible caution, I have no idea...).

Oh, who knows. Start by defining "security problem" -- I don't know what
exactly people mean by that, although I do know I lose interest long before
they finish demanding impossibilities <0.6 wink>. For example, I wouldn't
be surprised if some otherwise idle postdoc found a way to trick cPickle
into segfaulting by constructing an enormously large and/or enormously
deeply nested composition of simple scalar types, lists, tuples and dicts.
I don't know whether that's possible, but long experience certainly suggests
that virtually all C programs have problems with "too much" of anything.

>
http://www.google.com/groups?threadm=mailman.1012591743.10841.python-list%40
python.org

In the specific case discussed there of unpickling a string, I agree with
Martin that there's no plausible attack, perhaps apart from creating a
pickle that unpickled to a multi-gigabyte string (will the system malloc()
properly return NULL if it can't satisfy the request? even if it does, will
cPickle deal with the NULL return correctly? will cPickle screw up by
failing to account for the possibility of integer overflow when adding the
size of the string header to number of string bytes requested? etc -- beats
me). I expect this is because Martin and I are both familiar with the
actual front-end code that parses a string, and Paul isn't. Familiarity
doesn't *always* breed contempt <wink>.



Relevant Pages

  • Re: Long body guitars
    ... The original dreadnought guitar design was done by a foreman at Oliver ... That same body shape was used for the ukuleles which Martin made for Ditson ... I am having Scott Baxendale build me a 12 string ...
    (rec.music.makers.guitar.acoustic)
  • Re: Predicting the Future and Kolmogorov Complexity
    ... I haven't pulled Martin Löf's 1966 article yet, but none of the articles I ... the string. ... then there seems to be a relationship here to predictability. ... The algorithm used to compute pi doesn't ...
    (talk.origins)
  • Re: Strings!!
    ... I thought I'd try a change from my usual Martin 80:20 bronze (extra-light 10 ... The guitar shop had some Guvnor phosphor bronze similar gauge at ... string buzzed horribly when fretted! ...
    (uk.music.guitar)
  • Re: Insert Into - Invalid Operation
    ... "Martin" wrote: ... > and I executed in the query windows and it worked) but I still have the error. ... > As the string is right, do you think that I have some mistake here? ... >> I ran the sub (I manually changed the control names to variable name ...
    (microsoft.public.access.queries)