Skip to content

Bouncy Castle For Java LDAP injection vulnerability

Moderate severity GitHub Reviewed Published Jul 5, 2023 to the GitHub Advisory Database • Updated Nov 4, 2023

Package

maven org.bouncycastle:bcprov-debug-jdk14 (Maven)

Affected versions

>= 1.49, < 1.74

Patched versions

1.74
maven org.bouncycastle:bcprov-debug-jdk15on (Maven)
>= 1.49, <= 1.70
None
maven org.bouncycastle:bcprov-debug-jdk15to18 (Maven)
< 1.74
1.74
maven org.bouncycastle:bcprov-debug-jdk18on (Maven)
< 1.74
1.74
maven org.bouncycastle:bcprov-ext-jdk14 (Maven)
>= 1.49, < 1.74
1.74
maven org.bouncycastle:bcprov-ext-jdk15on (Maven)
>= 1.49, <= 1.70
None
maven org.bouncycastle:bcprov-ext-jdk15to18 (Maven)
< 1.74
1.74
maven org.bouncycastle:bcprov-ext-jdk18on (Maven)
< 1.74
1.74
maven org.bouncycastle:bcprov-jdk14 (Maven)
>= 1.49, < 1.74
1.74
maven org.bouncycastle:bcprov-jdk15on (Maven)
>= 1.49, <= 1.70
None
maven org.bouncycastle:bcprov-jdk15to18 (Maven)
< 1.74
1.74
maven org.bouncycastle:bcprov-jdk18on (Maven)
< 1.74
1.74

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.

References

Published by the National Vulnerability Database Jul 5, 2023
Published to the GitHub Advisory Database Jul 5, 2023
Reviewed Jul 6, 2023
Last updated Nov 4, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

EPSS score

0.096%
(41st percentile)

Weaknesses

CVE ID

CVE-2023-33201

GHSA ID

GHSA-hr8g-6v94-x4m9

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.