CVE-2018-15560: Pycryptodome PyCryptodome Integer Overflow Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-hgg3-g7gr-66r7
CVSS 7.5
CWE-190
Published
Advisory Summary

CVE-2018-15560 is a HIGH (CVSS 7.5) pycryptodome integer overflow vulnerability vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Pycryptodome libraries in the PyPI ecosystem. The issue involves pycryptodome integer overflow vulnerability. Remediation is available by upgrading affected packages to version 3.6.6.

CVE-2018-15560 at a Glance

CVE Identifier CVE-2018-15560
GHSA Identifier GHSA-hgg3-g7gr-66r7
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-190: Integer Overflow or Wraparound
Affected Product Pycryptodome
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2018-15560

To remediate this vulnerability, upgrade all affected Pycryptodome dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pycryptodome fixed: 3.6.6
pip install pycryptodome>=3.6.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pycryptodome

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2018-15560, inspect your installed packages using pip:

pip show pycryptodome

Analyze the terminal output to locate any version of Pycryptodome in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.6.6), your application is affected.

Note: The pip show pycryptodome command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Pycryptodome, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

PyCryptodome before 3.6.6 has an integer overflow in the data_len variable in AESNI.c, related to the AESNI_encrypt and AESNI_decrypt functions, leading to the mishandling of messages shorter than 16 bytes.

CVE-2018-15560 Affected Pycryptodome Versions

1 component(s)
Fixed Versions:
3.6.6
Product / Package Ecosystem Affected Versions Fixed Version
pycryptodome
PyPI
< 3.6.6
3.6.6

References

Frequently Asked Questions

What is CVE-2018-15560?
CVE-2018-15560 is a security vulnerability in Pycryptodome involving PyCryptodome integer overflow vulnerability under CWE-190: Integer Overflow or Wraparound.
Which Pycryptodome versions are affected?
Affected versions include releases prior to 3.6.6 across affected packages: pycryptodome.
What version fixes CVE-2018-15560?
Upgrading to 3.6.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pycryptodome affected?
Yes, pycryptodome is affected in releases prior to 3.6.6. Upgrade your dependency to 3.6.6 or later.
What is the CVSS score of CVE-2018-15560?
CVE-2018-15560 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2018-15560?
CVE-2018-15560 is classified under CWE-190: Integer Overflow or Wraparound (The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.).
How can I check PyPI dependencies for CVE-2018-15560?
Run the dependency tree command: 'pip show pycryptodome'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hgg3-g7gr-66r7",
  "modified" : "2024-10-21T20:21:37Z",
  "published" : "2018-08-27T19:52:28Z",
  "aliases" : [ "CVE-2018-15560" ],
  "summary" : "PyCryptodome integer overflow vulnerability",
  "details" : "PyCryptodome before 3.6.6 has an integer overflow in the data_len variable in AESNI.c, related to the AESNI_encrypt and AESNI_decrypt functions, leading to the mishandling of messages shorter than 16 bytes.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pycryptodome"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.6.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-15560"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Legrandin/pycryptodome/issues/198"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Legrandin/pycryptodome"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-hgg3-g7gr-66r7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pycryptodome/PYSEC-2018-21.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://whitehatck01.blogspot.com/2018/08/integer-overflow-vulnerability-in.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-190" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:40:07Z",
    "nvd_published_at" : "2018-08-20T00:29:00Z"
  }
}