pyasn1: Uncontrolled resource consumption when converting decoded REAL values (CVE-2026-59886)
pyasn1 versions prior to 0.6.4 contain a vulnerability in the univ.Real type where converting decoded REAL values to Python floats can cause uncontrolled resource consumption. This occurs because very large exponents in BER/CER/DER-encoded REAL values trigger expensive big-integer exponentiation, leading to excessive CPU and memory use. The issue affects float conversions including prettyPrint(), str(), comparisons, arithmetic, and explicit float() calls on decoded REAL values. Applications decoding untrusted ASN.1 data that then convert or print these REAL values are vulnerable to denial of service. The vulnerability is fixed in pyasn1 version 0.6.4. Avoid converting or printing REAL objects from untrusted sources as a workaround.
AI Analysis
Technical Summary
The pyasn1 library's univ.Real type converts (mantissa, base, exponent) tuples from decoded ASN.1 REAL values into Python floats using exact big-integer exponentiation. When the exponent is very large, this conversion attempts to create an astronomically large integer, causing excessive CPU and memory consumption. This resource exhaustion can hang the process during any float conversion operation such as prettyPrint(), str(), comparisons, arithmetic, or explicit float() calls. The vulnerability affects pyasn1.type.univ.Real objects produced by BER, CER, and DER decoders from untrusted input. The issue does not occur during decoding alone but only when float conversion is triggered. The vulnerability is fixed in pyasn1 version 0.6.4, which uses math.ldexp() for binary values and raises OverflowError for decimal values with out-of-range exponents, preventing large intermediate integer construction.
Potential Impact
This vulnerability allows an attacker to cause denial of service by supplying ASN.1 data with REAL values that have very large exponents. When the application converts these decoded REAL values to floats (via printing, logging, comparison, or arithmetic), it consumes excessive CPU and memory, potentially hanging or crashing the process. There is no impact on confidentiality or integrity, only availability is affected.
Mitigation Recommendations
A fix is available in pyasn1 version 0.6.4. Users should upgrade to this version to prevent the vulnerability. Until upgraded, avoid converting, printing, or comparing decoded Real objects from untrusted sources. Instead, inspect the raw (mantissa, base, exponent) tuple to avoid triggering float conversion.
pyasn1: Uncontrolled resource consumption when converting decoded REAL values (CVE-2026-59886)
Description
pyasn1 versions prior to 0.6.4 contain a vulnerability in the univ.Real type where converting decoded REAL values to Python floats can cause uncontrolled resource consumption. This occurs because very large exponents in BER/CER/DER-encoded REAL values trigger expensive big-integer exponentiation, leading to excessive CPU and memory use. The issue affects float conversions including prettyPrint(), str(), comparisons, arithmetic, and explicit float() calls on decoded REAL values. Applications decoding untrusted ASN.1 data that then convert or print these REAL values are vulnerable to denial of service. The vulnerability is fixed in pyasn1 version 0.6.4. Avoid converting or printing REAL objects from untrusted sources as a workaround.
CVSS v3.1
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The pyasn1 library's univ.Real type converts (mantissa, base, exponent) tuples from decoded ASN.1 REAL values into Python floats using exact big-integer exponentiation. When the exponent is very large, this conversion attempts to create an astronomically large integer, causing excessive CPU and memory consumption. This resource exhaustion can hang the process during any float conversion operation such as prettyPrint(), str(), comparisons, arithmetic, or explicit float() calls. The vulnerability affects pyasn1.type.univ.Real objects produced by BER, CER, and DER decoders from untrusted input. The issue does not occur during decoding alone but only when float conversion is triggered. The vulnerability is fixed in pyasn1 version 0.6.4, which uses math.ldexp() for binary values and raises OverflowError for decimal values with out-of-range exponents, preventing large intermediate integer construction.
Potential Impact
This vulnerability allows an attacker to cause denial of service by supplying ASN.1 data with REAL values that have very large exponents. When the application converts these decoded REAL values to floats (via printing, logging, comparison, or arithmetic), it consumes excessive CPU and memory, potentially hanging or crashing the process. There is no impact on confidentiality or integrity, only availability is affected.
Mitigation Recommendations
A fix is available in pyasn1 version 0.6.4. Users should upgrade to this version to prevent the vulnerability. Until upgraded, avoid converting, printing, or comparing decoded Real objects from untrusted sources. Instead, inspect the raw (mantissa, base, exponent) tuple to avoid triggering float conversion.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-hm4w-wwcw-mr6r
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-59886"]
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a600ac89c2644c7f8fe3c03
Added to database: 07/22/2026, 00:11:52 UTC
Last enriched: 07/22/2026, 00:57:08 UTC
Last updated: 07/22/2026, 02:02:28 UTC
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.