CVE-2026-59885: pyasn1: Quadratic complexity in OBJECT IDENTIFIER and RELATIVE-OID processing allows denial of service

Published Jul 14, 2026
·
Updated

Impact The BER/CER/DER decoders process OBJECT IDENTIFIER and RELATIVE-OID values in quadratic time relative to the number of arcs. A small crafted payload (tens of kilobytes) containing an OID with many arcs consumes seconds of CPU per decode() call, allowing denial of service in any application that decodes untrusted ASN.1 data (certificates, LDAP, SNMP, Kerberos, etc.). The corresponding encoders have the same quadratic behavior, reachable when an application re-encodes previously decoded attacker-supplied values.

The arc-size limit introduced for CVE-2026-23490 bounds the byte length of an individual arc but not the number of arcs, so it does not mitigate this issue.

Affected components ObjectIdentifierPayloadDecoder and RelativeOIDPayloadDecoder in pyasn1/codec/ber/decoder.py; ObjectIdentifierEncoder and RelativeOIDEncoder in pyasn1/codec/ber/encoder.py. The CER and DER codecs inherit these and are equally affected.

Patches Fixed in pyasn1 0.6.4: arc accumulation in both decoders and encoders now runs in linear time.

Workarounds Limit the size of untrusted ASN.1 input before decoding.

Other sources

pyasn1 is a generic ASN.1 library for Python. Prior to 0.6.4, the BER, CER, and DER decoders process OBJECT IDENTIFIER and RELATIVE-OID values in quadratic time relative to the number of arcs, so a small crafted payload containing an OID with many arcs consumes excessive CPU per decode() call and can deny service to applications that decode untrusted ASN.1 data. The corresponding encoders have the same quadratic behavior when an application re-encodes previously decoded attacker-supplied values. This issue is fixed in version 0.6.4.

MITRE

pyasn1: Quadratic complexity in OBJECT IDENTIFIER and RELATIVE-OID processing allows denial of service

Microsoft

Affected Software

5 affected componentsFixes available
pypi/pyasn1<0.6.4
pyasn1 Pyasn1 Python<0.6.4
pip/pyasn1<=0.6.3
0.6.4
Microsoft azl3 python-pyasn1 0.4.8-2<0.4.8-3
0.4.8-3
debian/pyasn1<=0.4.8-3+deb12u2, <=0.6.1-1+deb13u2
0.6.4-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pyasn1 to a version that resolves this vulnerability.

    Fixed in 0.6.4
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 0.4.8-3
  3. Upgrade

    Upgrade debian/pyasn1 to a version that resolves this vulnerability.

    Fixed in 0.6.4-1
  4. Upgrade

    Upgrade pyasn1 to a version that resolves this vulnerability.

    Fixed in 0.6.4
  5. Configuration

    Before calling the pyasn1 BER/CER/DER decoders that process OBJECT IDENTIFIER and RELATIVE-OID (e.g., in pyasn1/codec/ber/decoder.py), limit the size of untrusted ASN.1 input so large crafted payloads (tens of kilobytes with an OID containing many arcs) are rejected prior to decode().

    Application decoding untrusted ASN.1 (e.g., certificates, LDAP, SNMP, Kerberos) using pyasn1/codec/ber/decoder.py limit_size_of_untrusted_asn1_input_before_decoding = enabled (set an upper bound)
  6. Configuration

    If the application re-encodes previously decoded attacker-supplied OBJECT IDENTIFIER/RELATIVE-OID values using pyasn1/codec/ber/encoder.py, enforce input-size limits before decoding and avoid re-encoding untrusted values unless necessary, because the corresponding encoders can exhibit quadratic behavior as well.

    Application re-encoding previously decoded attacker-supplied OID values using pyasn1/codec/ber/encoder.py avoid_re-encoding_untrusted_oid_values_without_limits = enabled (apply size/arc limits or skip re-encoding)

Event History

Jul 14, 2026
CVE Published
via MITRE·04:40 PM
Data Sourced
via MITRE·04:40 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·06:17 PM
DescriptionSeverityAffected Software
Jul 17, 2026
Data Sourced
via Microsoft·08:02 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:02 AM
DescriptionSeverity
Jul 21, 2026
Advisory Published
via GitHub·07:11 PM
Data Sourced
via GitHub·07:11 PM
DescriptionSeverityWeaknessAffected Software
Sep 2, 2026
Data Sourced
via Ubuntu·05:49 PM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Debian·05:50 PM
DescriptionAffected Software
Data Sourced
via Launchpad·05:50 PM
Description

Frequently Asked Questions

1

What is the severity of CVE-2026-59885?

The severity of CVE-2026-59885 is classified as high with a score of 7.5.

2

What does CVE-2026-59885 affect?

CVE-2026-59885 affects the pyasn1 library for Python, specifically its handling of OBJECT IDENTIFIER and RELATIVE-OID processing.

3

How do I fix CVE-2026-59885?

To fix CVE-2026-59885, upgrade the pyasn1 library to version 0.6.4 or later.

4

What type of vulnerability is CVE-2026-59885?

CVE-2026-59885 is a denial of service vulnerability caused by quadratic complexity in OBJECT IDENTIFIER and RELATIVE-OID processing.

5

What attacks can be performed using CVE-2026-59885?

An attacker can exploit CVE-2026-59885 to create crafted payloads that excessively consume CPU resources, leading to potential denial of service.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203