---
schema_version: '1.0'
id: security-20260812-c369c0
title: 'CVE-2026-59886: pyasn1: Uncontrolled resource consumption when converting
  decoded REAL values'
url: https://osv.dev/vulnerability/GHSA-hm4w-wwcw-mr6r
url_hash: c369c07f54bab2738cf8c561577302f5c3d6c04a653f2a5bcd51402587dc78d0
canonical_url: https://osv.dev/vulnerability/GHSA-hm4w-wwcw-mr6r
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-59886
- GHSA-hm4w-wwcw-mr6r
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- pyasn1
- PyPI
lang: en
published_at: '2026-07-21T19:11:20Z'
fetched_at: '2026-08-12T16:00:04.662586Z'
updated_at: '2026-08-22T14:45:12Z'
status: published
content_hash: 72cf5a86346d8b9f6bfc62d3495cba985798849dfc0f23ead06c5beda1677958
content_changed_at: '2026-08-22T13:15:21.777973Z'
license_note: full
summary: 'pyasn1: Uncontrolled resource consumption when converting decoded REAL values'
summary_source: rss
summary_en: 'pyasn1: Uncontrolled resource consumption when converting decoded REAL
  values'
summary_omitted_reason: null
redistribution: true
keywords_en:
- consumption
- converting
- CVE
- CVE-2026-59886
- decoded
- Energy Consumption
- GHSA-hm4w-wwcw-mr6r
- Gift 5 articles to anyone you choose each month when you subscribe
- library vulnerability
- pyasn1
- PyPI
- REAL
- resource
- Resource-Constrained Environments
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- software security
- Uncontrolled
- values
- when
entities_en:
- name: CVE
  type: data
- name: Energy Consumption
  type: measurement
- name: Gift 5 articles to anyone you choose each month when you subscribe
  type: content
- name: PyPI
  type: artifact
- name: Resource-Constrained Environments
  type: concept
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: PyPI
  type: artifact
- name: Resource-Constrained Environments
  type: concept
- name: Energy Consumption
  type: measurement
- name: Gift 5 articles to anyone you choose each month when you subscribe
  type: content
related_auto:
- name: Portal
  type: organization
  weight: 1.0
- name: Hugging Face
  type: organization
  weight: 1.0
- name: Lightweight Models
  type: other
  weight: 1.0
- name: Tokyo Waterway
  type: organization
  weight: 1.0
computed_at: '2026-08-22T14:45:09Z'
---

# CVE-2026-59886: pyasn1: Uncontrolled resource consumption when converting decoded REAL values

## TL;DR
pyasn1: Uncontrolled resource consumption when converting decoded REAL values

## Key Points
- cve / CVE-2026-59886 / GHSA-hm4w-wwcw-mr6r / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H / pyasn1 / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
**Advisory:** GHSA-hm4w-wwcw-mr6r (CVE-2026-59886)

**Details:**
### Impact
The univ.Real type converted its (mantissa, base, exponent) value to a Python float using exact big-integer exponentiation. A BER/CER/DER-encoded REAL value only a few bytes long can carry a very large exponent, causing this computation to attempt to materialize an astronomically large integer.

Any operation that triggers float conversion on such a decoded value — prettyPrint(), str(), comparison, arithmetic, or an explicit float() call — consumes excessive CPU and memory, hanging the process. Applications that decode untrusted ASN.1 data and then print, log, or compare the decoded objects are vulnerable to denial of service. Decoding alone does not trigger the issue.

### Affected components
- pyasn1.type.univ.Real — float conversion (__float__() and everything built on it: prettyPrint(), str(), comparisons, arithmetic, int())
- Reachable through the pyasn1.codec.ber, cer, and der decoders, which produce Real objects from untrusted input; also via directly constructed Real values

The encoders and the native codec are not affected. Applications that never handle ASN.1 REAL values are not affected.

### Patches
Fixed in pyasn1 0.6.4. Binary (base-2) values are now converted with math.ldexp(), and decimal (base-10) values with exponents beyond float range raise OverflowError without constructing huge intermediate integers. Existing behavior is preserved: out-of-range values raise OverflowError and prettyPrint() renders them as <overflow>.

### Workarounds
Avoid converting, printing, or comparing decoded Real objects from untrusted sources; inspect the raw (mantissa, base, exponent) tuple instead.

**References:**
- https://github.com/pyasn1/pyasn1/security/advisories/GHSA-hm4w-wwcw-mr6r
- https://nvd.nist.gov/vuln/detail/CVE-2026-59886
- https://github.com/pyasn1/pyasn1/commit/e60c691cb91addb8fcefa2f537e85ede6fb1e886
- https://github.com/pyasn1/pyasn1
- https://github.com/pyasn1/pyasn1/releases/tag/v0.6.4

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-hm4w-wwcw-mr6r_

## Source
元記事: [CVE-2026-59886: pyasn1: Uncontrolled resource consumption when converting decoded REAL values](https://osv.dev/vulnerability/GHSA-hm4w-wwcw-mr6r) — published 2026-07-21T19:11:20Z
