CVE-2026-119197

pyasn1: Quadratic-complexity denial of service in binary REAL decoding

Published Oct 29, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.

Analysis

AI-generated

Technical impact

The vulnerability stems from a quadratic-time algorithm used to decode binary REAL values in pyasn1. Each mantissa octet triggers a left shift, OR operation, and memory copy, so the total decoding time grows proportionally to the square of the mantissa length. An attacker can construct a REAL value with a very large mantissa, causing the decoder to consume a CPU core for seconds or even minutes, effectively denying service to legitimate users. This falls under CWE-407 and CWE-606.

Affected Systems

The issue affects the pyasn1 Python library, version 0.6.4 and earlier. Any systems or applications that import pyasn1 and process ASN.1 data from external or potentially hostile sources are vulnerable until the library is upgraded to version 0.6.5 or later.

Risk and Exploitability

The CVSS score of 7.5 indicates high severity, and the exploit is not currently listed in CISA’s KEV catalog. Because the flaw is triggered by specially crafted ASN.1 input, the attack vector is likely remote: an attacker can send data to any service that uses pyasn1 to decode incoming messages. The EPSS score of 0.425% indicates a very low exploitation probability, but the quadratic nature of the bug suggests that exploitation could consume significant resources, leading to a denial of service. There are no known prerequisite conditions beyond providing malformed data.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pyasn1 to version 0.6.5 or later to apply the fix
  • If upgrading is not possible, restrict the length of REAL mantissas or reject ASN.1 data that exceeds a predefined size threshold before decoding
  • Monitor application CPU usage and set limits on processing time for ASN.1 decoding routines, isolating the decoder in a separate process or container to contain resource exhaustion

Generated by OpenCVE AI on October 31, 2026 at 01:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-mm57-4v3p-rchx pyasn1 has quadratic-complexity denial of service in binary REAL decoding
Ubuntu USN Ubuntu USN USN-9011-1 pyasn1 vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Pyasn1
Pyasn1 pyasn1
Vendors & Products Pyasn1
Pyasn1 pyasn1
Type Values Removed Values Added
Description pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.
Title pyasn1: Quadratic-complexity denial of service in binary REAL decoding
Weaknesses CWE-407
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-606

    Unchecked Input for Loop Condition

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 30, 2026, 4:08 PM
Reserved
Oct 29, 2026, 4:04 PM
Status
Awaiting Analysis
Published
Oct 29, 2026, 8:17 PM
Modified
Oct 30, 2026, 5:18 PM
Severity
Important
Public date
Oct 29, 2026, 7:48 PM