Author lemburg
Recipients Arach, Arfrever, Huzaifa.Sidhpurwala, Jim.Jewett, Mark.Shannon, PaulMcMillan, Zhiping.Deng, alex, barry, benjamin.peterson, christian.heimes, dmalcolm, eric.araujo, eric.snow, fx5, georg.brandl, grahamd, gregory.p.smith, gvanrossum, gz, jcea, lemburg, loewis, mark.dickinson, neologix, pitrou, skorgu, skrah, terry.reedy, tim.peters, v+python, vstinner, zbysz
Date 2012-02-06.17:07:34
SpamBayes Score 1.03874e-10
Marked as misclassified No
Message-id <>
In-reply-to <>
Jim Jewett wrote:
> Jim Jewett <> added the comment:
> On Mon, Feb 6, 2012 at 8:12 AM, Marc-Andre Lemburg
> <> wrote:
>> Marc-Andre Lemburg <> added the comment:
>> Antoine Pitrou wrote:
>>> The simple collision counting approach leaves a gaping hole open, as
>>> demonstrated by Frank.
>> Could you elaborate on this ?
>> Note that I've updated the collision counting patch to cover both
>> possible attack cases I mentioned in
>> If there's another case I'm unaware of, please let me know.
> The problematic case is, roughly,
> (1)  Find out what N will trigger collision-counting countermeasures.
> (2)  Insert N-1 colliding entries, to make it as slow as possible.
> (3)  Keep looking up (or updating) the N-1th entry, so that the
> slow-as-possible-without-countermeasures path keeps getting rerun.

Since N is constant, I don't see how such an "attack" could be used
to trigger the O(n^2) worst-case behavior. Even if you can create n sets
of entries that each fill up N-1 positions, the overall performance
will still be O(n*N*(N-1)/2) = O(n).

So in the end, we're talking about a regular brute force DoS attack,
which requires different measures than dictionary implementation
tricks :-)

BTW: If you set the limit N to e.g. 100 (which is reasonable given
Victor's and my tests), the time it takes to process one of those
sets only takes 0.3 ms on my machine. That's hardly usable as basis
for an effective DoS attack.
Date User Action Args
2012-02-06 17:07:35lemburgsetrecipients: + lemburg, gvanrossum, tim.peters, loewis, barry, georg.brandl, terry.reedy, gregory.p.smith, jcea, mark.dickinson, pitrou, vstinner, christian.heimes, benjamin.peterson, eric.araujo, grahamd, Arfrever, v+python, alex, zbysz, skrah, dmalcolm, gz, neologix, Arach, Mark.Shannon, eric.snow, Zhiping.Deng, Huzaifa.Sidhpurwala, Jim.Jewett, PaulMcMillan, fx5, skorgu
2012-02-06 17:07:34lemburglinkissue13703 messages
2012-02-06 17:07:34lemburgcreate