CVE-2026-119197
pyasn1: Quadratic-complexity denial of service in binary REAL decoding
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. 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-complexity denial of service in binary REAL decoding
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.
- Record
CVE-2026-119197- 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-113353
7.5
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.
- Record
EUVD-2026-113353- 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-mm57-4v3p-rchx
7.5
pyasn1 has quadratic-complexity denial of service in binary REAL decoding
Summary
In pyasn1 0.6.4 and earlier, decoding a binary-encoded ASN.1 REAL with a large mantissa can consume CPU time quadratic in the mantissa length. The BER, CER, and DER decoders all use the affected RealPayloadDecoder. An application is exposed when it passes attacker-controlled ASN.1 containing a REAL value to one of these decoders, either without an asn1Spec or with a schema that includes REAL. The work occurs inside decode(); the application does not need to convert, print, or otherwise use the resulting REAL object.
This is distinct from CVE-2026-59886, which concerns converting an already-decoded REAL to a Python float. That issue was fixed in 0.6.4 and its advisory states that decoding alone does not trigger it.
Root cause and affected components
For binary REAL values, RealPayloadDecoder.valueDecoder in v0.6.4 builds the mantissa one octet at a time:
p = 0
while chunk:
p <<= 8
p |= chunk[0]
chunk = chunk[1:]
Each shift processes an integer that grows with the mantissa; with byte strings, each slice also copies the remaining suffix. Repeating both operations for every octet makes decoding quadratic in mantissa size. The decoder's eight-octet length-field limit does not impose a practical mantissa-size limit for the inputs demonstrated below. CER and DER reuse the BER REAL payload decoder, so all three paths reach this loop.
The vulnerable loop is present in every available repository release tag inspected, from v0.2.1 through v0.6.4. Runtime measurements below were made on v0.6.4; older releases were checked for the loop, not benchmarked individually.
Impact
A comparatively small REAL value can hold a decoder worker on one CPU core for seconds or longer. The attacker must be able to supply data that the application sends to an affected decoder, and application-level input limits may reduce exposure. The demonstrated effect is CPU exhaustion during decoding; this advisory does not assert a network endpoint, unauthenticated access, or an affected downstream application by itself.
Reproduction and evidence
The following example uses pyasn1 0.6.4. The 0x09 tag identifies REAL; 0x80 0x00 selects a positive, base-2 binary value with a one-octet zero exponent, followed by a large mantissa. It exercises decode() only.
import time
from pyasn1.codec.ber import decoder as ber
from pyasn1.codec.cer import decoder as cer
from pyasn1.codec.der import decoder as der
def real_value(mantissa_octets):
content = b"\x80\x00" + b"\xff" * mantissa_octets
length = len(content).to_bytes(3, "big")
return b"\x09\x83" + length + content
for codec in (ber, cer, der):
for size in (50_000, 100_000, 200_000):
substrate = real_value(size)
started = time.process_time()
value, rest = codec.decode(substrate)
print(codec.__name__, size, time.process_time() - started)
assert not rest
assert tuple(value)[1:] == (2, 0)
The original report measured the following BER CPU times on repository commit aa05757. That commit is later than the official v0.6.4 tag; the vulnerable loop is identical in the tagged release.
| Mantissa size | Reporter's BER CPU time | | ---: | ---: | | 50,000 octets | 0.328 s | | 100,000 octets | 1.299 s | | 200,000 octets | 6.043 s | | 400,000 octets | 24.095 s |
The same report measured 5.645 s for a 200,000-octet mantissa through DER.
A separate local reproduction on the official v0.6.4 tag (d43496f, CPython 3.14.8, macOS arm64) measured BER at 0.209 s, 0.884 s, and 3.451 s for 50,000, 100,000,…
- Record
GHSA-mm57-4v3p-rchx- 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, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.
- Record
CVE-2026-119197- 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-complexity denial of service in binary REAL decoding
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.
- Record
CVE-2026-119197- 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-119197
7.5
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.
- Record
DEBIAN-CVE-2026-119197- 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-mm57-4v3p-rchx
7.5
pyasn1 has quadratic-complexity denial of service in binary REAL decoding
Summary
In pyasn1 0.6.4 and earlier, decoding a binary-encoded ASN.1 REAL with a large mantissa can consume CPU time quadratic in the mantissa length. The BER, CER, and DER decoders all use the affected RealPayloadDecoder. An application is exposed when it passes attacker-controlled ASN.1 containing a REAL value to one of these decoders, either without an asn1Spec or with a schema that includes REAL. The work occurs inside decode(); the application does not need to convert, print, or otherwise use the resulting REAL object.
This is distinct from CVE-2026-59886, which concerns converting an already-decoded REAL to a Python float. That issue was fixed in 0.6.4 and its advisory states that decoding alone does not trigger it.
Root cause and affected components
For binary REAL values, RealPayloadDecoder.valueDecoder in v0.6.4 builds the mantissa one octet at a time:
p = 0
while chunk:
p <<= 8
p |= chunk[0]
chunk = chunk[1:]
Each shift processes an integer that grows with the mantissa; with byte strings, each slice also copies the remaining suffix. Repeating both operations for every octet makes decoding quadratic in mantissa size. The decoder's eight-octet length-field limit does not impose a practical mantissa-size limit for the inputs demonstrated below. CER and DER reuse the BER REAL payload decoder, so all three paths reach this loop.
The vulnerable loop is present in every available repository release tag inspected, from v0.2.1 through v0.6.4. Runtime measurements below were made on v0.6.4; older releases were checked for the loop, not benchmarked individually.
Impact
A comparatively small REAL value can hold a decoder worker on one CPU core for seconds or longer. The attacker must be able to supply data that the application sends to an affected decoder, and application-level input limits may reduce exposure. The demonstrated effect is CPU exhaustion during decoding; this advisory does not assert a network endpoint, unauthenticated access, or an affected downstream application by itself.
Reproduction and evidence
The following example uses pyasn1 0.6.4. The 0x09 tag identifies REAL; 0x80 0x00 selects a positive, base-2 binary value with a one-octet zero exponent, followed by a large mantissa. It exercises decode() only.
import time
from pyasn1.codec.ber import decoder as ber
from pyasn1.codec.cer import decoder as cer
from pyasn1.codec.der import decoder as der
def real_value(mantissa_octets):
content = b"\x80\x00" + b"\xff" * mantissa_octets
length = len(content).to_bytes(3, "big")
return b"\x09\x83" + length + content
for codec in (ber, cer, der):
for size in (50_000, 100_000, 200_000):
substrate = real_value(size)
started = time.process_time()
value, rest = codec.decode(substrate)
print(codec.__name__, size, time.process_time() - started)
assert not rest
assert tuple(value)[1:] == (2, 0)
The original report measured the following BER CPU times on repository commit aa05757. That commit is later than the official v0.6.4 tag; the vulnerable loop is identical in the tagged release.
| Mantissa size | Reporter's BER CPU time | | ---: | ---: | | 50,000 octets | 0.328 s | | 100,000 octets | 1.299 s | | 200,000 octets | 6.043 s | | 400,000 octets | 24.095 s |
The same report measured 5.645 s for a 200,000-octet mantissa through DER.
A separate local reproduction on the official v0.6.4 tag (d43496f, CPython 3.14.8, macOS arm64) measured BER at 0.209 s, 0.884 s, and 3.451 s for 50,000, 100,000,…
- Record
GHSA-mm57-4v3p-rchx- 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-119197
7.5
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.
- Record
UBUNTU-CVE-2026-119197- 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-111539 No score
CVE-2026-119197 affecting package python-pyasn1 0.4.8-3
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.5, binary REAL decoding builds a large mantissa one octet at a time by shifting a growing integer and slicing the remaining byte string. Attacker-controlled ASN.1 includes a binary-encoded REAL with a large mantissa and reaches BER, CER, or DER decode(), with or without a schema containing REAL. RealPayloadDecoder.valueDecoder repeatedly performs a left shift, OR, and suffix copy for every mantissa octet, making decode time quadratic in mantissa length. A comparatively small REAL value can hold a decoding worker on one CPU core for seconds or longer and cause availability loss. This issue is fixed in version 0.6.5.
- Record
AZL-111539- Updated
- 2026-11-05
OSVROOT-APP-PYPI-CVE-2026-119197 No score
CVE-2026-119197 in pyasn1 - Patched by Root
Root has patched CVE-2026-119197 in the pyasn1 package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2026-119197- 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.2 | 0.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 | 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-119197 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.