---
schema_version: '1.0'
id: security-20260812-00af99
title: 'CVE-2026-59884: pyasn1 BER/CER/DER decoder denial of service via unbounded
  long-form tag IDs'
url: https://osv.dev/vulnerability/GHSA-m4p7-r5rc-7g4j
url_hash: 00af992b1585397fa18c8fb652358ef940b16cd564d8a1f00378c472f2d2eaf2
canonical_url: https://osv.dev/vulnerability/GHSA-m4p7-r5rc-7g4j
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-59884
- GHSA-m4p7-r5rc-7g4j
- 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:10:11Z'
fetched_at: '2026-08-12T16:00:04.669291Z'
updated_at: '2026-08-22T14:45:12Z'
status: published
content_hash: df3f8caa8b012ffb04e97d4ed92dfef4d8f0f5c1c42a5d7bc07b1160bcee37a9
content_changed_at: '2026-08-22T13:15:21.783468Z'
license_note: full
summary: pyasn1 BER/CER/DER decoder denial of service via unbounded long-form tag
  IDs
summary_source: rss
summary_en: pyasn1 BER/CER/DER decoder denial of service via unbounded long-form tag
  IDs
summary_omitted_reason: null
redistribution: true
keywords_en:
- BER
- BerkeleyEECS
- CER
- CVE
- CVE-2026-59884
- decoder
- denial
- DER
- DerWesten.de
- GHSA-m4p7-r5rc-7g4j
- IDs
- library vulnerability
- long-form
- pyasn1
- PyPI
- service
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- software security
- tag
- unbounded
- via
entities_en:
- name: BerkeleyEECS
  type: organization
- name: CER
  type: location
- name: CVE
  type: data
- name: DerWesten.de
  type: organization
- name: PyPI
  type: artifact
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: PyPI
  type: artifact
- name: BerkeleyEECS
  type: organization
- name: CER
  type: location
- name: DerWesten.de
  type: organization
related_auto:
- name: Portal
  type: organization
  weight: 1.0
- name: Hugging Face
  type: organization
  weight: 1.0
- name: LEO Pharma
  type: organization
  weight: 1.0
- name: FC Schalke 04
  type: organization
  weight: 1.0
computed_at: '2026-08-22T14:45:10Z'
---

# CVE-2026-59884: pyasn1 BER/CER/DER decoder denial of service via unbounded long-form tag IDs

## TL;DR
pyasn1 BER/CER/DER decoder denial of service via unbounded long-form tag IDs

## Key Points
- cve / CVE-2026-59884 / GHSA-m4p7-r5rc-7g4j / 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-m4p7-r5rc-7g4j (CVE-2026-59884)

**Details:**
### Impact
The BER decoder (shared by the CER and DER codecs) parses long-form tags by accumulating continuation octets in a loop with no upper bound on the size of the tag ID. A crafted input can force the decoder to build an arbitrarily large integer, with CPU cost growing quadratically in input size — a ~1 MB input consumes over a minute of CPU. On Python 3.11+, the oversized tag ID can also trigger an unhandled `ValueError` (integer string conversion limit) while the decoder formats error messages, violating the documented `PyAsn1Error` contract and potentially bypassing caller error handling.

Any application decoding untrusted BER/CER/DER input is affected.

### Affected components
- `pyasn1.codec.ber.decoder` — `decode()` and `StreamingDecoder`
- `pyasn1.codec.cer.decoder` and `pyasn1.codec.der.decoder`, which inherit
  the same tag parsing
- `pyasn1.type.tag` — `Tag`/`TagSet` reprs could raise `ValueError` when
  rendering oversized tag IDs (reachable through decoder error paths)

The encoders and the `pyasn1.codec.native` codec are not affected.

### Patches
Fixed in 0.6.4. Long-form tag IDs are now limited to 20 octets (140-bit tag IDs, matching the existing OID arc limit); oversized tags are rejected with `PyAsn1Error`. Tag ID rendering in reprs and error messages was additionally hardened against the interpreter's integer-to-string conversion limit.

### Workarounds
Bound the size of untrusted input passed to `decode()` before calling it.

**References:**
- https://github.com/pyasn1/pyasn1/security/advisories/GHSA-m4p7-r5rc-7g4j
- https://nvd.nist.gov/vuln/detail/CVE-2026-59884
- https://github.com/pyasn1/pyasn1/commit/628e36ecbb5277a3f01572ce418ef54271b165a5
- https://github.com/pyasn1/pyasn1
- https://github.com/pyasn1/pyasn1/releases/tag/v0.6.4
- https://github.com/pypa/advisory-database/tree/main/vulns/pyasn1/PYSEC-2026-3455.yaml

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-m4p7-r5rc-7g4j_

## Source
元記事: [CVE-2026-59884: pyasn1 BER/CER/DER decoder denial of service via unbounded long-form tag IDs](https://osv.dev/vulnerability/GHSA-m4p7-r5rc-7g4j) — published 2026-07-21T19:10:11Z
