Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-58101

CVE-2026-58101: Crypt::OpenSSL::X509 DoS Vulnerability

CVE-2026-58101 is a denial of service vulnerability in Crypt::OpenSSL::X509 for Perl caused by NULL pointer dereference. Attackers can crash Perl processes via malformed certificates. This article covers technical details, affected versions, impact, and mitigation strategies.

Published:

CVE-2026-58101 Overview

CVE-2026-58101 is a NULL pointer dereference vulnerability [CWE-476] in Crypt::OpenSSL::X509, a Perl binding to OpenSSL's X.509 certificate handling routines. Versions prior to 2.1.3 fail to validate return values from X509V3_EXT_d2i(ext), which returns NULL when an extension's DER value cannot be parsed. The helpers basicC, ia5string, and auth_att dereference this NULL result directly. The keyid_data helper also dereferences akid->keyid, which is NULL for an empty Authority Key Identifier SEQUENCE (DER 30 00). Processing a malformed extension from an untrusted certificate triggers a SIGSEGV, crashing the Perl process.

Critical Impact

Remote attackers can crash any Perl process that parses X.509 extensions from attacker-supplied certificates, producing a reliable denial of service against TLS validators, CA tooling, mail servers, and web applications built on Crypt::OpenSSL::X509.

Affected Products

  • Crypt::OpenSSL::X509 for Perl, all versions prior to 2.1.3
  • Perl applications invoking basicC, ia5string, auth_att, or keyid_data helpers on untrusted certificates
  • Downstream distributions bundling the vulnerable CPAN module

Discovery Timeline

  • 2026-07-13 - CVE-2026-58101 published to NVD
  • 2026-07-14 - Last updated in NVD database

Technical Details for CVE-2026-58101

Vulnerability Analysis

The vulnerability resides in the XS glue code (X509.xs) that exposes OpenSSL extension parsers to Perl. X509V3_EXT_d2i() returns a decoded structure pointer or NULL when the underlying DER bytes fail to parse. The affected helpers dereference the returned pointer without a guard, converting a parse failure into a segmentation fault.

A related defect exists in the Authority Key Identifier handler. When a certificate contains an empty AKI SEQUENCE encoded as 30 00, X509V3_EXT_d2i() succeeds and returns a valid AUTHORITY_KEYID structure, but its keyid member is NULL. The keyid_data helper reads from akid->keyid unconditionally, again producing a crash.

Any long-running Perl process that consumes untrusted certificates, including mail transfer agents, PKI inspection tools, and TLS-inspecting proxies, terminates on the first malformed extension it encounters.

Root Cause

The root cause is missing NULL validation on values returned by OpenSSL parsing routines. The affected helpers assume X509V3_EXT_d2i() always yields a valid structure and that optional ASN.1 members are populated. Neither assumption holds for adversarial input.

Attack Vector

An attacker crafts an X.509 certificate containing a malformed basicConstraints, subjectAltName, authorityInfoAccess, or empty authorityKeyIdentifier extension. When a victim Perl process invokes any affected helper on the certificate, the process crashes with SIGSEGV. Delivery vectors include TLS handshakes, S/MIME messages, or any workflow that submits certificates to a Perl-based inspector.

text
   /* retrieve the value of CA or pathlen in basicConstraints */
   bs = X509V3_EXT_d2i(ext);
 
+  /* X509V3_EXT_d2i() returns NULL when the extension's DER fails to parse.
+     basicC() feeds a security decision (callers test CA / pathLenConstraint),
+     so a malformed extension must be rejected rather than silently treated
+     as ca=0 / pathlen=0. Croak instead of dereferencing NULL. */
+  if (bs == NULL) croak("Error parsing basicConstraints extension\n");
+
   if (strcmp(value, "ca") == 0) {
     ret = bs->ca ? 1 : 0;

Source: GitHub Patch Commit 4c1e2370

The patch inserts an explicit NULL check and calls croak() to raise a Perl-level exception, converting an unrecoverable segfault into a catchable error.

Detection Methods for CVE-2026-58101

Indicators of Compromise

  • Repeated SIGSEGV terminations of Perl worker processes coinciding with inbound certificate processing
  • Core dumps whose faulting stack frame includes basicC, ia5string, auth_att, or keyid_data from X509.xs
  • Server logs recording abrupt disconnects during TLS client authentication or S/MIME parsing

Detection Strategies

  • Inventory installed CPAN modules and flag any Crypt::OpenSSL::X509 version earlier than 2.1.3
  • Enable core dump collection on Perl services that handle certificates and alert on crashes referencing OpenSSL extension helpers
  • Inspect network captures for X.509 extensions containing the empty AKI encoding 30 03 80 00 or truncated basicConstraints OIDs

Monitoring Recommendations

  • Track process restart frequency for Perl-based TLS terminators, MTAs, and CA management tools
  • Forward crash telemetry and syslog segfault entries to a centralized platform for correlation with certificate ingestion events
  • Monitor CPAN mirror update logs to confirm patched versions propagate to build pipelines

How to Mitigate CVE-2026-58101

Immediate Actions Required

  • Upgrade Crypt::OpenSSL::X509 to version 2.1.3 or later on every host running affected Perl applications
  • Restart all Perl daemons and preforked workers so they load the patched shared library
  • Audit application code for direct calls to basicC, ia5string, auth_att, and keyid_data and wrap them in eval blocks

Patch Information

The fix is contained in commit 4c1e2370 and shipped in release 2.1.3 on CPAN. See the MetaCPAN Release Changes for the full changelog. The patch adds NULL checks after each X509V3_EXT_d2i() call and validates akid->keyid before dereference, raising a Perl exception via croak() on failure.

Workarounds

  • Pre-validate untrusted certificates with a hardened parser such as openssl x509 -noout -text before passing them to the vulnerable helpers
  • Wrap helper invocations in eval { ... }; however, this does not catch SIGSEGV and only helps once the module is patched to croak
  • Restrict certificate ingestion paths to authenticated peers until the module can be upgraded
bash
# Upgrade Crypt::OpenSSL::X509 to the patched release
cpanm Crypt::OpenSSL::X509@2.1.3

# Verify the installed version
perl -MCrypt::OpenSSL::X509 -e 'print $Crypt::OpenSSL::X509::VERSION, "\n"'

# Confirm no processes still hold the vulnerable shared object
lsof 2>/dev/null | grep -i 'Crypt/OpenSSL/X509'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.