CVE-2012-1150: Medium severity Python Python vulnerability

Published Nov 1, 2011
·
Updated

Julian Wälde and Alexander Klink reported a flaw in the hash function used in the implementation of the Python dictionaries (associative arrays).

A specially-crafted set of keys could trigger hash function collisions, which degrade dictionary performance by changing hash table operations complexity from an expected/average O(1) to the worst case O(n). Reporters were able to find colliding strings efficiently using meet in the middle attack.

As various web application frameworks for Python automatically pre-fill certain dictionaries with data from the HTTP request (such as GET or POST parameters) for Python web application, a remote attacker could use this flaw to make Python interpreter use excessive amount of CPU time by sending a POST request with large amount of parameters which hash to the same value.

This problem is similar to the issue that was previously reported for and fixed in e.g. perl: http://www.cs.rice.edu/~scrosby/hash/CrosbyWallachUsenixSec2003.pdf

Other sources

Python before 2.6.8, 2.7.x before 2.7.3, 3.x before 3.1.5, and 3.2.x before 3.2.3 computes hash values without restricting the ability to trigger hash collisions predictably, which allows context-dependent attackers to cause a denial of service (CPU consumption) via crafted input to an application that maintains a hash table.

Launchpad

Affected Software

59 affected componentsFixes available
debian/python2.7
2.7.18-8+deb11u1
Python Python<=2.6.7
Python Python=0.9.0
Python Python=0.9.1
Python Python=1.2
Python Python=1.3
Python Python=1.5.2
Python Python=1.6
Python Python=1.6.1
Python Python=2.0
Python Python=2.0.1
Python Python=2.1
Python Python=2.1.1
Python Python=2.1.2
Python Python=2.1.3
Python Python=2.2
Python Python=2.2.1
Python Python=2.2.2
Python Python=2.2.3
Python Python=2.3.1
Python Python=2.3.2
Python Python=2.3.3
Python Python=2.3.4
Python Python=2.3.5
Python Python=2.3.7
Python Python=2.4.1
Python Python=2.4.2
Python Python=2.4.3
Python Python=2.4.4
Python Python=2.4.6
Python Python=2.5.1
Python Python=2.5.2
Python Python=2.5.3
Python Python=2.5.4
Python Python=2.5.6
Python Python=2.5.150
Python Python=2.6.1
Python Python=2.6.2
Python Python=2.6.3
Python Python=2.6.4
Python Python=2.6.5
Python Python=2.6.6
Python Python=2.6.2150
Python Python=2.6.6150
Python Python=2.7.1
Python Python=2.7.1-rc1
Python Python=2.7.2-rc1
Python Python=2.7.1150
Python Python=2.7.2150
Python Python=3.0
Python Python=3.0.1
Python Python=3.1
Python Python=3.1.1
Python Python=3.1.2
Python Python=3.1.3
Python Python=3.1.4
Python Python=3.2
Python Python=3.2-alpha
Python Python=3.2.2150

Event History

Nov 1, 2011
Data Sourced
via Red Hat·03:03 PM
DescriptionSeverityAffected Software
Oct 5, 2012
CVE Published
via MITRE·09:00 PM
Data Sourced
via MITRE·09:00 PM
Description
Data Sourced
via NVD·09:55 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·09:58 PM
Description
Sep 20, 2024
Data Sourced
via Ubuntu·12:49 AM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2012-1150?

CVE-2012-1150 has been classified as a moderate severity vulnerability due to its potential to degrade dictionary performance in Python.

2

How do I fix CVE-2012-1150?

To fix CVE-2012-1150, update to a patched version of Python, specifically versions 2.7.18-8+deb11u1 or later.

3

What are the affected versions of Python for CVE-2012-1150?

CVE-2012-1150 affects Python versions prior to 2.7.18 and includes multiple earlier versions such as 2.6.7 and 3.1.x.

4

What type of vulnerability is CVE-2012-1150?

CVE-2012-1150 is a denial-of-service vulnerability due to hash collisions that impact performance.

5

Can CVE-2012-1150 allow for remote code execution?

No, CVE-2012-1150 does not allow for remote code execution but solely affects the performance of dictionary operations.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203