{"id":"CVE-2026-119196","aliases":["AZL-111536","DEBIAN-CVE-2026-119196","EUVD-2026-113352","GHSA-2qm8-x737-gmw5","OESA-2026-4786","OESA-2026-4787","OESA-2026-4788","OESA-2026-4789","UBUNTU-CVE-2026-119196","USN-9011-1"],"status":"published","title":"pyasn1: Quadratic CPU consumption in constructed BIT STRING decoding","description":"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.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00425,"percentile":0.37242,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-407"],"published":"2026-10-29T19:44:46Z","modified":"2026-11-11T12:45:11Z","fixes":[{"ecosystem":"PyPI","package":"pyasn1","fixed_in":["0.6.5"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:14","package":"pyasn1","fixed_in":["0.6.5-1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:14.04:LTS","package":"pyasn1","fixed_in":["0.1.7-1ubuntu2.1+esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:16.04:LTS","package":"pyasn1","fixed_in":["0.1.9-1ubuntu0.1~esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:18.04:LTS","package":"pyasn1","fixed_in":["0.4.2-3ubuntu0.18.04.1~esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:20.04:LTS","package":"pyasn1","fixed_in":["0.4.2-3ubuntu0.20.04.1~esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:22.04:LTS","package":"pyasn1","fixed_in":["0.4.8-1ubuntu0.4"],"sources":["osv"]},{"ecosystem":"Ubuntu:24.04:LTS","package":"pyasn1","fixed_in":["0.4.8-4ubuntu0.4"],"sources":["osv"]},{"ecosystem":"Ubuntu:26.10","package":"pyasn1","fixed_in":["0.6.4-1ubuntu0.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:26.04:LTS","package":"pyasn1","fixed_in":["0.6.3-1ubuntu0.2"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.6.4"},{"fixed":"0.6.5"}]}]},{"source":"osv","ecosystem":"Azure Linux:3","package":"python-pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.4.8-3"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.4.8-3","0.4.8-3+deb12u1","0.4.8-3+deb12u2","0.4.8-3+deb12u3","0.4.8-4","0.5.1-1","0.6.0-1","0.6.1-1","0.6.2-1","0.6.2-1~bpo13+1","0.6.3-1","0.6.4-1","0.6.4-1~bpo13+1","0.6.5-1"]},{"source":"osv","ecosystem":"Debian:13","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.6.1-1","0.6.1-1+deb13u1","0.6.1-1+deb13u2","0.6.1-1+deb13u3","0.6.2-1","0.6.2-1~bpo13+1","0.6.3-1","0.6.4-1","0.6.4-1~bpo13+1","0.6.5-1"]},{"source":"osv","ecosystem":"Debian:14","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.6.5-1"}]}],"versions":["0.6.1-1","0.6.2-1","0.6.2-1~bpo13+1","0.6.3-1","0.6.4-1","0.6.4-1~bpo13+1"]},{"source":"osv","ecosystem":"PyPI","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.6.5"}]}],"versions":["0.0.10a","0.0.11a","0.0.12a","0.0.13","0.0.13a","0.0.13b","0.0.6a","0.0.9a","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.2.1","0.2.2","0.2.3","0.3.1","0.3.2","0.3.3","0.3.4","0.3.5","0.3.6","0.3.7","0.4.1","0.4.2","0.4.3","0.4.4","0.4.5","0.4.6","0.4.7","0.4.8","0.5.0","0.5.1","0.6.0","0.6.1","0.6.2","0.6.3","0.6.4"]},{"source":"osv","ecosystem":"openEuler:24.03-LTS-SP1","package":"python-pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.5.1-5.oe2403sp1"}]}],"bundled":4},{"source":"osv","ecosystem":"openEuler:24.03-LTS-SP3","package":"python-pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.5.1-5.oe2403sp3"}]}],"bundled":4},{"source":"osv","ecosystem":"openEuler:24.03-LTS-SP4","package":"python-pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.5.1-5.oe2403sp4"}]}],"bundled":4},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP4","package":"python-pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.8-8.oe2203sp4"}]}],"bundled":4},{"source":"osv","ecosystem":"Ubuntu:Pro:14.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.7-1ubuntu2.1+esm2"}]}],"versions":["0.1.4-0ubuntu1","0.1.7-1ubuntu1","0.1.7-1ubuntu2","0.1.7-1ubuntu2.1","0.1.7-1ubuntu2.1+esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.9-1ubuntu0.1~esm2"}]}],"versions":["0.1.8-2","0.1.9-1","0.1.9-1ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.2-3ubuntu0.18.04.1~esm2"}]}],"versions":["0.1.9-2","0.4.2-3","0.4.2-3ubuntu0.18.04.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.2-3ubuntu0.20.04.1~esm2"}]}],"versions":["0.4.2-3","0.4.2-3build1","0.4.2-3ubuntu0.20.04.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.8-1ubuntu0.4"}]}],"versions":["0.4.8-1","0.4.8-1ubuntu0.1","0.4.8-1ubuntu0.2","0.4.8-1ubuntu0.3"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.8-4ubuntu0.4"}]}],"versions":["0.4.8-4","0.4.8-4ubuntu0.1","0.4.8-4ubuntu0.2","0.4.8-4ubuntu0.3"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.6.4-1ubuntu0.1"}]}],"versions":["0.6.3-1","0.6.4-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.6.3-1ubuntu0.2"}]}],"versions":["0.6.1-1","0.6.1-1build1","0.6.2-1","0.6.3-1","0.6.3-1ubuntu0.1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:14.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.7-1ubuntu2.1+esm2"}]}],"versions":["0.1.4-0ubuntu1","0.1.7-1ubuntu1","0.1.7-1ubuntu2","0.1.7-1ubuntu2.1","0.1.7-1ubuntu2.1+esm1"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.9-1ubuntu0.1~esm2"}]}],"versions":["0.1.8-2","0.1.9-1","0.1.9-1ubuntu0.1~esm1"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.2-3ubuntu0.18.04.1~esm2"}]}],"versions":["0.1.9-2","0.4.2-3","0.4.2-3ubuntu0.18.04.1~esm1"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.2-3ubuntu0.20.04.1~esm2"}]}],"versions":["0.4.2-3","0.4.2-3build1","0.4.2-3ubuntu0.20.04.1~esm1"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.8-1ubuntu0.4"}]}],"versions":["0.4.8-1","0.4.8-1ubuntu0.1","0.4.8-1ubuntu0.2","0.4.8-1ubuntu0.3"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.8-4ubuntu0.4"}]}],"versions":["0.4.8-4","0.4.8-4ubuntu0.1","0.4.8-4ubuntu0.2","0.4.8-4ubuntu0.3"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.6.4-1ubuntu0.1"}]}],"versions":["0.6.3-1","0.6.4-1"],"bundled":7},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"pyasn1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.6.3-1ubuntu0.2"}]}],"versions":["0.6.1-1","0.6.1-1build1","0.6.2-1","0.6.3-1","0.6.3-1ubuntu0.1"],"bundled":7}],"products":[{"vendor":"pyasn1","product":"pyasn1"}],"references":[{"url":"https://github.com/pyasn1/pyasn1/security/advisories/GHSA-2qm8-x737-gmw5","tags":["x_refsource_CONFIRM","exploit","advisory","web","report"]},{"url":"https://github.com/pyasn1/pyasn1/pull/132","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/pyasn1/pyasn1/commit/73ba7b043cc7e92cb37f16f2c955bff93b0e6f6c","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/pyasn1/pyasn1/releases/tag/v0.6.5","tags":["x_refsource_MISC","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-119196","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-2qm8-x737-gmw5"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/119xxx/CVE-2026-119196.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-119196","tags":["advisory"]},{"url":"https://github.com/pyasn1/pyasn1","tags":["package"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-4786","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-119194","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-119195","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-119197","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-4787","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-4788","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-4789","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-119196","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-119196","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-9011-1","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-59884","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-59885","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-59886","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-119194","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-119195","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-119197","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-119196","title":"pyasn1: Quadratic CPU consumption in constructed BIT STRING decoding","description":"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.","status":"published","published":"2026-10-29T19:44:46.031Z","modified":"2026-11-04T01:40:46.787Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-407"],"updated_at":"2026-11-04T02:49:29.029968Z"}],"euvd":[{"id":"EUVD-2026-113352","description":"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.","status":"published","published":"2026-10-29T19:44:46Z","modified":"2026-11-04T01:40:46Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-04T03:57:29.097782Z"}],"ghsa":[{"id":"GHSA-2qm8-x737-gmw5","title":"pyasn1 has quadratic CPU consumption in constructed BIT STRING decoding","description":"## Summary\n\nIn 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.\n\nThe 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.\n\nThis is a separate decoder path from the OBJECT IDENTIFIER accumulation fixed in [CVE-2026-59885](https://github.com/advisories/GHSA-8ppf-4f7h-5ppj).\n\n## Technical details\n\nIn the 0.6.4 [`BitStringPayloadDecoder`](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/codec/ber/decoder.py#L173-L301), both the [definite-length](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/codec/ber/decoder.py#L237-L255) and [indefinite-length](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/codec/ber/decoder.py#L275-L301) fragment loops call `BitString.fromOctetString(..., prepend=bitString)` for every fragment. [`fromOctetString`](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/type/univ.py#L614-L627) 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.\n\nIn 0.6.4, DER's [tag-driven map](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/codec/der/decoder.py#L15-L40) 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.\n\nUnder [X.690](https://www.itu.int/rec/T-REC-X.690-202102-I/en), 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.\n\n## Impact\n\nAn 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.\n\n## Severity assessment (CVSS v3.1)\n\nThe 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](https://www.first.org/cvss/v3-1/user-guide).\n\n## Reproducer\n\nThe definite-length example below is valid BER. It is deliberately not a conforming CER or DER encoding. The second constructor uses conforming CER fragment sizing and framing. CPU times are machine-dependent; run the larger cases only in a local test environment.\n\n```python\nimport time\n\nfrom pyasn1.codec.ber import decoder as ber_decoder\nfrom pyasn1.codec.cer import decoder as cer_decoder\nfrom pyasn1.codec.der import decoder as der_decoder\nfrom pyasn1.error import PyAsn1Error\nfrom pyasn1.type import univ\n\n\ndef encode_length(size):\n    octets = size.to_bytes((size.bit_length() + 7) // 8, \"big\")\n    return bytes((0x80 | len(octets),)) + octets\n\n\ndef definite_fragments(count):\n    body = b\"\\x03\\x02\\x00\\xa5\" * count  # one data octet per BIT STRING fragment\n    return b\"\\x23\" + encode_length(len(body)) + body\n\n\ndef cer_fragments(count):\n    # Each primitive fragment has 1000 contents octets: one unused-bits\n    # octet (zero) followed by 999 data octets.\n    fragment = b\"\\x03\" + encode_length(1000) + b\"\\x00\" + b\"\\xa5\" * 999\n    return b\"\\x23\\x80\" + fragment * count + b\"\\x00\\x00\"\n\n\ndef measure(label, decode, payload, **options):\n    start = time.process_time()\n    value, remainder = decode(payload, **options)\n    print(label, len(payload), f\"{time.process_time() - start:.3f}s CPU\")\n    assert not remainder and len(value) \u003e 0\n\n\nfor count in (50_000, 100_000, 200_000):\n    measure(f\"BER {count} fragments\", ber_decoder.decode,\n            definite_fragments(count))\n\nfor count in (1_000, 2_000, 4_000):\n    measure(f\"CER {count} fragments\", cer_decoder.decode,\n            cer_fragments(count))\n\nsample = definite_fragments(1_000)\nmeasure(\"DER with BIT STRING schema\", der_decoder.decode, sample,\n        asn1Spec=univ.BitString())\ntry:\n    der_decoder.decode(sample)\nexcept PyAsn1Error:\n    print(\"DER without schema rejects the constructed value\")\nelse:\n    raise AssertionError(\"DER unexpectedly accepted schema-less input\")\n```\n\n## Verification\n\nLocal measurements of the official v0.6.4 tag on CPython 3.14.8 used `time.process_time()`. A local 0.6.5 candidate containing the fix was timed on the same machine. Times are illustrative, not a guaranteed cost on other systems.\n\n| Input | Size | v0.6.4 CPU | 0.6.5 candidate CPU |\n| --- | ---: | ---: | ---: |\n| BER definite, 50,000 fragments | 0.20 MB | 0.530 s | 0.084 s |\n| BER definite, 100,000 fragments | 0.40 MB | 1.915 s | 0.170 s |\n| BER definite, 200,000 fragments | 0.80 MB | 7.392 s | 0.344 s |\n| Conforming CER, 1,000 fragments | 1.004 MB | 0.163 s | 0.0035 s |\n| Conforming CER, 2,000 fragments | 2.008 MB | 0.657 s | 0.0070 s |\n| Conforming CER, 4,000 fragments | 4.016 MB | 2.582 s | 0.0144 s |\n\nThe definite BER input with 100,000 fragments also decoded through DER with `asn1Spec=univ.BitString()` in 1.949 s on v0.6.4, versus 0.172 s with the 0.6.5 candidate. Schema-less DER rejected the same input. Independent reports reproduced the old behavior on v0.6.4: one measured 21.1 s for a 1.28 MB definite-length value; another measured 7.25 s for a 0.8 MB value versus 2.8 ms for a primitive BIT STRING carrying the same data volume. These measurements were taken on different systems and should not be compared as a single benchmark series.\n\n## Resolution\n\nUpgrade to pyasn1 0.6.5. The decoder assembles fragment bits in a `bytearray`, preserves decoded bit values including intermediate-fragment padding, and converts the complete payload to a BIT STRING once. This removes the repeated shift of the growing integer in both constructed decoding loops.\n\nFor applications that cannot upgrade immediately, enforce an application-appropriate limit on untrusted ASN.1 input size **before** passing it to pyasn1. Such a limit bounds exposure but does not change the quadratic behavior of 0.6.4. Where a protocol forbids constructed BIT STRING, rejecting that encoding before decoding also prevents this path.","status":"published","published":"2026-10-30T23:07:04Z","modified":"2026-10-30T23:07:05Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-407"],"updated_at":"2026-11-02T14:41:42.013329Z"}],"nvd":[{"id":"CVE-2026-119196","description":"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.","status":"published","published":"2026-10-29T20:17:30.77Z","modified":"2026-11-04T02:17:18.177Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"secondary"}],"cwes":["CWE-407"],"updated_at":"2026-11-04T06:53:34.694679Z"}],"osv":[{"id":"CVE-2026-119196","title":"pyasn1: Quadratic CPU consumption in constructed BIT STRING decoding","description":"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.","status":"published","published":"2026-10-29T19:44:46.031Z","modified":"2026-11-05T02:30:58.73223257Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-407"],"updated_at":"2026-11-07T03:08:01.41647Z"},{"id":"DEBIAN-CVE-2026-119196","description":"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.","status":"published","published":"2026-10-29T20:17:30.77Z","modified":"2026-11-04T09:47:34.156421574Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-04T10:05:32.187009Z"},{"id":"GHSA-2qm8-x737-gmw5","title":"pyasn1 has quadratic CPU consumption in constructed BIT STRING decoding","description":"## Summary\n\nIn 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.\n\nThe 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.\n\nThis is a separate decoder path from the OBJECT IDENTIFIER accumulation fixed in [CVE-2026-59885](https://github.com/advisories/GHSA-8ppf-4f7h-5ppj).\n\n## Technical details\n\nIn the 0.6.4 [`BitStringPayloadDecoder`](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/codec/ber/decoder.py#L173-L301), both the [definite-length](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/codec/ber/decoder.py#L237-L255) and [indefinite-length](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/codec/ber/decoder.py#L275-L301) fragment loops call `BitString.fromOctetString(..., prepend=bitString)` for every fragment. [`fromOctetString`](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/type/univ.py#L614-L627) 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.\n\nIn 0.6.4, DER's [tag-driven map](https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/codec/der/decoder.py#L15-L40) 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.\n\nUnder [X.690](https://www.itu.int/rec/T-REC-X.690-202102-I/en), 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.\n\n## Impact\n\nAn 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.\n\n## Severity assessment (CVSS v3.1)\n\nThe 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](https://www.first.org/cvss/v3-1/user-guide).\n\n## Reproducer\n\nThe definite-length example below is valid BER. It is deliberately not a conforming CER or DER encoding. The second constructor uses conforming CER fragment sizing and framing. CPU times are machine-dependent; run the larger cases only in a local test environment.\n\n```python\nimport time\n\nfrom pyasn1.codec.ber import decoder as ber_decoder\nfrom pyasn1.codec.cer import decoder as cer_decoder\nfrom pyasn1.codec.der import decoder as der_decoder\nfrom pyasn1.error import PyAsn1Error\nfrom pyasn1.type import univ\n\n\ndef encode_length(size):\n    octets = size.to_bytes((size.bit_length() + 7) // 8, \"big\")\n    return bytes((0x80 | len(octets),)) + octets\n\n\ndef definite_fragments(count):\n    body = b\"\\x03\\x02\\x00\\xa5\" * count  # one data octet per BIT STRING fragment\n    return b\"\\x23\" + encode_length(len(body)) + body\n\n\ndef cer_fragments(count):\n    # Each primitive fragment has 1000 contents octets: one unused-bits\n    # octet (zero) followed by 999 data octets.\n    fragment = b\"\\x03\" + encode_length(1000) + b\"\\x00\" + b\"\\xa5\" * 999\n    return b\"\\x23\\x80\" + fragment * count + b\"\\x00\\x00\"\n\n\ndef measure(label, decode, payload, **options):\n    start = time.process_time()\n    value, remainder = decode(payload, **options)\n    print(label, len(payload), f\"{time.process_time() - start:.3f}s CPU\")\n    assert not remainder and len(value) \u003e 0\n\n\nfor count in (50_000, 100_000, 200_000):\n    measure(f\"BER {count} fragments\", ber_decoder.decode,\n            definite_fragments(count))\n\nfor count in (1_000, 2_000, 4_000):\n    measure(f\"CER {count} fragments\", cer_decoder.decode,\n            cer_fragments(count))\n\nsample = definite_fragments(1_000)\nmeasure(\"DER with BIT STRING schema\", der_decoder.decode, sample,\n        asn1Spec=univ.BitString())\ntry:\n    der_decoder.decode(sample)\nexcept PyAsn1Error:\n    print(\"DER without schema rejects the constructed value\")\nelse:\n    raise AssertionError(\"DER unexpectedly accepted schema-less input\")\n```\n\n## Verification\n\nLocal measurements of the official v0.6.4 tag on CPython 3.14.8 used `time.process_time()`. A local 0.6.5 candidate containing the fix was timed on the same machine. Times are illustrative, not a guaranteed cost on other systems.\n\n| Input | Size | v0.6.4 CPU | 0.6.5 candidate CPU |\n| --- | ---: | ---: | ---: |\n| BER definite, 50,000 fragments | 0.20 MB | 0.530 s | 0.084 s |\n| BER definite, 100,000 fragments | 0.40 MB | 1.915 s | 0.170 s |\n| BER definite, 200,000 fragments | 0.80 MB | 7.392 s | 0.344 s |\n| Conforming CER, 1,000 fragments | 1.004 MB | 0.163 s | 0.0035 s |\n| Conforming CER, 2,000 fragments | 2.008 MB | 0.657 s | 0.0070 s |\n| Conforming CER, 4,000 fragments | 4.016 MB | 2.582 s | 0.0144 s |\n\nThe definite BER input with 100,000 fragments also decoded through DER with `asn1Spec=univ.BitString()` in 1.949 s on v0.6.4, versus 0.172 s with the 0.6.5 candidate. Schema-less DER rejected the same input. Independent reports reproduced the old behavior on v0.6.4: one measured 21.1 s for a 1.28 MB definite-length value; another measured 7.25 s for a 0.8 MB value versus 2.8 ms for a primitive BIT STRING carrying the same data volume. These measurements were taken on different systems and should not be compared as a single benchmark series.\n\n## Resolution\n\nUpgrade to pyasn1 0.6.5. The decoder assembles fragment bits in a `bytearray`, preserves decoded bit values including intermediate-fragment padding, and converts the complete payload to a BIT STRING once. This removes the repeated shift of the growing integer in both constructed decoding loops.\n\nFor applications that cannot upgrade immediately, enforce an application-appropriate limit on untrusted ASN.1 input size **before** passing it to pyasn1. Such a limit bounds exposure but does not change the quadratic behavior of 0.6.4. Where a protocol forbids constructed BIT STRING, rejecting that encoding before decoding also prevents this path.","status":"published","published":"2026-10-30T23:07:04Z","modified":"2026-10-30T23:15:04.525223875Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-407"],"updated_at":"2026-11-02T15:46:34.700741Z"},{"id":"OESA-2026-4786","title":"python-pyasn1 security update","description":"Abstract Syntax Notation One (ASN.1) is a technology for exchanging structured data in a universally understood, hardware agnostic way. Many industrial, security and telephony applications heavily rely on ASN.1. The pyasn1 library implements ASN.1 support in pure-Python.\r\n\r\nSecurity Fix(es):\n\npyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component\u0026apos;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.(CVE-2026-119194)\n\npyasn1 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.(CVE-2026-119195)\n\npyasn1 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.(CVE-2026-119196)\n\npyasn1 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.(CVE-2026-119197)","status":"published","published":"2026-11-11T12:26:09Z","modified":"2026-11-11T12:45:11.084248728Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-11T13:08:46.301371Z"},{"id":"OESA-2026-4787","title":"python-pyasn1 security update","description":"Abstract Syntax Notation One (ASN.1) is a technology for exchanging structured data in a universally understood, hardware agnostic way. Many industrial, security and telephony applications heavily rely on ASN.1. The pyasn1 library implements ASN.1 support in pure-Python.\r\n\r\nSecurity Fix(es):\n\npyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component\u0026apos;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.(CVE-2026-119194)\n\npyasn1 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.(CVE-2026-119195)\n\npyasn1 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.(CVE-2026-119196)\n\npyasn1 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.(CVE-2026-119197)","status":"published","published":"2026-11-11T12:26:09Z","modified":"2026-11-11T12:45:03.182962994Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-11T13:08:46.301371Z"},{"id":"OESA-2026-4788","title":"python-pyasn1 security update","description":"Abstract Syntax Notation One (ASN.1) is a technology for exchanging structured data in a universally understood, hardware agnostic way. Many industrial, security and telephony applications heavily rely on ASN.1. The pyasn1 library implements ASN.1 support in pure-Python.\r\n\r\nSecurity Fix(es):\n\npyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component\u0026apos;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.(CVE-2026-119194)\n\npyasn1 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.(CVE-2026-119195)\n\npyasn1 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.(CVE-2026-119196)\n\npyasn1 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.(CVE-2026-119197)","status":"published","published":"2026-11-11T12:26:10Z","modified":"2026-11-11T12:45:06.691643578Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-11T13:08:46.301371Z"},{"id":"OESA-2026-4789","title":"python-pyasn1 security update","description":"Abstract Syntax Notation One (ASN.1) is a technology for exchanging structured data in a universally understood, hardware agnostic way. Many industrial, security and telephony applications heavily rely on ASN.1. The pyasn1 library implements ASN.1 support in pure-Python.\r\n\r\nSecurity Fix(es):\n\npyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component\u0026apos;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.(CVE-2026-119194)\n\npyasn1 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.(CVE-2026-119195)\n\npyasn1 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.(CVE-2026-119196)\n\npyasn1 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.(CVE-2026-119197)","status":"published","published":"2026-11-11T12:26:11Z","modified":"2026-11-11T12:45:06.747288033Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-11T13:08:46.301371Z"},{"id":"UBUNTU-CVE-2026-119196","description":"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.","status":"published","published":"2026-10-29T20:17:00Z","modified":"2026-11-11T09:37:13.404218301Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-11T10:01:18.620522Z"},{"id":"AZL-111536","title":"CVE-2026-119196 affecting package python-pyasn1 0.4.8-3","description":"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.","status":"published","published":"2026-10-29T20:17:30Z","modified":"2026-11-05T05:40:51Z","updated_at":"2026-11-05T16:41:18.705965Z"},{"id":"USN-9011-1","title":"pyasn1 vulnerabilities","description":"It was discovered that pyasn1 did not properly bound the size of long-form\ntag identifiers when parsing BER, CER, or DER encoded data. An attacker\ncould possibly use this issue to cause applications decoding untrusted\nASN.1 data to consume excessive CPU resources, resulting in a denial of\nservice. This issue only affected Ubuntu 14.04 LTS, Ubuntu 16.04 LTS,\nUbuntu 18.04 LTS, and Ubuntu 20.04 LTS. (CVE-2026-59884)\n\nIt was discovered that pyasn1 processed OBJECT IDENTIFIER and RELATIVE-OID\nvalues in quadratic time relative to the number of arcs. An attacker could\npossibly use this issue to cause applications decoding untrusted ASN.1 data\nto consume excessive CPU resources, resulting in a denial of service. This\nissue only affected Ubuntu 14.04 LTS, Ubuntu 16.04 LTS, Ubuntu 18.04 LTS,\nand Ubuntu 20.04 LTS. (CVE-2026-59885)\n\nIt was discovered that pyasn1 incorrectly handled conversion of decoded\nREAL values to Python float types. An attacker could possibly use this\nissue to cause applications decoding untrusted ASN.1 data to consume\nexcessive CPU and memory resources, resulting in a denial of service. This\nissue only affected Ubuntu 14.04 LTS, Ubuntu 16.04 LTS, Ubuntu 18.04 LTS,\nand Ubuntu 20.04 LTS. (CVE-2026-59886)\n\nIt was discovered that pyasn1 incorrectly handled tracking component types\nwhen decoding containers without a schema. An attacker could possibly use\nthis issue to cause applications decoding untrusted ASN.1 data to consume\nexcessive CPU resources, resulting in a denial of service. This issue only\naffected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Ubuntu 22.04 LTS, Ubuntu 24.04\nLTS, Ubuntu 26.04 LTS, and Ubuntu 26.10. (CVE-2026-119194)\n\nIt was discovered that pyasn1 processed fragmented constructed strings and\nindefinite-length ANY values in quadratic time. An attacker could possibly\nuse this issue to cause applications decoding untrusted ASN.1 data to\nconsume excessive CPU resources, resulting in a denial of service. This\nissue was only addressed in Ubuntu 26.04 LTS and Ubuntu 26.10.\n(CVE-2026-119195)\n\nIt was discovered that pyasn1 processed fragmented constructed BIT STRING\nvalues in quadratic time. An attacker could possibly use this issue to\ncause applications decoding untrusted ASN.1 data to consume excessive CPU\nresources, resulting in a denial of service. (CVE-2026-119196)\n\nIt was discovered that pyasn1 processed binary-encoded REAL values with\nlarge mantissas in quadratic time. An attacker could possibly use this\nissue to cause applications decoding untrusted ASN.1 data to consume\nexcessive CPU resources, resulting in a denial of service.\n(CVE-2026-119197)","status":"published","published":"2026-11-09T16:15:14Z","modified":"2026-11-11T09:34:57.290482225Z","updated_at":"2026-11-10T03:21:46.325253Z"}]}}
