GHSA-vrh7-x64v-7vxq CVE-2023-0401 RUSTSEC-2023-0013
openssl-src contains `NULL` dereference during PKCS7 data verification
- Severity
- 7.5 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 1.85%
- Chance of exploitation in the next 30 days. Higher than 79.07% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-476 NULL Pointer Dereference
- Fix
300.0.12- Upgrade openssl-src to this version or later
Description
A NULL pointer can be dereferenced when signatures are being verified on PKCS7 signed or signedAndEnveloped data. In case the hash algorithm used for the signature is known to the OpenSSL library but the implementation of the hash algorithm is not available the digest initialization will fail. There is a missing check for the return value from the initialization function which later leads to invalid usage of the digest API most likely leading to a crash. The unavailability of an algorithm can be caused by using FIPS enabled configuration of providers or more commonly by not loading the legacy provider.
PKCS7 data is processed by the SMIME library calls and also by the time stamp (TS) library calls. The TLS implementation in OpenSSL does not call these functions however third party applications would be affected if they call these functions to verify signatures on untrusted data.
Affected versions
crates.io
| Package | Vulnerable | Fixed in |
|---|---|---|
| openssl-src | >= 300.0.0, < 300.0.12 |
300.0.12 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
openssl-src crates.io → 300.0.12
- cargo
cargo update -p openssl-src --precise 300.0.12
Severity breakdown
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Weakness
CWE-476: NULL Pointer Dereference
The product dereferences a pointer that it expects to be valid but is NULL.
How to prevent it
- Implementation: For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
- Requirements: Select a programming language that is not susceptible to these issues.
- Implementation: Check the results of all functions that return a value and verify that the value is non-null before acting upon it.
- Architecture and Design: Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values.
- Implementation: Explicitly initialize all variables and other data stores, either during declaration or just before the first usage.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-w67w-mw4j-8qrv openssl-src contains Read Buffer Overflow in X.509 Name Constraint | Medium | Also affects openssl-src |
| GHSA-vxrh-cpg7-8vjr openssl-src subject to NULL dereference validating DSA public key | High | Also affects openssl-src |
| GHSA-r7jw-wp68-3xch openssl-src vulnerable to Use-after-free following `BIO_new_NDEF` | High | Also affects openssl-src |
| GHSA-v5w6-wcm8-jm4q openssl-src contains Double free after calling `PEM_read_bio_ex` | High | Also affects openssl-src |
| GHSA-p52g-cm5j-mjv4 openssl-src subject to Timing Oracle in RSA Decryption | Medium | Also affects openssl-src |
| GHSA-29xx-hcv2-c4cp openssl-src subject to Invalid pointer dereference in `d2i_PKCS7` functions | High | Also affects openssl-src |
| GHSA-x4qr-2fvf-3mr5 Vulnerable OpenSSL included in cryptography wheels | High | Also affects openssl-src |
| GHSA-vr8j-hgmm-jh9r Denial of service by double-checked locking in openssl-src | High | Also affects openssl-src |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor