CVE-2026-119195

pyasn1: Quadratic-time denial of service in constructed string and indefinite-length ANY 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, constructed string and indefinite-length ANY decoding repeatedly concatenates each fragment onto a growing bytes value. Attacker-controlled BER or CER data can use many constructed OCTET STRING or character-string fragments. DER rejects constructed OCTET STRING without a schema, but accepts its definite-length form when asn1Spec selects univ.OctetString; it also accepts constructed character strings such as UTF8String without a schema, even though those encodings are not valid DER. The separate indefinite-length ANY path is reachable in BER and CER when asn1Spec selects univ.Any; DER rejects indefinite lengths. OctetStringPayloadDecoder uses growing header concatenation and AnyPayloadDecoder.indefLenValueDecoder uses growing chunk concatenation, repeatedly copying an increasing prefix and causing quadratic work. A sufficiently fragmented value can occupy decoding workers and cause CPU exhaustion without confidentiality or integrity impact. This issue is fixed in version 0.6.5.

Analysis

AI-generated

Technical impact

The pyasn1 library for Python contains an implementation flaw in versions prior to 0.6.5. When decoding constructed string or indefinite‑length ANY types, the library repeatedly concatenates each fragment onto a growing byte buffer. An attacker can craft BER or CER data with a large number of constructed OCTET STRING or character‑string fragments, causing the decoder to perform quadratic work and exhaust CPU resources. This vulnerability does not compromise confidentiality or integrity; it merely consumes processing time, potentially rendering services unavailable.

Affected Systems

The vulnerability affects the pyasn1 library from any release before 0.6.5, including early 0.6.x versions. Applications that import pyasn1 and process ASN.1 encoded data—especially external or network data—are susceptible. Updating to pyasn1 0.6.5 or later resolves the issue as the new release eliminates the inefficient concatenation logic.

Risk and Exploitability

The CVSS score of 7.5 classifies this flaw as high severity. The EPSS score is < 1%, indicating very low likelihood of exploitation, and the vulnerability is not listed in CISA’s KEV catalog. The exploit requires an attacker to supply crafted ASN.1 data to a process that uses pyasn1. While the attack surface is limited to software that directly decodes external ASN.1 payloads, an application exposed over a network could be targeted remotely. The impact is purely denial-of-service through CPU exhaustion; no data compromise occurs.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to pyasn1 v0.6.5 or newer
  • Validate or reject ASN.1 inputs that exceed a reasonable size to limit preallocation
  • Monitor CPU usage and enforce timeouts for decoding operations

Generated by OpenCVE AI on October 30, 2026 at 14:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-9m75-vc3g-4x39 pyasn1 has quadratic-time denial of service in constructed string and indefinite-length ANY decoding
Ubuntu USN Ubuntu USN USN-9011-1 pyasn1 vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', '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, constructed string and indefinite-length ANY decoding repeatedly concatenates each fragment onto a growing bytes value. Attacker-controlled BER or CER data can use many constructed OCTET STRING or character-string fragments. DER rejects constructed OCTET STRING without a schema, but accepts its definite-length form when asn1Spec selects univ.OctetString; it also accepts constructed character strings such as UTF8String without a schema, even though those encodings are not valid DER. The separate indefinite-length ANY path is reachable in BER and CER when asn1Spec selects univ.Any; DER rejects indefinite lengths. OctetStringPayloadDecoder uses growing header concatenation and AnyPayloadDecoder.indefLenValueDecoder uses growing chunk concatenation, repeatedly copying an increasing prefix and causing quadratic work. A sufficiently fragmented value can occupy decoding workers and cause CPU exhaustion without confidentiality or integrity impact. This issue is fixed in version 0.6.5.
Title pyasn1: Quadratic-time denial of service in constructed string and indefinite-length ANY 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-1046

    Creation of Immutable Text Using String Concatenation

  • CWE-407

    Inefficient Algorithmic Complexity

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 29, 2026, 8:26 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:41 PM