CVE-2026-119195
pyasn1: Quadratic-time denial of service in constructed string and indefinite-length ANY decoding
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.5
pyasn1: Quadratic-time denial of service in constructed string and indefinite-length ANY decoding
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.
- Record
CVE-2026-119195- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-02
EUVDEUVD-2026-113351
7.5
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.
- Record
EUVD-2026-113351- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-9m75-vc3g-4x39
7.5
pyasn1 has quadratic-time denial of service in constructed string and indefinite-length ANY decoding
Summary
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.
This is a distinct decoder path from the OBJECT IDENTIFIER/RELATIVE-OID accumulation addressed by CVE-2026-59885. It has the same complexity class, but the OID fix in 0.6.4 did not change these string or ANY loops.
Technical details
In the v0.6.4 BER decoder, OctetStringPayloadDecoder appends each decoded fragment to a growing bytes value with header += component in both its definite-length and indefinite-length constructed forms. AnyPayloadDecoder.indefLenValueDecoder similarly uses chunk += component. In the exercised paths, each concatenation copies an increasingly large prefix. For N fixed-size fragments, the total copied data grows with 1 + 2 + ... + N, or O(N²).
The OCTET STRING decoder is also the base class of the decoders for UTF8String, NumericString, PrintableString, TeletexString, VideotexString, IA5String, GraphicString, VisibleString, GeneralString, UniversalString, BMPString, ObjectDescriptor, GeneralizedTime, and UTCTime. These types inherit the same constructed-string reassembly path.
The DER decoder's OCTET STRING restriction replaces the tag-driven decoder, but its schema-driven TYPE_MAP retains the BER-derived decoder. Thus der.decode(data) rejects a constructed OCTET STRING, while der.decode(data, asn1Spec=univ.OctetString()) accepts its definite-length form and reaches the accumulation loop. DER does not replace the inherited character-string decoders, so a constructed UTF8String is also accepted without asn1Spec. These inputs violate X.690's DER string-encoding rule and should not be described as valid DER encodings.
The original short-fragment, definite-length OCTET STRING reproducer is valid BER. The CER decoder accepts it, but it is not a conforming CER string encoding: X.690 requires an indefinite-length outer constructed string and 1,000 contents octets per fragment except possibly the last. A conforming CER-shaped constructed OCTET STRING with those fragment sizes also reaches the loop and shows quadratic growth. The indefinite-length ANY reproducer below can represent a CER SEQUENCE OF OCTET STRING and reaches the separate ANY loop when decoded with an ANY schema.
The decoder's eight-octet length-field limit and nesting-depth limit do not bound the number of sibling fragments in these examples. The BER reproducer below uses only a three-octet outer length field; all fragments have shallow nesting. There is no per-message fragment-count cap in v0.6.4.
Impact
If an application passes…
- Record
GHSA-9m75-vc3g-4x39- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-02
NVD
7.5
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.
- Record
CVE-2026-119195- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-02
OSV
7.5
pyasn1: Quadratic-time denial of service in constructed string and indefinite-length ANY decoding
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.
- Record
CVE-2026-119195- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-119195
7.5
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.
- Record
DEBIAN-CVE-2026-119195- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-03
Show 4 moreShow less
OSVGHSA-9m75-vc3g-4x39
7.5
pyasn1 has quadratic-time denial of service in constructed string and indefinite-length ANY decoding
Summary
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.
This is a distinct decoder path from the OBJECT IDENTIFIER/RELATIVE-OID accumulation addressed by CVE-2026-59885. It has the same complexity class, but the OID fix in 0.6.4 did not change these string or ANY loops.
Technical details
In the v0.6.4 BER decoder, OctetStringPayloadDecoder appends each decoded fragment to a growing bytes value with header += component in both its definite-length and indefinite-length constructed forms. AnyPayloadDecoder.indefLenValueDecoder similarly uses chunk += component. In the exercised paths, each concatenation copies an increasingly large prefix. For N fixed-size fragments, the total copied data grows with 1 + 2 + ... + N, or O(N²).
The OCTET STRING decoder is also the base class of the decoders for UTF8String, NumericString, PrintableString, TeletexString, VideotexString, IA5String, GraphicString, VisibleString, GeneralString, UniversalString, BMPString, ObjectDescriptor, GeneralizedTime, and UTCTime. These types inherit the same constructed-string reassembly path.
The DER decoder's OCTET STRING restriction replaces the tag-driven decoder, but its schema-driven TYPE_MAP retains the BER-derived decoder. Thus der.decode(data) rejects a constructed OCTET STRING, while der.decode(data, asn1Spec=univ.OctetString()) accepts its definite-length form and reaches the accumulation loop. DER does not replace the inherited character-string decoders, so a constructed UTF8String is also accepted without asn1Spec. These inputs violate X.690's DER string-encoding rule and should not be described as valid DER encodings.
The original short-fragment, definite-length OCTET STRING reproducer is valid BER. The CER decoder accepts it, but it is not a conforming CER string encoding: X.690 requires an indefinite-length outer constructed string and 1,000 contents octets per fragment except possibly the last. A conforming CER-shaped constructed OCTET STRING with those fragment sizes also reaches the loop and shows quadratic growth. The indefinite-length ANY reproducer below can represent a CER SEQUENCE OF OCTET STRING and reaches the separate ANY loop when decoded with an ANY schema.
The decoder's eight-octet length-field limit and nesting-depth limit do not bound the number of sibling fragments in these examples. The BER reproducer below uses only a three-octet outer length field; all fragments have shallow nesting. There is no per-message fragment-count cap in v0.6.4.
Impact
If an application passes…
- Record
GHSA-9m75-vc3g-4x39- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-119195
7.5
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.
- Record
UBUNTU-CVE-2026-119195- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-05
OSVAZL-111533 No score
CVE-2026-119195 affecting package python-pyasn1 0.4.8-3
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.
- Record
AZL-111533- Updated
- 2026-11-05
OSVROOT-APP-PYPI-CVE-2026-119195 No score
CVE-2026-119195 in pyasn1 - Patched by Root
Root has patched CVE-2026-119195 in the pyasn1 package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2026-119195- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
pyasn1PyPI |
through 0.6.4 | 0.6.5 |
python-pyasn1Azure Linux:3 |
through 0.4.8-3 | None known |
pyasn1Debian:12 |
All versions, plus listed versions 0.4.8-30.4.8-3+deb12u10.4.8-3+deb12u20.4.8-3+deb12u30.4.8-4 Show 9 moreShow less0.5.1-10.6.0-10.6.1-10.6.2-10.6.2-1~bpo13+10.6.3-10.6.4-10.6.4-1~bpo13+10.6.5-1 |
None known |
pyasn1Debian:13 |
All versions, plus listed versions 0.6.1-10.6.1-1+deb13u10.6.1-1+deb13u20.6.1-1+deb13u30.6.2-1 Show 5 moreShow less0.6.2-1~bpo13+10.6.3-10.6.4-10.6.4-1~bpo13+10.6.5-1 |
None known |
pyasn1Debian:14 |
before 0.6.5-1, plus listed versions 0.6.1-10.6.2-10.6.2-1~bpo13+10.6.3-10.6.4-10.6.4-1~bpo13+1 |
0.6.5-1 |
pyasn1PyPI |
before 0.6.5, plus listed versions 0.0.10a0.0.11a0.0.12a0.0.130.0.13a Show 37 moreShow less0.0.13b0.0.6a0.0.9a0.1.10.1.20.1.30.1.40.1.50.1.60.1.70.1.80.1.90.2.10.2.20.2.30.3.10.3.20.3.30.3.40.3.50.3.60.3.70.4.10.4.20.4.30.4.40.4.50.4.60.4.70.4.80.5.00.5.10.6.00.6.10.6.20.6.30.6.4 |
0.6.5 |
pyasn1Root:PyPI |
before 0.6.4+aikido.3 | 0.6.4+aikido.3 |
pyasn1Ubuntu:Pro:14.04:LTS |
All versions, plus listed versions 0.1.4-0ubuntu10.1.7-1ubuntu10.1.7-1ubuntu20.1.7-1ubuntu2.10.1.7-1ubuntu2.1+esm1 |
None known |
pyasn1Ubuntu:Pro:16.04:LTS |
All versions, plus listed versions 0.1.8-20.1.9-10.1.9-1ubuntu0.1~esm1 |
None known |
pyasn1Ubuntu:Pro:18.04:LTS |
All versions, plus listed versions 0.1.9-20.4.2-30.4.2-3ubuntu0.18.04.1~esm1 |
None known |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
pyasn1Ubuntu:Pro:20.04:LTS |
All versions, plus listed versions 0.4.2-30.4.2-3build10.4.2-3ubuntu0.20.04.1~esm1 |
None known |
pyasn1Ubuntu:22.04:LTS |
All versions, plus listed versions 0.4.8-10.4.8-1ubuntu0.10.4.8-1ubuntu0.20.4.8-1ubuntu0.3 |
None known |
pyasn1Ubuntu:24.04:LTS |
All versions, plus listed versions 0.4.8-40.4.8-4ubuntu0.10.4.8-4ubuntu0.20.4.8-4ubuntu0.3 |
None known |
pyasn1Ubuntu:26.10 |
All versions, plus listed versions 0.6.3-10.6.4-1 |
None known |
pyasn1Ubuntu:26.04:LTS |
All versions, plus listed versions 0.6.1-10.6.1-1build10.6.2-10.6.3-10.6.3-1ubuntu0.1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | OSV | |
| affected | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-119195 is a high vulnerability (CVSS 7.5) in Pyasn1, published October 29, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.53%, the 44th percentile. Fixed in pyasn1 0.6.5.
References
Left out here: the rest of 2 source descriptions. The JSON record has them.