CVE-2026-17510 in Crypt::OpenSSL::PKCS12info

Summary

by MITRE • 08/09/2026

Crypt::OpenSSL::PKCS12 versions before 1.98 for Perl allow a NULL pointer dereference in print_attribute via a zero length BMPSTRING attribute.

print_attribute() sizes the destination buffer for a BMPSTRING attribute from its declared byte length with `Renew(*attribute, length, char)`. A zero length attribute makes that a zero size reallocation, which Perl implements as a free returning NULL, so the buffer pointer becomes NULL, the following `strncpy` copies nothing, and the caller dereferences NULL in the `strlen()` it passes to `newSVpvn()`. A zero length BMPSTRING is even length, so the ASN.1 decoder accepts it and the value reaches this code. The UTF8STRING, OCTET STRING and BIT STRING arms size on `length + 1` or `length * 4 + 1` and are unaffected.

Any caller that passes an untrusted PKCS#12 file to info_as_hash() can crash the process. info() prints attribute values directly without sizing a buffer and is unaffected.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 08/09/2026

This vulnerability exists in Crypt::OpenSSL::PKCS12 Perl module versions prior to 1.98 and represents a critical NULL pointer dereference flaw that can lead to remote process crashes. The issue occurs within the print_attribute function when handling BMPSTRING attributes with zero length values, creating a dangerous memory management scenario that violates fundamental security principles. The vulnerability stems from improper buffer sizing logic where a zero-length attribute triggers a null pointer reallocation, fundamentally compromising the module's stability and potentially enabling denial-of-service attacks against applications relying on this cryptographic library.

The technical implementation of this flaw demonstrates a classic memory safety issue where the function attempts to reallocate memory using `Renew(*attribute, length, char)` with a zero length parameter. This causes Perl's memory management system to treat it as a free operation followed by a NULL return, leaving the buffer pointer in an invalid state. Subsequent operations attempt to use this NULL pointer in a `strlen()` call within `newSVpvn()`, resulting in immediate process termination. The vulnerability specifically targets BMPSTRING attributes due to their unique sizing behavior compared to other ASN.1 string types like UTF8STRING, OCTET STRING, and BIT STRING which incorporate additional buffer padding calculations that prevent this particular scenario.

The operational impact of this vulnerability extends beyond simple denial-of-service as it creates a potential vector for more sophisticated attacks within applications processing untrusted PKCS#12 files. Any Perl application utilizing info_as_hash() with user-supplied PKCS#12 data becomes susceptible to crashes, potentially enabling attackers to disrupt services or create conditions for further exploitation. This vulnerability aligns with CWE-476 which describes NULL pointer dereference conditions, and demonstrates how seemingly benign ASN.1 parsing logic can create critical security weaknesses when combined with improper memory management practices that violate standard security protocols.

The attack surface is particularly concerning given the widespread use of PKCS#12 files for certificate management and the prevalence of Perl applications in enterprise environments. The vulnerability specifically affects the info_as_hash() function pathway while remaining unaffected by direct info() calls, indicating a targeted code path that requires careful input validation. This distinction aligns with ATT&CK technique T1203 which coversObtain Capabilities, as attackers could leverage this flaw to disrupt certificate management systems or create conditions for more advanced exploitation techniques. The zero-length BMPSTRING validation bypass occurs at the ASN.1 decoding level, making it difficult to detect through conventional input sanitization measures and highlighting the importance of robust memory safety practices in cryptographic libraries.

Mitigation strategies should focus on immediate version updates to Crypt::OpenSSL::PKCS12 1.98 or later where the buffer sizing logic has been corrected to prevent null pointer dereference conditions. Additionally, applications processing PKCS#12 files should implement strict input validation and consider sandboxing mechanisms when handling untrusted data sources. The fix addresses the root cause by ensuring proper buffer allocation regardless of attribute length values, preventing the dangerous memory reallocation pattern that led to the vulnerability. Organizations should also conduct comprehensive security assessments of their Perl-based certificate management systems to identify potential exposure points and implement monitoring for similar patterns in other cryptographic libraries that might be susceptible to analogous issues.

Responsible

CPANSec

Reservation

07/27/2026

Disclosure

08/09/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Interested in the pricing of exploits?

See the underground prices here!