CVE-2013-7040: Medium severity Apple iOS and macOS vulnerability

Published May 19, 2014
·
Updated

CVE-2018-20852 http.cookiejar.DefaultPolicy.domainreturnok in Lib/http/cookiejar.py in Python before 3.7.3 does not correctly validate the domain: it can be tricked into sending existing cookies to the wrong server. An attacker may abuse this flaw by using a server with a hostname that has another valid hostname as a suffix (e.g., pythonicexample.com to steal cookies for example.com). When a program uses http.cookiejar.DefaultPolicy and tries to do an HTTP connection to an attacker-controlled server, existing cookies can be leaked to the attacker. This affects 2.x through 2.7.16, 3.x before 3.4.10, 3.5.x before 3.5.7, 3.6.x before 3.6.9, and 3.7.x before 3.7.3. CVE-2014-4616 Array index error in the scanstring function in the json module in Python 2.7 through 3.5 and simplejson before 2.6.1 allows context-dependent attackers to read arbitrary process memory via a negative index value in the idx argument to the rawdecode function. 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.

Affected Software

48 affected componentsFixes available
Apple iOS and macOS<=10.10.4
Python Python=2.7.1
Python Python=2.7.1-rc1
Python Python=2.7.2-rc1
Python Python=2.7.3
Python Python=2.7.4
Python Python=2.7.5
Python Python=2.7.6
Python Python=2.7.7
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.1.5
Python Python=3.2
Python Python=3.2-alpha
Python Python=3.2.0
Python Python=3.2.1
Python Python=3.2.2
Python Python=3.2.3
Python Python=3.2.4
Python Python=3.2.5
Python Python=3.2.2150
Python Python=3.3
Python Python=3.3-beta2
Python Python=3.3.0
Python Python=3.3.1
Python Python=3.3.1-rc1
Python Python=3.3.2
Python Python=3.3.3
Python Python=3.3.3-rc1
Python Python=3.3.3-rc2
Python Python=3.3.4
Python Python=3.3.4-rc1
Python Python=3.3.5
Python Python=3.3.5-rc1
Python Python=3.3.5-rc2
F5 BIG-IQ Centralized Management
debian/python2.7*
debian/python2.5
debian/python2.6
debian/python3.1
debian/python3.4
3.4.0-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/python3.4 to a version that resolves this vulnerability.

    Fixed in 3.4.0-1
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.6.1
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.4.10
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.5.7
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.6.9
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.7.3

Event History

May 19, 2014
CVE Published
via MITRE·02:00 PM
Data Sourced
via MITRE·02:00 PM
Description
Data Sourced
02:55 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·02:55 PM
DescriptionAffected Software
May 27, 2025
Advisory Published
via F5·04:17 PM
Data Sourced
via F5·04:17 PM
DescriptionSeverityWeaknessAffected Software
Advisory Published
via F5·04:18 PM
May 6, 2026
Updated
via NVD·10:30 PM
Affected Software
Nov 24, 2026
Withdrawn
via OSV·04:28 AM

Frequently Asked Questions

1

What is the severity of CVE-2013-7040?

CVE-2013-7040 has a medium severity level due to the potential for denial of service attacks through predictable hash collisions.

2

How do I fix CVE-2013-7040?

To fix CVE-2013-7040, upgrade to Python versions 2.7.8 or later, which contain the necessary patches.

3

What versions of Python are affected by CVE-2013-7040?

CVE-2013-7040 affects Python versions 2.7.1 through 2.7.7, as well as some earlier versions of Python 3.

4

How can CVE-2013-7040 be exploited?

CVE-2013-7040 can be exploited by attackers to cause a denial of service through the generation of hash collisions.

5

Is CVE-2013-7040 relevant for macOS users?

Yes, macOS versions up to 10.10.4 are also impacted by CVE-2013-7040 if they utilize the affected Python versions.

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