CVE-2023-0216
📋 TL;DR
This CVE describes a NULL pointer dereference vulnerability in OpenSSL's PKCS7 parsing functions (d2i_PKCS7, d2i_PKCS7_bio, d2i_PKCS7_fp). When applications process malformed PKCS7 data using these functions, it can cause a crash leading to denial of service. Third-party applications that call these functions on untrusted data are affected, but OpenSSL's TLS implementation does not use these vulnerable functions.
💻 Affected Systems
- OpenSSL
📦 What is this software?
Openssl by Openssl
OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.
Learn more about Openssl →⚠️ Risk & Real-World Impact
Worst Case
Application crash leading to denial of service, potentially disrupting critical services that process PKCS7 data from untrusted sources.
Likely Case
Application crashes when processing specially crafted PKCS7 data, causing service disruption until restart.
If Mitigated
No impact if applications don't use the vulnerable functions or only process trusted PKCS7 data.
🎯 Exploit Status
Exploitation requires sending malformed PKCS7 data to applications that use the vulnerable functions. No authentication needed if application accepts external PKCS7 data.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: OpenSSL 3.0.8
Vendor Advisory: https://www.openssl.org/news/secadv/20230207.txt
Restart Required: Yes
Instructions:
1. Download OpenSSL 3.0.8 or later from openssl.org. 2. Compile and install the new version. 3. Restart all applications using OpenSSL. 4. Recompile any statically linked applications with the patched version.
🔧 Temporary Workarounds
Disable PKCS7 processing
allModify applications to avoid using d2i_PKCS7 functions or validate PKCS7 data before processing
Application-specific modifications required
🧯 If You Can't Patch
- Implement strict input validation for PKCS7 data before passing to vulnerable functions
- Use network controls to limit PKCS7 data processing to trusted sources only
🔍 How to Verify
Check if Vulnerable:
Check OpenSSL version with 'openssl version'. If version is between 3.0.0 and 3.0.7, check if applications use d2i_PKCS7 functions.
Check Version:
openssl version
Verify Fix Applied:
Verify OpenSSL version is 3.0.8 or later with 'openssl version'. Test applications with known malformed PKCS7 data to ensure no crashes.
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults when processing PKCS7 data
- Error logs mentioning d2i_PKCS7 functions
Network Indicators:
- Unusual PKCS7 data patterns sent to applications
- Repeated connection attempts to services processing PKCS7
SIEM Query:
Application logs containing 'segmentation fault' OR 'SIGSEGV' AND process names using OpenSSL
🔗 References
- https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=934a04f0e775309cadbef0aa6b9692e1b12a76c6
- https://security.gentoo.org/glsa/202402-08
- https://www.openssl.org/news/secadv/20230207.txt
- https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=934a04f0e775309cadbef0aa6b9692e1b12a76c6
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2023-0003
- https://security.gentoo.org/glsa/202402-08
- https://www.openssl.org/news/secadv/20230207.txt