CVE-2026-59886: pyasn1 Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-hm4w-wwcw-mr6r
CVSS 7.5
CWE-400
Published
Advisory Summary

CVE-2026-59886 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting pyasn1 libraries in the PyPI ecosystem. The issue involves uncontrolled resource consumption when converting decoded real values. Remediation is available by upgrading affected packages to version 0.6.4.

CVE-2026-59886 at a Glance

CVE Identifier CVE-2026-59886
GHSA Identifier GHSA-hm4w-wwcw-mr6r
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product pyasn1
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-2026-59886

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

pyasn1 fixed: 0.6.4
pip install pyasn1>=0.6.4
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 pyasn1

How to Check if You Are Affected

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

pip show pyasn1

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In pyasn1, 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

### Impact The univ.Real type converted its (mantissa, base, exponent) value to a Python float using exact big-integer exponentiation. A BER/CER/DER-encoded REAL value only a few bytes long can carry a very large exponent, causing this computation to attempt to materialize an astronomically large integer. Any operation that triggers float conversion on such a decoded value — prettyPrint(), str(), comparison, arithmetic, or an explicit float() call — consumes excessive CPU and memory, hanging the process. Applications that decode untrusted ASN.1 data and then print, log, or compare the decoded objects are vulnerable to denial of service. Decoding alone does not trigger the issue. ### Affected components - pyasn1.type.univ.Real — float conversion (__float__() and everything built on it: prettyPrint(), str(), comparisons, arithmetic, int()) - Reachable through the pyasn1.codec.ber, cer, and der decoders, which produce Real objects from untrusted input; also via directly constructed Real values The encoders and the native codec are not affected. Applications that never handle ASN.1 REAL values are not affected. ### Patches Fixed in pyasn1 0.6.4. Binary (base-2) values are now converted with math.ldexp(), and decimal (base-10) values with exponents beyond float range raise OverflowError without constructing huge intermediate integers. Existing behavior is preserved: out-of-range values raise OverflowError and prettyPrint() renders them as <overflow>. ### Workarounds Avoid converting, printing, or comparing decoded Real objects from untrusted sources; inspect the raw (mantissa, base, exponent) tuple instead.

CVE-2026-59886 Affected pyasn1 Versions

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

References

Frequently Asked Questions

What is CVE-2026-59886?
CVE-2026-59886 is a security vulnerability in pyasn1 involving Uncontrolled resource consumption when converting decoded REAL values under CWE-400: Uncontrolled Resource Consumption.
Which pyasn1 versions are affected?
Affected versions include releases prior to 0.6.4 across affected packages: pyasn1.
What version fixes CVE-2026-59886?
Upgrading to 0.6.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pyasn1 affected?
Yes, pyasn1 is affected in releases prior to 0.6.4. Upgrade your dependency to 0.6.4 or later.
What is the CVSS score of CVE-2026-59886?
CVE-2026-59886 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-2026-59886?
CVE-2026-59886 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check PyPI dependencies for CVE-2026-59886?
Run the dependency tree command: 'pip show pyasn1'. 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-hm4w-wwcw-mr6r",
  "modified" : "2026-07-21T19:11:20Z",
  "published" : "2026-07-21T19:11:20Z",
  "aliases" : [ "CVE-2026-59886" ],
  "summary" : "pyasn1: Uncontrolled resource consumption when converting decoded REAL values",
  "details" : "### Impact\nThe univ.Real type converted its (mantissa, base, exponent) value to a Python float using exact big-integer exponentiation. A BER/CER/DER-encoded REAL value only a few bytes long can carry a very large exponent, causing this computation to attempt to materialize an astronomically large integer.\n\nAny operation that triggers float conversion on such a decoded value — prettyPrint(), str(), comparison, arithmetic, or an explicit float() call — consumes excessive CPU and memory, hanging the process. Applications that decode untrusted ASN.1 data and then print, log, or compare the decoded objects are vulnerable to denial of service. Decoding alone does not trigger the issue.\n\n### Affected components\n- pyasn1.type.univ.Real — float conversion (__float__() and everything built on it: prettyPrint(), str(), comparisons, arithmetic, int())\n- Reachable through the pyasn1.codec.ber, cer, and der decoders, which produce Real objects from untrusted input; also via directly constructed Real values\n\nThe encoders and the native codec are not affected. Applications that never handle ASN.1 REAL values are not affected.\n\n### Patches\nFixed in pyasn1 0.6.4. Binary (base-2) values are now converted with math.ldexp(), and decimal (base-10) values with exponents beyond float range raise OverflowError without constructing huge intermediate integers. Existing behavior is preserved: out-of-range values raise OverflowError and prettyPrint() renders them as <overflow>.\n\n### Workarounds\nAvoid converting, printing, or comparing decoded Real objects from untrusted sources; inspect the raw (mantissa, base, exponent) tuple instead.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pyasn1"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.6.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pyasn1/pyasn1/security/advisories/GHSA-hm4w-wwcw-mr6r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59886"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyasn1/pyasn1/commit/e60c691cb91addb8fcefa2f537e85ede6fb1e886"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyasn1/pyasn1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyasn1/pyasn1/releases/tag/v0.6.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-21T19:11:20Z",
    "nvd_published_at" : "2026-07-14T17:17:15Z"
  }
}