CVE-2013-7040: Hash not properly randomized

Hash function is not randomized properly.

Python 3.4 now used SipHash (PEP 456).

Python 3.3 and Python 2.7 are still affected.

  • Disclosure date: 2012-04-19 (Python issue #14621 reported)

Fixed In

Vulnerable Versions

  • Python 2.7
  • Python 3.3

Python issue

Hash function is not randomized properly.

  • Python issue: issue #14621
  • Creation date: 2012-04-19
  • Reporter: Vlado Boza

CVE-2013-7040

Python 2.7 before 3.4 only uses the last eight bits of the prefix to randomize hash values, which causes it to compute hash values without restricting the ability to trigger hash collisions predictably and makes it easier for context-dependent attackers to cause a denial of service (CPU consumption) via crafted input to an application that maintains a hash table. NOTE: this vulnerability exists because of an incomplete fix for CVE-2012-1150.

Timeline

Timeline using the disclosure date 2012-04-19 as reference:

  • 2012-04-19: Python issue #14621 reported by Vlado Boza
  • 2013-11-20 (+580 days): commit 985ecdc
  • 2014-03-16 (+696 days): Python 3.4.0 released
  • 2014-05-19 (+760 days): CVE-2013-7040 published