CVE-2023-33201
Bouncy Castle For Java LDAP injection vulnerability
Description
Bouncy Castle provides the X509LDAPCertStoreSpi.java class which can be used in conjunction with the CertPath API for validating certificate paths. Pre-1.73 the implementation did not check the X.500 name of any certificate, subject, or issuer being passed in for LDAP wild cards, meaning the presence of a wild car may lead to Information Disclosure.
A potential attack would be to generate a self-signed certificate with a subject name that contains special characters, e.g: CN=Subject*)(objectclass=. This will be included into the filter and provides the attacker ability to specify additional attributes in the search query. This can be exploited as a blind LDAP injection: an attacker can enumerate valid attribute values using the boolean blind injection technique. The exploitation depends on the structure of the target LDAP directory, as well as what kind of errors are exposed to the user.
Changes to the X509LDAPCertStoreSpi.java class add the additional checking of any X.500 name used to correctly escape wild card characters.
Affected Maven artifacts (12)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.bouncycastle » bcprov-debug-jdk14 | >= 1.49, < 1.74 | 1.74 |
| org.bouncycastle » bcprov-debug-jdk15on | >= 1.49, <= 1.70 | - |
| org.bouncycastle » bcprov-debug-jdk15to18 | < 1.74 | 1.74 |
| org.bouncycastle » bcprov-debug-jdk18on | < 1.74 | 1.74 |
| org.bouncycastle » bcprov-ext-jdk14 | >= 1.49, < 1.74 | 1.74 |
| org.bouncycastle » bcprov-ext-jdk15on | >= 1.49, <= 1.70 | - |
| org.bouncycastle » bcprov-ext-jdk15to18 | < 1.74 | 1.74 |
| org.bouncycastle » bcprov-ext-jdk18on | < 1.74 | 1.74 |
| org.bouncycastle » bcprov-jdk14 | >= 1.49, < 1.74 | 1.74 |
| org.bouncycastle » bcprov-jdk15on | >= 1.49, <= 1.70 | - |
| org.bouncycastle » bcprov-jdk15to18 | < 1.74 | 1.74 |
| org.bouncycastle » bcprov-jdk18on | < 1.74 | 1.74 |
Blast radius
68% of the dependent artifacts (33,200) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 151,310 |
| 2 hops | 870,978 |
| 3 hops | 1,227,045 |
| 4 hops | 1,093,733 |
| 5 hops | 663,882 |
| 6 hops | 329,246 |
Most used dependents
- org.testcontainers » testcontainers4,109 usages
- org.apache.poi » poi-ooxml3,690 usages
- io.netty » netty-all3,584 usages
- org.apache.hadoop » hadoop-common3,482 usages
- org.apache.spark » spark-sql3,174 usages
- org.apache.kafka » kafka-clients3,135 usages
- redis.clients » jedis2,971 usages
- org.apache.spark » spark-core2,899 usages
- com.diffplug.spotless » spotless-maven-plugin2,873 usages
- org.bouncycastle » bcpkix-jdk15on2,867 usages
- org.wso2.maven » carbon-p2-plugin2,864 usages
- org.eclipse.jgit » org.eclipse.jgit2,222 usages
- com.android.tools.build » gradle2,197 usages
- org.bouncycastle » bcpkix-jdk18on2,109 usages
- org.apache.zookeeper » zookeeper2,044 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2023-33201
- Webhttps://github.com/bcgit/bc-java/commit/ccf93ca736b89250ff4ce079a5aa56f5cbf0ebbd
- Webhttps://github.com/bcgit/bc-java/commit/e8c409a8389c815ea3fda5e8b94c92fdfe583bcc
- Webhttps://bouncycastle.org
- Webhttps://bouncycastle.org/releasenotes.html#r1rv74
- Packagehttps://github.com/bcgit/bc-java
- Webhttps://github.com/bcgit/bc-java/commits/main/prov/src/main/java/org/bouncycastle/jce/provider/X509LDAPCertStoreSpi.java
- Webhttps://github.com/bcgit/bc-java/wiki/CVE-2023-33201
- Webhttps://lists.debian.org/debian-lts-announce/2023/08/msg00000.html
- Webhttps://security.netapp.com/advisory/ntap-20230824-0008
