CVE-2021-23841 Null pointer deref in X509_issuer_and_serial_hash()

Medium 5.9 Published Updated

Attackers can cause a denial of service via null pointer dereference in OpenSSL's X509_issuer_and_serial_hash function when processing malicious certificates.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-23841?

CVE-2021-23841 is a medium-severity vulnerability in Apple Ipados, published on 16 Feb 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

The OpenSSL public API function X509_issuer_and_serial_hash() attempts to create a unique hash value based on the issuer and serial number data contained within an X509 certificate. However it fails to correctly handle any errors that may occur while parsing the issuer field (which might occur if the issuer field is maliciously constructed). This may subsequently result in a NULL pointer deref and a crash leading to a potential denial of service attack. The function X509_issuer_and_serial_hash() is never directly called by OpenSSL itself so applications are only vulnerable if they use this function directly and they use it on certificates that may have been obtained from untrusted sources. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x).

Weakness: CWE-476

Which versions are affected by CVE-2021-23841?

3 open source packages ship an affected version, including openssl-src. It affects 23 products.

PackageAffectedFixed in
openssl-src crates.ioAll versions111.14.0
openssl-src crates.ioAll versions111.14.0
openssl-src crates.ioFrom 0.0.0-0111.14.0

Products include Apple Ipados, Apple Iphone Os, Apple Macos, Apple Safari, Debian Debian Linux, Netapp Oncommand Insight and 17 more.

How do I fix CVE-2021-23841?

Upgrade openssl-src to 111.14.0 or later.

Is CVE-2021-23841 being exploited?

There is no known exploitation of CVE-2021-23841 in the wild and no public exploit code.

Public exploit code: 2 proofs of concept on GitHub.

All Apple Ipados vulnerabilities

Sources

Also known as ALPINE-CVE-2021-23841, AZL-40768, AZL-41571, CLEANSTART-2026-ON27982, CLSA-2021-1614885634, DEBIAN-CVE-2021-23841 and 4 more.

Is CVE-2021-23841 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free