# CVE-2023-33201: Bouncy Castle For Java LDAP injection vulnerability

> An LDAP injection in Bouncy Castle allows bypassing X.509 certificate validation when using LDAP CertStore, requiring specific configuration.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Jul 2023
- **Updated:** 4 Dec 2024
- **Also known as:** DEBIAN-CVE-2023-33201, DLA-3514-1, GHSA-hr8g-6v94-x4m9, MINI-crmc-xrmq-7qhr, MINI-j62v-hqfg-wm8p, MINI-xqpf-6w6p-qc99, OESA-2023-1391, OESA-2023-1504, SUSE-SU-2023:2843-1, UBUNTU-CVE-2023-33201, openSUSE-SU-2024:13016-1

## What is CVE-2023-33201?

CVE-2023-33201 is a medium-severity vulnerability in Bouncycastle Bc-Java, published on 5 Jul 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Bouncy Castle For Java before 1.74 is affected by an LDAP injection vulnerability. The vulnerability only affects applications that use an LDAP CertStore from Bouncy Castle to validate X.509 certificates. During the certificate validation process, Bouncy Castle inserts the certificate's Subject Name into an LDAP search filter without any escaping, which leads to an LDAP injection vulnerability.

Weakness: CWE-295 (Improper Certificate Validation)

## Which versions are affected by CVE-2023-33201?

24 open source packages ship an affected version, including org.bouncycastle:bcprov-debug-jdk14, org.bouncycastle:bcprov-debug-jdk15on and org.bouncycastle:bcprov-debug-jdk15to18. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.bouncycastle:bcprov-debug-jdk14` | Maven | From 1.49 | 1.74 |
| `org.bouncycastle:bcprov-debug-jdk14` | Maven | From 1.49 | 1.74 |
| `org.bouncycastle:bcprov-debug-jdk15on` | Maven | From 1.49 to 1.70 | None |
| `org.bouncycastle:bcprov-debug-jdk15on` | Maven | From 1.49 to 1.70 | None |
| `org.bouncycastle:bcprov-debug-jdk15to18` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-debug-jdk15to18` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-debug-jdk18on` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-debug-jdk18on` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-ext-jdk14` | Maven | From 1.49 | 1.74 |
| `org.bouncycastle:bcprov-ext-jdk14` | Maven | From 1.49 | 1.74 |
| `org.bouncycastle:bcprov-ext-jdk15on` | Maven | From 1.49 to 1.70 | None |
| `org.bouncycastle:bcprov-ext-jdk15on` | Maven | From 1.49 to 1.70 | None |
| `org.bouncycastle:bcprov-ext-jdk15to18` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-ext-jdk15to18` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-ext-jdk18on` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-ext-jdk18on` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-jdk14` | Maven | From 1.49 | 1.74 |
| `org.bouncycastle:bcprov-jdk14` | Maven | From 1.49 | 1.74 |
| `org.bouncycastle:bcprov-jdk15on` | Maven | From 1.49 to 1.70 | None |
| `org.bouncycastle:bcprov-jdk15on` | Maven | From 1.49 to 1.70 | None |
| `org.bouncycastle:bcprov-jdk15to18` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-jdk15to18` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-jdk18on` | Maven | All versions | 1.74 |
| `org.bouncycastle:bcprov-jdk18on` | Maven | All versions | 1.74 |
| `bouncycastle` | SUSE:Enterprise Storage 7 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Enterprise Storage 7.1 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise Module for Development Tools 15 SP5 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise Real Time 15 SP3 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | openSUSE:Leap 15.4 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | openSUSE:Leap 15.5 | All versions | 1.74-150200.3.21.1 |
| `bouncycastle` | openSUSE:Tumbleweed | All versions | 1.74-1.1 |

Products: Bouncycastle Bc-Java.

## How do I fix CVE-2023-33201?

Upgrade org.bouncycastle:bcprov-debug-jdk14 to 1.74 or later.

## Is CVE-2023-33201 being exploited?

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

## Other vulnerabilities in Bouncycastle Bc-Java

- [CVE-2007-6721](https://insights.sbomify.com/CVE-2007-6721/): Legion of the Bouncy Castle Java Cryptography API Bleichenbacher Oracle Vulnerability (critical 10.0)
- [CVE-2018-1000613](https://insights.sbomify.com/CVE-2018-1000613/): Deserialization of Untrusted Data in Bouncy castle (critical 9.8)
- [CVE-2026-58062](https://insights.sbomify.com/CVE-2026-58062/): Stapled OCSP response accepted without binding to the checked certificate (critical 9.3)
- [CVE-2026-59638](https://insights.sbomify.com/CVE-2026-59638/): JSSE hostname verifier CN-fallback enabled by default despite documented opt-in (critical 9.3)
- [CVE-2026-59650](https://insights.sbomify.com/CVE-2026-59650/): MTI/A0 DH agreement exponentiates unvalidated peer value (critical 9.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-33201 and fix it if it is affected.

What it is: CVE-2023-33201 is a medium-severity vulnerability in Bouncycastle Bc-Java, published on 5 Jul 2023. 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-2023-33201 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.bouncycastle:bcprov-debug-jdk14 (Maven): affected from 1.49; fixed in 1.74
- org.bouncycastle:bcprov-debug-jdk14 (Maven): affected from 1.49; fixed in 1.74
- org.bouncycastle:bcprov-debug-jdk15on (Maven): affected from 1.49 up to 1.70; no fix listed
- org.bouncycastle:bcprov-debug-jdk15on (Maven): affected from 1.49 up to 1.70; no fix listed
- org.bouncycastle:bcprov-debug-jdk15to18 (Maven): affected all versions; fixed in 1.74
- org.bouncycastle:bcprov-debug-jdk15to18 (Maven): affected all versions; fixed in 1.74
- org.bouncycastle:bcprov-debug-jdk18on (Maven): affected all versions; fixed in 1.74
- org.bouncycastle:bcprov-debug-jdk18on (Maven): affected all versions; fixed in 1.74
- org.bouncycastle:bcprov-ext-jdk14 (Maven): affected from 1.49; fixed in 1.74
- org.bouncycastle:bcprov-ext-jdk14 (Maven): affected from 1.49; fixed in 1.74
- org.bouncycastle:bcprov-ext-jdk15on (Maven): affected from 1.49 up to 1.70; no fix listed
- org.bouncycastle:bcprov-ext-jdk15on (Maven): affected from 1.49 up to 1.70; no fix listed

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-2023-33201/ (Markdown: https://insights.sbomify.com/CVE-2023-33201/index.md)
```

## Sources

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

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