Inefficient Algorithmic Complexity Affecting pyasn1 package, versions [,0.6.5)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.43% (37th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-PYASN1-22113908
  • published1 Nov 2026
  • disclosed30 Oct 2026
  • creditmanus-use, Daniel Coles, ucsurf, Adrian Korwel

Introduced: 30 Oct 2026

NewCVE-2026-119196  (opens in a new tab)
CWE-407  (opens in a new tab)

How to fix?

Upgrade pyasn1 to version 0.6.5 or higher.

Overview

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the BitStringPayloadDecoder class in pyasn1/codec/ber/decoder.py. An attacker can exhaust CPU during a decode() call by supplying a constructed BIT STRING with many fragments, because each fragment calls BitString.fromOctetString(..., prepend=bitString), which re-shifts and copies the entire value accumulated so far. Exploitation requires untrusted ASN.1 input to reach the decoder with no upstream input-size limit, and affects BER and CER decoding with or without an asn1Spec, while DER is affected only in schema-driven decoding (with asn1Spec) and only for definite-length constructed BIT STRINGs, which are not valid DER.

Workaround

This vulnerability can be avoided by enforcing an application-appropriate size limit on untrusted ASN.1 input before passing it to the decoder, and, where the protocol forbids constructed BIT STRING, rejecting that encoding before decoding.

CVSS Base Scores

version 4.0
version 3.1