All vulnerabilities

PyPI

CVE-2026-119195

pyasn1 has quadratic-time denial of service in constructed string and indefinite-length ANY decoding

Severity
High 7.5
Published
30 Oct 2026
Last changed
30 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
0.6.5
Exploit chance
0.5% in the next 30 daysHigher than 46% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Inefficient algorithmic complexity (CWE-407)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-9m75-vc3g-4x39
Sources
OSV.dev and GitHub

Description

In pyasn1 0.6.4 and earlier, decoding a constructed OCTET STRING or character string made of many fragments can spend disproportionate CPU time repeatedly copying the accumulated value. A separate indefinite-length ANY path has the same problem while collecting the encoded components. The work grows roughly quadratically with the number of fixed-size fragments, although the input and decoded value grow linearly. An application that lets an attacker supply such ASN.1 input to an affected decoder can suffer CPU exhaustion.

The affected string paths are available in BER and CER. The DER decoder also accepts certain non-DER constructed strings: a definite-length constructed OCTET STRING when an asn1Spec selects univ.OctetString, and constructed character strings such as UTF8String even without a schema. Indefinite-length ANY is affected in BER and CER when an asn1Spec selects univ.Any; DER rejects indefinite lengths.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

Until upgrading, enforce application-appropriate limits on the size of untrusted ASN.1 input before passing it to pyasn1, and limit the CPU resources available to decoding workers. Applications that require DER can also reject constructed string encodings before invoking the decoder. The appropriate byte limit depends on the protocol and expected valid values.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
pyasn1PyPI · osv:PyPI:pyasn1
  • Every version before 0.6.5

About pyasn1

References