CVE-2026-17510: CWE-476 NULL Pointer Dereference in JONASBN Crypt::OpenSSL::PKCS12
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.
AI Analysis
Technical Summary
Crypt::OpenSSL::PKCS12 versions prior to 1.98 contain a NULL pointer dereference vulnerability in the print_attribute function. The issue arises because print_attribute allocates a buffer sized to the declared byte length of a BMPSTRING attribute using Renew(*attribute, length, char). When the attribute length is zero, Renew performs a zero size reallocation, which Perl treats as a free operation returning NULL. This results in a NULL buffer pointer. Subsequent strncpy operations copy nothing, but the caller later dereferences the NULL pointer in a strlen() call passed to newSVpvn(), causing a crash. The ASN.1 decoder accepts zero length BMPSTRING attributes, so this input can reach the vulnerable code. Other string types such as UTF8STRING, OCTET STRING, and BIT STRING are unaffected due to different sizing logic. The vulnerability can be triggered by passing an untrusted PKCS#12 file to info_as_hash(), but not via the info() function.
Potential Impact
An attacker who can supply a crafted PKCS#12 file with a zero length BMPSTRING attribute to a vulnerable version of Crypt::OpenSSL::PKCS12 can cause the affected process to crash due to a NULL pointer dereference. This results in a denial of service condition. There is no indication of code execution or data corruption beyond process termination.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid processing untrusted PKCS#12 files with the info_as_hash() function in Crypt::OpenSSL::PKCS12 versions before 1.98. The info() function is not affected and can be used as a safer alternative for attribute printing.
CVE-2026-17510: CWE-476 NULL Pointer Dereference in JONASBN Crypt::OpenSSL::PKCS12
Description
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.
Affected software
pkg:github/Crypt-OpenSSL-PKCS12Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Crypt::OpenSSL::PKCS12 versions prior to 1.98 contain a NULL pointer dereference vulnerability in the print_attribute function. The issue arises because print_attribute allocates a buffer sized to the declared byte length of a BMPSTRING attribute using Renew(*attribute, length, char). When the attribute length is zero, Renew performs a zero size reallocation, which Perl treats as a free operation returning NULL. This results in a NULL buffer pointer. Subsequent strncpy operations copy nothing, but the caller later dereferences the NULL pointer in a strlen() call passed to newSVpvn(), causing a crash. The ASN.1 decoder accepts zero length BMPSTRING attributes, so this input can reach the vulnerable code. Other string types such as UTF8STRING, OCTET STRING, and BIT STRING are unaffected due to different sizing logic. The vulnerability can be triggered by passing an untrusted PKCS#12 file to info_as_hash(), but not via the info() function.
Potential Impact
An attacker who can supply a crafted PKCS#12 file with a zero length BMPSTRING attribute to a vulnerable version of Crypt::OpenSSL::PKCS12 can cause the affected process to crash due to a NULL pointer dereference. This results in a denial of service condition. There is no indication of code execution or data corruption beyond process termination.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid processing untrusted PKCS#12 files with the info_as_hash() function in Crypt::OpenSSL::PKCS12 versions before 1.98. The info() function is not affected and can be used as a safer alternative for attribute printing.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- CPANSec
- Date Reserved
- 2026-07-27T00:17:17.758Z
- Cvss Version
- null
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a77dae5bf8831d539c0e90f
Added to database: 08/09/2026, 01:41:57 UTC
Last enriched: 08/09/2026, 02:00:48 UTC
Last updated: 08/09/2026, 03:41:45 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.