Crypt::OpenSSL::X509 CVE-2026-58102
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconCraft X.509 cert with oversized extension OID
-
DeliveryDeliver cert to Perl app parsing it
-
ExploitApp calls extensions()/has_extension_oid() building hv_exts
-
InstallOBJ_obj2txt length used as hash-key size
-
C2Read past 129-byte buffer allocation
-
ExecuteAdjacent heap bytes returned as hash key
-
ImpactMemory disclosed or parser crash
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK
1 technique across 1 tactic: Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the target Perl application parse an attacker-supplied X.509 certificate AND invoke one of the OID/long-name extension-enumeration functions on it - specifically extensions(), extensions_by_long_name(), extensions_by_oid(), or has_extension_oid() - since these drive the vulnerable hv_exts() long-OID path. The malicious certificate must contain at least one extension whose textual OID exceeds the fixed 129-byte buffer. What LIMITS exploitation: applications that never call these functions on untrusted certificates are not exposed, and those that use extensions_by_name() (static short-name path) are explicitly unaffected; the impact is bounded to disclosing adjacent heap memory or triggering a crash rather than code execution (SSVC Technical Impact: partial). No authentication is required (PR:N) because certificates are typically accepted from unauthenticated peers, but the module version must be earlier than 2.1.3. |
| Impact | The raw CVSS 3.1 score is 9.1 (AV:N/AC:L/PR:N/UI:N/C:H/I:N/A:H), which looks critical, but the multi-source signals temper that: CISA SSVC rates Exploitation as 'none', Automatable 'yes', and Technical Impact only 'partial' - consistent with an information-disclosure/crash bug rather than code execution. There is no KEV listing and no EPSS score supplied, and no public exploit is identified at time of analysis, so this is not evidence of active exploitation. The AV:N/PR:N/UI:N metrics are technically defensible because a certificate can arrive over the network with no authentication, but they understate a real precondition: the victim application must actually call one of the vulnerable extension-enumeration functions on the attacker-controlled certificate. The impact is also narrower than C:H suggests - the leak is bounded adjacent-heap memory surfaced as a hash key, and A:H reflects a possible crash if the over-read hits unmapped memory rather than reliable denial of service. Net: a genuine, easy-to-trigger memory-safety defect worth patching promptly wherever untrusted certificates are parsed, but 'Automatable: yes / Exploitation: none / Technical Impact: partial' argues this is a moderate real-world priority, not an emergency, absent evidence of exploitation. |
| Exploit ScenarioDerived | An attacker crafts an X.509 certificate containing an extension whose OID renders to a textual form longer than 129 bytes and presents it to a Perl service (for example a TLS client-cert validator, S/MIME processor, or certificate-inspection tool) that enumerates extensions via extensions() or has_extension_oid(). When the module builds the extension hash, OBJ_obj2txt()'s length is used as the hash-key length, reading past the buffer and returning adjacent heap bytes as the key - which the application may log, store, or return, disclosing process memory or crashing the parser. No public exploit is identified at time of analysis, and the low attack complexity (AC:L) means only a single malicious certificate is needed. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 14, 2026
Heap out-of-bounds read in the Crypt::OpenSSL::X509 Perl module (versions before 2.1.3) lets a crafted X.509 certificate leak adjacent heap memory to an application that enumerates certificate extensions. When code calls extensions(), extensions_by_long_name(), extensions_by_oid(), or has_extension_oid(), a certificate extension whose textual OID exceeds the fixed 129-byte buffer causes the returned hash key to include bytes read past the allocation, exposing process memory and risking a crash. No public exploit is identified at time of analysis and it is not in CISA KEV, but the fix is confirmed in release 2.1.3 and the flaw is trivially triggerable by any attacker who can supply a certificate.
RemediationAI
Vendor-released patch: upgrade to Crypt::OpenSSL::X509 version 2.1.3 or later, which sizes the key buffer to the length reported by OBJ_obj2txt() and stores strlen() of the written key instead of the return value (fix commit https://github.com/dsully/perl-crypt-openssl-x509/commit/757289bfce095455c104d4adfe9312e7b339620f.patch; release notes at https://metacpan.org/release/JONASBN/Crypt-OpenSSL-X509-2.1.3/source/Changes.md). Update via your CPAN client (e.g. cpanm Crypt::OpenSSL::X509@2.1.3) or your OS/distro package once it ships 2.1.3. If you cannot upgrade immediately, the concrete compensating control is to avoid the affected code paths on untrusted input: do not call extensions(), extensions_by_long_name(), extensions_by_oid(), or has_extension_oid() on attacker-supplied certificates, and where you only need name-based lookups use extensions_by_name(), which uses the static short-name path and is not affected (trade-off: you lose access to arbitrary/long-OID extensions). Alternatively, pre-validate or reject certificates before parsing (e.g. via a hardened OpenSSL preprocessing step), accepting the added processing overhead. See the oss-security advisory at https://seclists.org/oss-sec/2026/q3/129 for details.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Crypt::OpenSSL::X509 is a widely-used CPAN binding (XS/C glue over OpenSSL) that lets Perl programs parse and inspect X.509 certificates. The bug lives in the hv_exts() routine in X509.xs, which builds a Perl hash of certificate extensions. It calls OpenSSL's OBJ_obj2txt() to render each extension's object identifier (OID) into a fixed 129-byte stack/heap buffer, but OBJ_obj2txt() returns the FULL textual length the OID would require, not the number of bytes actually written to the buffer. That return value is then passed to hv_store() as the key length, so for an OID whose text is longer than the buffer, hv_store() reads bytes beyond the allocation. This is a classic CWE-125 Out-of-bounds Read: a length/size confusion between 'bytes written' and 'bytes needed'. The affected code path is limited to functions that use the numeric/long OID path; extensions_by_name(), which uses the static OpenSSL short-name path, is explicitly not affected. Per the CPE cpe:2.3:a:jonasbn:crypt::openssl::x509, all versions prior to 2.1.3 are impacted.
Know when Crypt gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
A single crafted certificate parsed by the app triggers it (AV:N/AC:L/PR:N/UI:N); heap disclosure justifies C:H, while an over-read only sometimes crashes, so A:L not A:H and no integrity impact.
Primary rating from Vendor (CPANSec).
CVSS VectorVendor: CPANSec
Lifecycle Timeline
3DescriptionCVE.org
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.
Articles & Coverage 1
Executive ViewAI
A critical vulnerability in the Crypt::OpenSSL::X509 Perl module (versions before 2.1.3) enables heap memory disclosure when applications process crafted X.509 certificates, risking exposure of sensitive data and service interruptions. While no public exploit code has been identified at time of analysis, the flaw is trivially triggerable, making any organization using this module immediately vulnerable if exposed to untrusted certificates. Vendor-released patch version 2.1.3 is available and must be deployed urgently across all affected systems.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
Predictable salt generation in Crypt::Password through version 0.28 for Perl weakens the security of stored password has
Perl Crypt::NaCl::Sodium module through 2.002 has potential integer overflows in cryptographic operations that could wea
Crypt::Sodium::XS for Perl bundles a vulnerable version of libsodium (<= 1.0.20) that has a signature verification flaw.
Heap out-of-bounds read in the Perl module Crypt::OpenSSL::PKCS12 before version 1.96 lets a crafted PKCS#12 file leak a
Integer overflow in Crypt::NaCl::Sodium Perl module through version 2.001 on 32-bit systems. The Sodium.xs binding casts
Private-key recovery in the Crypt::DSA Perl module (all versions before 1.22) stems from a biased random number generato
NULL pointer dereference in Crypt::OpenSSL::PKCS12 before version 1.98 for Perl enables process crashes when any caller
Timing side-channel in the Crypt::Password Perl module (versions through 0.28) allows attackers to incrementally guess a
Denial of service in the Crypt::OpenSSL::X509 Perl module before 2.1.3 lets a malformed X.509 certificate crash any Perl
Heap buffer overflow in Crypt::SysRandom::XS before version 0.010 allows denial of service through negative length param
Heap buffer overflow in Perl's Crypt::URandom module (versions 0.41-0.54) allows denial of service through integer wrapa
Crypt::Sodium::XS versions through 0.001000 for Perl has potential integer overflows. Combined aead encryption, combined
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB