CVE-2026-119196
pyasn1: Quadratic CPU consumption in constructed BIT STRING decoding
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.
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 CPU consumption in constructed BIT STRING decoding
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.
- Record
CVE-2026-119196- 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-04
EUVDEUVD-2026-113352
7.5
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.
- Record
EUVD-2026-113352- 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-04
GitHub AdvisoriesGHSA-2qm8-x737-gmw5
7.5
pyasn1 has quadratic CPU consumption in constructed BIT STRING decoding
Summary
In pyasn1 through 0.6.4, decoding a constructed BIT STRING with many fragments repeatedly shifts and copies the entire value accumulated so far. For fixed-size fragments, CPU time grows quadratically with the encoded input size. An application that passes sufficiently large, attacker-controlled ASN.1 data to an affected decoder can suffer CPU exhaustion during decode(); no conversion or formatting of the decoded value is required.
The BER and CER decoders reach this path for constructed BIT STRING values, with or without an asn1Spec. The DER decoder rejects constructed BIT STRING in schema-less decoding, but its schema-driven path accepts a definite-length constructed BIT STRING when given a matching asn1Spec and reaches the same vulnerable code. Constructed BIT STRING is not valid DER; this DER exposure is due to decoder permissiveness. DER rejects the indefinite-length form.
This is a separate decoder path from the OBJECT IDENTIFIER accumulation fixed in CVE-2026-59885.
Technical details
In the 0.6.4 BitStringPayloadDecoder, both the definite-length and indefinite-length fragment loops call BitString.fromOctetString(..., prepend=bitString) for every fragment. fromOctetString shifts the growing SizedInteger left by the fragment's bit length and ORs in the fragment. Shifting an ever-larger Python integer for each fixed-size fragment makes total work O(n²) for n fragments. The fragments are siblings, so the decoder's nesting-depth limit does not constrain their count; its limit on the number of length octets does not prevent the demonstrated inputs.
In 0.6.4, DER's tag-driven map disables constructed BIT STRING, while its schema-driven type map retains the inherited decoder that permits it. This explains why a schema-less DER rejection is not a negative result for all DER decoding.
Under X.690, a conforming CER constructed BIT STRING uses an indefinite-length outer encoding and primitive fragments with 1000 contents octets except possibly the last. That form reaches the affected indefinite-length loop. DER requires primitive string encoding, although the schema-driven pyasn1 decoder accepts the definite-length constructed example below.
Impact
An application is exposed when untrusted input can reach one of the affected decoder paths and its input limits admit enough fragments. The work occupies the decoding thread or worker and may cause denial of service. Whether the input is network-accessible or unauthenticated depends on the calling application. This advisory makes no claim that every application using pyasn1, or any particular protocol implementation, accepts such input.
Severity assessment (CVSS v3.1)
The 7.5 Base score assumes a reasonable application that automatically decodes attacker-supplied ASN.1 from unauthenticated network input. Valid BER and conforming CER values trigger the issue without special conditions, privileges, or user interaction. Repeated crafted values could occupy a finite decoder-worker pool and deny service while the attack continues. No confidentiality or integrity impact is demonstrated. This library-level score does not claim that every application is network-exposed or fully unavailable; deployment-specific input limits and architecture may change the score. See FIRST's library-scoring guidance.
Reproducer
The definite-length example below is valid BER. It is deliberately not a…
- Record
GHSA-2qm8-x737-gmw5- 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 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.
- Record
CVE-2026-119196- 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-04
OSV
7.5
pyasn1: Quadratic CPU consumption in constructed BIT STRING decoding
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.
- Record
CVE-2026-119196- 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-07
OSVDEBIAN-CVE-2026-119196
7.5
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.
- Record
DEBIAN-CVE-2026-119196- 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-04
Show 4 moreShow less
OSVGHSA-2qm8-x737-gmw5
7.5
pyasn1 has quadratic CPU consumption in constructed BIT STRING decoding
Summary
In pyasn1 through 0.6.4, decoding a constructed BIT STRING with many fragments repeatedly shifts and copies the entire value accumulated so far. For fixed-size fragments, CPU time grows quadratically with the encoded input size. An application that passes sufficiently large, attacker-controlled ASN.1 data to an affected decoder can suffer CPU exhaustion during decode(); no conversion or formatting of the decoded value is required.
The BER and CER decoders reach this path for constructed BIT STRING values, with or without an asn1Spec. The DER decoder rejects constructed BIT STRING in schema-less decoding, but its schema-driven path accepts a definite-length constructed BIT STRING when given a matching asn1Spec and reaches the same vulnerable code. Constructed BIT STRING is not valid DER; this DER exposure is due to decoder permissiveness. DER rejects the indefinite-length form.
This is a separate decoder path from the OBJECT IDENTIFIER accumulation fixed in CVE-2026-59885.
Technical details
In the 0.6.4 BitStringPayloadDecoder, both the definite-length and indefinite-length fragment loops call BitString.fromOctetString(..., prepend=bitString) for every fragment. fromOctetString shifts the growing SizedInteger left by the fragment's bit length and ORs in the fragment. Shifting an ever-larger Python integer for each fixed-size fragment makes total work O(n²) for n fragments. The fragments are siblings, so the decoder's nesting-depth limit does not constrain their count; its limit on the number of length octets does not prevent the demonstrated inputs.
In 0.6.4, DER's tag-driven map disables constructed BIT STRING, while its schema-driven type map retains the inherited decoder that permits it. This explains why a schema-less DER rejection is not a negative result for all DER decoding.
Under X.690, a conforming CER constructed BIT STRING uses an indefinite-length outer encoding and primitive fragments with 1000 contents octets except possibly the last. That form reaches the affected indefinite-length loop. DER requires primitive string encoding, although the schema-driven pyasn1 decoder accepts the definite-length constructed example below.
Impact
An application is exposed when untrusted input can reach one of the affected decoder paths and its input limits admit enough fragments. The work occupies the decoding thread or worker and may cause denial of service. Whether the input is network-accessible or unauthenticated depends on the calling application. This advisory makes no claim that every application using pyasn1, or any particular protocol implementation, accepts such input.
Severity assessment (CVSS v3.1)
The 7.5 Base score assumes a reasonable application that automatically decodes attacker-supplied ASN.1 from unauthenticated network input. Valid BER and conforming CER values trigger the issue without special conditions, privileges, or user interaction. Repeated crafted values could occupy a finite decoder-worker pool and deny service while the attack continues. No confidentiality or integrity impact is demonstrated. This library-level score does not claim that every application is network-exposed or fully unavailable; deployment-specific input limits and architecture may change the score. See FIRST's library-scoring guidance.
Reproducer
The definite-length example below is valid BER. It is deliberately not a…
- Record
GHSA-2qm8-x737-gmw5- 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-119196
7.5
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.
- Record
UBUNTU-CVE-2026-119196- 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-111536 No score
CVE-2026-119196 affecting package python-pyasn1 0.4.8-3
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.
- Record
AZL-111536- Updated
- 2026-11-05
OSVROOT-APP-PYPI-CVE-2026-119196 No score
CVE-2026-119196 in pyasn1 - Patched by Root
Root has patched CVE-2026-119196 in the pyasn1 package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2026-119196- 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.1 | 0.6.4+aikido.10.6.4+aikido.20.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, references | CVE List | |
| 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-119196 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.43%, the 37th percentile. Fixed in pyasn1 0.6.5.
References
Left out here: the rest of 2 source descriptions. The JSON record has them.