CVE-2026-119194
CPU‑exhaustion via hash‑collision attack on pyasn1's schemaless decoder (quadratic parsing).
- CVSS 7.5
- CWE-407
- Resource Management
- Remote
pyasn1 is a generic ASN.1 library for Python. From 0.3.3 until 0.6.5, schemaless container decoding stores every decoded component'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.
- CWE
- CWE-407
- CVSS base score
- 7.5
- Published
- 2026-10-29
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Algorithm
- Code defect classification
- Incorrect Algorithm
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- pyasn1
- Fixed by upgrading
- Yes
Solution
Upgrade pyasn1 to version 0.6.5 or later.
Vulnerable code sample
from pyasn1.codec.ber import decoder
from pyasn1.type.univ import Sequence
def parse_ber(data: bytes) -> Sequence:
# VULNERABLE: stores every component TagSet in a growing set, causing quadratic work on crafted inputs
decoded, _ = decoder.decode(data) # schemaless decode
tag_set_collection = set()
for component in decoded:
tag_set_collection.add(component.getTagSet())
return decodedPatched code sample
from pyasn1.codec.ber import decoder
from pyasn1.type.univ import Sequence
def parse_ber(data: bytes) -> Sequence:
# FIX: track only whether a component is constructed, avoiding a growing TagSet set
decoded, _ = decoder.decode(data) # schemaless decode
has_constructed = False
for component in decoded:
if component.isValue:
has_constructed = True
break
return decodedPublished fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Fix quadratic CPU use in schemaless container decoding (pyasn1/pyasn1)
pyasn1/codec/ber/decoder.py · ConstructedPayloadDecoderBase._decodeComponentsSchemaless
Cite this entry
@misc{vaitp:cve2026119194,
title = {{CPU‑exhaustion via hash‑collision attack on pyasn1's schemaless decoder (quadratic parsing).}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-119194},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-119194/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
