CVE-2026-119196

pyasn1: Quadratic CPU consumption in constructed BIT STRING 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 BIT STRING decoding repeatedly shifts and copies the complete bit value accumulated from earlier fragments. Attacker-controlled BER or CER input contains many constructed BIT STRING fragments; schema-driven DER also accepts a definite-length constructed BIT STRING. BitStringPayloadDecoder repeatedly calls BitString.fromOctetString with the prior bitString as prepend, shifting an ever-growing SizedInteger for each fragment and causing quadratic work. Large fragmented values can exhaust CPU during decode() without requiring later conversion or formatting. This issue is fixed in version 0.6.5.

Analysis

AI-generated

Technical impact

The vulnerability exists in the pyasn1 library, where decoding of constructed BIT STRING fragments performs repeated shifting and copying of an ever‑growing bit buffer, leading to quadratic CPU consumption. An attacker can craft a BER or CER input containing many constructed BIT STRING fragments, exhausting the processor during the decoder’s init phase before any data conversion or formatting occurs. This results in a denial of service by blocking legitimate processing and degrading overall system performance.

Affected Systems

All installations of the pyasn1 package older than version 0.6.5 are affected. The issue appears in the pyasn1:pyasn1 product, regardless of the Python environment, whenever the library processes BER, CER, or definite‑length constructed BIT STRING inputs from untrusted sources.

Risk and Exploitability

The CVSS score of 7.5 indicates a high severity impact for availability. The EPSS score is less than 1%, and the vulnerability is not listed in the CISA KEV catalog, indicating no known exploitation yet. Attackers would need the ability to supply or influence the ASN.1 input processed by the library, which could be achieved via network services or file ingestion interfaces. The lack of a direct exploitation vector for confidentiality or integrity confines the threat to resource exhaustion, yet the potential for widespread denial of service in heavily loaded environments warrants prompt action.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to pyasn1 0.6.5 or later
  • Validate input to limit the number or size of constructed BIT STRING fragments before decoding
  • Apply rate limiting or sandbox the process that decodes ASN.1 data to mitigate excessive CPU usage

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-2qm8-x737-gmw5 pyasn1 has quadratic CPU consumption in constructed BIT STRING 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 BIT STRING decoding repeatedly shifts and copies the complete bit value accumulated from earlier fragments. Attacker-controlled BER or CER input contains many constructed BIT STRING fragments; schema-driven DER also accepts a definite-length constructed BIT STRING. BitStringPayloadDecoder repeatedly calls BitString.fromOctetString with the prior bitString as prepend, shifting an ever-growing SizedInteger for each fragment and causing quadratic work. Large fragmented values can exhaust CPU during decode() without requiring later conversion or formatting. This issue is fixed in version 0.6.5.
Title pyasn1: Quadratic CPU consumption in constructed BIT STRING 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-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 4, 2026, 1:40 AM
Reserved
Oct 29, 2026, 4:04 PM
Status
Awaiting Analysis
Published
Oct 29, 2026, 8:17 PM
Modified
Nov 4, 2026, 2:17 AM
Severity
Important
Public date
Oct 29, 2026, 7:44 PM