{"id":"CVE-2026-59884","aliases":["CVE-2026-59884","GHSA-m4p7-r5rc-7g4j","PYSEC-2026-3455"],"related":[],"kind":"vulnerability","state":"published","title":"pyasn1 BER/CER/DER decoder denial of service via unbounded long-form tag IDs","summary":"pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.4, the BER decoder shared by the CER and DER codecs parses long-form tags by accumulating continuation octets without an upper bound on the tag ID size, allowing a crafted input to force construction of an arbitrarily large integer with CPU cost growing quadratically and to trigger unhandled ValueError exceptions in Python 3.11+ error formatting paths. Any application decoding untrusted BER, CER, or DER input is affected. This issue is fixed in version 0.6.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.4, the BER decoder shared by the CER and DER codecs parses long-form tags by accumulating continuation octets without an upper bound on the tag ID size, allowing a crafted input to force construction of an arbitrarily large integer with CPU cost growing quadratically and to trigger unhandled ValueError exceptions in Python 3.11+ error formatting paths. Any application decoding untrusted BER, CER, or DER input is affected. This issue is fixed in version 0.6.4.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe BER decoder (shared by the CER and DER codecs) parses long-form tags by accumulating continuation octets in a loop with no upper bound on the size of the tag ID. A crafted input can force the decoder to build an arbitrarily large integer, with CPU cost growing quadratically in input size — a ~1 MB input consumes over a minute of CPU. On Python 3.11+, the oversized tag ID can also trigger an unhandled `ValueError` (integer string conversion limit) while the decoder formats error messages, violating the documented `PyAsn1Error` contract and potentially bypassing caller error handling.\n\nAny application decoding untrusted BER/CER/DER input is affected.\n\n### Affected components\n- `pyasn1.codec.ber.decoder` — `decode()` and `StreamingDecoder`\n- `pyasn1.codec.cer.decoder` and `pyasn1.codec.der.decoder`, which inherit\n  the same tag parsing\n- `pyasn1.type.tag` — `Tag`/`TagSet` reprs could raise `ValueError` when\n  rendering oversized tag IDs (reachable through decoder error paths)\n\nThe encoders and the `pyasn1.codec.native` codec are not affected.\n\n### Patches\nFixed in 0.6.4. Long-form tag IDs are now limited to 20 octets (140-bit tag IDs, matching the existing OID arc limit); oversized tags are rejected with `PyAsn1Error`. Tag ID rendering in reprs and error messages was additionally hardened against the interpreter's integer-to-string conversion limit.\n\n### Workarounds\nBound the size of untrusted input passed to `decode()` before calling it.","format":"markdown","source":"ghsa"}],"published":"2026-07-14T16:41:10.277Z","modified":"2026-09-10T03:50:52.562Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-400"],"affected":[{"ranges":[{"version":"< 0.6.4","status":"affected"}],"vendor":"pyasn1","product":"pyasn1","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.6.4"}],"ecosystem":"PyPI","package":"pyasn1","purl":"pkg:pypi/pyasn1","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.6.4"}],"vendor":"pyasn1","product":"pyasn1","cpe":"cpe:2.3:a:pyasn1:pyasn1:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.6.4"}],"ecosystem":"PyPI","package":"pyasn1","purl":"pkg:pypi/pyasn1","source":"pysec"}],"references":[{"url":"https://github.com/pyasn1/pyasn1/security/advisories/GHSA-m4p7-r5rc-7g4j","tags":["advisory","third-party-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyasn1/pyasn1/commit/628e36ecbb5277a3f01572ce418ef54271b165a5","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyasn1/pyasn1/releases/tag/v0.6.4","tags":["advisory","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59884","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pyasn1/pyasn1","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/pyasn1/PYSEC-2026-3455.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-07-15T13:50:17.314Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59884","url":"https://www.cve.org/CVERecord?id=CVE-2026-59884","licence":"CVE Terms of Use","modified":"2026-07-15T13:50:29.814Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m4p7-r5rc-7g4j","url":"https://github.com/advisories/GHSA-m4p7-r5rc-7g4j","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:52.562Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59884","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59884","licence":"Public domain","modified":"2026-07-21T14:37:52.160Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3455","url":"https://osv.dev/vulnerability/PYSEC-2026-3455","licence":"CC-BY-4.0","modified":"2026-07-22T11:00:08.839Z"}],"updatedAt":"2026-11-25T22:59:27.998Z","epss":{"score":0.00349,"percentile":0.30589,"date":"2026-12-01T12:00:22.000Z"}}