Vulnerability HighRUSTSEC-2021-0129 · openssl-src
RUSTSEC-2021-0129: Invalid handling of `X509_verify_cert()` internal errors in libssl
Short answerA security vulnerability in the openssl-src crate: Invalid handling of `X509_verify_cert()` internal errors in libssl. GitHub rates it High. Fixed in 300.0.4: update to a fixed version.
| Crate | openssl-src |
|---|---|
| Type | Vulnerability (denial-of-service) |
| Affected versions | From 300.0.0 before 300.0.4. |
| Fixed in | 300.0.4 |
| Severity | High (GitHub rating) |
| Published | 2021-12-14 |
| Last changed | 2024-12-16 |
| Also known as | BIT-node-2021-4044, BIT-node-min-2021-4044, CVE-2021-4044, GHSA-mmjf-f5jw-w72q |
What to do
- See which version you have:
cargo tree -i openssl-src(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p openssl-src. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampleopenssl-src = "300.0.4") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Internally libssl in OpenSSL calls X509_verify_cert() on the client side to verify a certificate supplied by a server. That function may return a negative return value to indicate an internal error (for example out of memory). Such a negative return value is mishandled by OpenSSL and will cause an IO function (such as SSL_connect() or SSL_do_handshake()) to not indicate success and a subsequent call to SSL_get_error() to return the value SSL_ERROR_WANT_RETRY_VERIFY. This return value is only supposed to be returned by OpenSSL if the application has previously called SSL_CTX_set_cert_verify_callback(). Since most applications do not do this the SSL_ERROR_WANT_RETRY_VERIFY return value from SSL_get_error() will be totally unexpected and applications may not behave correctly as a result. The exact behaviour will depend on the application but it could result in crashes, infinite loops or other similar incorrect responses.
This issue is made more serious in combination with a separate bug in OpenSSL 3.0 that will cause X509_verify_cert() to indicate an internal error when processing a certificate chain. This will occur where a certificate does not include the Subject Alternative Name extension but where a Certificate Authority has enforced name constraints. This issue can occur even with valid chains.
References
- Package: crates.io/crates/openssl-src
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0129.html
- Web: www.openssl.org/news/secadv/20211214.txt
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for openssl-src
- Vulnerability HighRUSTSEC-2020-0015 · 2020-04-25Crash causing Denial of Service attack
- Vulnerability MediumRUSTSEC-2021-0055 · 2021-05-01NULL pointer deref in signature_algorithms processing
- Vulnerability HighRUSTSEC-2021-0056 · 2021-05-01CA certificate check bypass with X509_V_FLAG_X509_STRICT
- Vulnerability HighRUSTSEC-2021-0057 · 2021-05-01Integer overflow in CipherUpdate
- Vulnerability MediumRUSTSEC-2021-0058 · 2021-05-01Null pointer deref in `X509_issuer_and_serial_hash()`
- Vulnerability CriticalRUSTSEC-2021-0097 · 2021-08-24SM2 Decryption Buffer Overflow
- Vulnerability HighRUSTSEC-2021-0098 · 2021-08-24Read buffer overruns processing ASN.1 strings
- VulnerabilityRUSTSEC-2022-0014 · 2022-03-15Infinite loop in `BN_mod_sqrt()` reachable when parsing certificates
Up next
Same crateopenssl-src: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?