CVE-2026-58102: Crypt::OpenSSL::X509 versions before 2.1.3 for Perl allow a heap out-of-bounds read via a long certificate extension OID in hv_exts
Timothy Legge 13 Jul 2026 22:25 UTC
========================================================================
CVE-2026-58102 CPAN Security Group
========================================================================
CVE ID: CVE-2026-58102
Distribution: Crypt-OpenSSL-X509
Versions: before 2.1.3
MetaCPAN: https://metacpan.org/dist/Crypt-OpenSSL-X509
VCS Repo: https://github.com/dsully/perl-crypt-openssl-x509
Crypt::OpenSSL::X509 versions before 2.1.3 for Perl allow a heap
out-of-bounds read via a long certificate extension OID in hv_exts
Description
-----------
Crypt::OpenSSL::X509 versions before 2.1.3 for Perl allow a heap
out-of-bounds read via a long certificate extension OID in hv_exts.
When building the extension hash (via extensions(),
extensions_by_long_name(), extensions_by_oid(), or
has_extension_oid()), the code passes OBJ_obj2txt()'s return value as
the hash-key length; because that value is the OID's full text length
rather than the bytes written to the fixed-size buffer (129 bytes), an
OID whose text is longer than the 129-byte buffer causes a read past
the allocation, exposing adjacent heap memory as the returned hash key.
extensions_by_name() uses the static shortname path and is not
affected.
Problem types
-------------
- CWE-125 Out-of-bounds Read
Workarounds
-----------
Callers that must enumerate extensions of untrusted certificates can
restrict enumeration to extensions_by_name(), which uses the static
shortname path and does not trigger the over-read.
Solutions
---------
Upgrade to Crypt::OpenSSL::X509 2.1.3 or later.
References
----------
https://github.com/dsully/perl-crypt-openssl-x509/commit/757289bfce095455c104d4adfe9312e7b339620f.patch
https://metacpan.org/release/JONASBN/Crypt-OpenSSL-X509-2.1.3/source/Changes.md