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

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

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 16 Feb 2021
- **Updated:** 16 Sep 2024
- **Also known as:** ALPINE-CVE-2021-23841, AZL-40768, AZL-41571, CLEANSTART-2026-ON27982, CLSA-2021-1614885634, DEBIAN-CVE-2021-23841, GHSA-84rm-qf37-fgc2, JLSEC-2026-222, RUSTSEC-2021-0058, UBUNTU-CVE-2021-23841

## 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 (NULL Pointer Dereference)

## Which versions are affected by CVE-2021-23841?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openssl-src` | crates.io | All versions | 111.14.0 |
| `openssl-src` | crates.io | All versions | 111.14.0 |
| `openssl-src` | crates.io | From 0.0.0-0 | 111.14.0 |

Products: Apple Ipados, Apple Iphone Os, Apple Macos, Apple Safari, Debian Debian Linux, Netapp Oncommand Insight, Netapp Oncommand Workflow Automation, Netapp Snapcenter, Openssl Openssl, Oracle Business Intelligence, Oracle Communications Cloud Native Core Policy, Oracle Enterprise Manager for Storage Management, Oracle Enterprise Manager Ops Center, Oracle Essbase, Oracle Graalvm, Oracle Jd Edwards World Security, Oracle Mysql Enterprise Monitor, Oracle Mysql Server, Oracle Peoplesoft Enterprise Peopletools, Oracle Zfs Storage Appliance Kit and 3 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:

- https://github.com/Trinadh465/external_boringssl_openssl_1.1.0g_CVE-2021-23841 (github_poc): https://github.com/Trinadh465/external_boringssl_openssl_1.1.0g_CVE-2021-23841
- https://github.com/Satheesh575555/Openssl_1_1_0_CVE-2021-23841 (github_poc): https://github.com/Satheesh575555/Openssl_1_1_0_CVE-2021-23841

## Other vulnerabilities in Apple Ipados

- [CVE-2025-43300](https://insights.sbomify.com/CVE-2025-43300/): Apple iOS, iPadOS, and macOS Out-of-Bounds Write (critical 10.0, exploited in the wild)
- [CVE-2025-24201](https://insights.sbomify.com/CVE-2025-24201/): Apple Multiple Products WebKit Out-of-Bounds Write (critical 10.0, exploited in the wild)
- [CVE-2025-24085](https://insights.sbomify.com/CVE-2025-24085/): Apple Multiple Products Use-After-Free (critical 10.0, exploited in the wild)
- [CVE-2025-31200](https://insights.sbomify.com/CVE-2025-31200/): Apple Multiple Products Memory Corruption (critical 9.8, exploited in the wild)
- [CVE-2025-31201](https://insights.sbomify.com/CVE-2025-31201/): Apple Multiple Products Arbitrary Read and Write (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-23841 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2021-23841 in the wild and no public exploit code.

Affected packages and fixed versions:
- openssl-src (crates.io): affected all versions; fixed in 111.14.0
- openssl-src (crates.io): affected all versions; fixed in 111.14.0
- openssl-src (crates.io): affected from 0.0.0-0; fixed in 111.14.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-23841/ (Markdown: https://insights.sbomify.com/CVE-2021-23841/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-23841
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-23841
- OSV: https://osv.dev/vulnerability/CVE-2021-23841

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-23841/
Summaries are generated and may contain mistakes; the official description above is the record.
