[issue13703] Hash collision security issue

Marc-Andre Lemburg report at bugs.python.org
Fri Jan 6 18:59:40 CET 2012


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Here's an example of hash-attack.patch finding an on-purpose
programming error (hashing all objects to the same value):

http://stackoverflow.com/questions/4865325/counting-collisions-in-a-python-dictionary
(see the second example on the page for @Winston Ewert's solution)

With the patch you get:

Traceback (most recent call last):
  File "testcollisons.py", line 20, in <module>
    d[o] = 1
KeyError: 'too many hash collisions'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13703>
_______________________________________


More information about the Python-bugs-list mailing list