CVE-2026-126540: Convert::ASN1 versions before 0.37 for Perl allow CPU exhaustion via quadratic bigint loop in os2ip Timothy Legge 20 Nov 2026 02:10 UTC

========================================================================
CVE-2026-126540                                      CPAN Security Group
========================================================================

         CVE ID:  CVE-2026-126540

   Distribution:  Convert-ASN1
       Versions:  before 0.37
       MetaCPAN:  https://metacpan.org/dist/Convert-ASN1
       VCS Repo:  https://github.com/cpan-authors/perl-Convert-ASN1

Convert::ASN1 versions before 0.37 for Perl allow CPU exhaustion via
quadratic bigint loop in os2ip

Description
-----------
Convert::ASN1 versions before 0.37 for Perl allow CPU exhaustion via
quadratic bigint loop in os2ip.

Every INTEGER or ENUMERATED longer than four content octets reaches
os2ip, which iterates over each content octet with $result = ($result *
256) + $octet. Each multiplication operates on a bigint that grows by
one octet per step, so decoding an n-octet value takes O(n^2) bigint
work. Nothing limits content length before this loop runs.

An attacker who controls the decoded data can exhaust CPU with a single
oversized INTEGER or ENUMERATED value.

Problem types
-------------
- CWE-407 Inefficient Algorithmic Complexity

Solutions
---------
Upgrade to Convert-ASN1 0.37 or later.

References
----------
https://github.com/cpan-authors/perl-Convert-ASN1/commit/49b362c527e0af05fca9be1e97e4a340d95afa75.patch
https://metacpan.org/release/TIMLEGGE/Convert-ASN1-0.37/changes
https://github.com/cpan-authors/perl-Convert-ASN1/issues