Описание
pyasn1 has a DoS vulnerability in decoder
Summary
After reviewing pyasn1 v0.6.1 a Denial-of-Service issue has been found that leads to memory exhaustion from malformed RELATIVE-OID with excessive continuation octets.
Details
The integer issue can be found in the decoder as reloid += ((subId << 7) + nextSubId,): https://github.com/pyasn1/pyasn1/blob/main/pyasn1/codec/ber/decoder.py#L496
PoC
For the DoS:
Screenshots with the results:
DoS
Leak analysis
A potential heap leak was investigated but came back clean:
Scenario
- An attacker creates a malicious X.509 certificate.
- The application validates certificates.
- The application accepts the malicious certificate and tries decoding resulting in the issues mentioned above.
Impact
This issue can affect resource consumption and hang systems or stop services. This may affect:
- LDAP servers
- TLS/SSL endpoints
- OCSP responders
- etc.
Recommendation
Add a limit to the allowed bytes in the decoder.
Ссылки
- https://github.com/pyasn1/pyasn1/security/advisories/GHSA-63vm-454h-vhhq
- https://nvd.nist.gov/vuln/detail/CVE-2026-23490
- https://github.com/pyasn1/pyasn1/commit/3908f144229eed4df24bd569d16e5991ace44970
- https://github.com/pyasn1/pyasn1/commit/be353d755f42ea36539b4f5053c652ddf56979a6
- https://github.com/pyasn1/pyasn1/blob/0f07d7242a78ab4d129b26256d7474f7168cf536/pyasn1/codec/ber/decoder.py#L496
- https://github.com/pyasn1/pyasn1/releases/tag/v0.6.2
- https://lists.debian.org/debian-lts-announce/2026/02/msg00002.html
Пакеты
pyasn1
= 0.6.1
0.6.2
Связанные уязвимости
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.2, a Denial-of-Service issue has been found that leads to memory exhaustion from malformed RELATIVE-OID with excessive continuation octets. This vulnerability is fixed in 0.6.2.
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.2, a Denial-of-Service issue has been found that leads to memory exhaustion from malformed RELATIVE-OID with excessive continuation octets. This vulnerability is fixed in 0.6.2.
pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.2, a Denial ...