VDB
Sign up
MEDIUM5.3

GHSA-hr8g-6v94-x4m9

Bouncy Castle For Java LDAP injection vulnerability

Quick fix

GHSA-hr8g-6v94-x4m9 — org.bouncycastle:bcprov-jdk18on: upgrade to the fixed version with the command below.

# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-jdk18on

Details

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

Maven/org.bouncycastle:bcprov-jdk18on
Introduced in: 0Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-jdk18on
Maven/org.bouncycastle:bcprov-jdk15to18
Introduced in: 0Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-jdk15to18
Maven/org.bouncycastle:bcprov-jdk14
Introduced in: 1.49Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-jdk14
Maven/org.bouncycastle:bcprov-ext-jdk14
Introduced in: 1.49Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-ext-jdk14
Maven/org.bouncycastle:bcprov-ext-jdk15to18
Introduced in: 0Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-ext-jdk15to18
Maven/org.bouncycastle:bcprov-ext-jdk18on
Introduced in: 0Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-ext-jdk18on
Maven/org.bouncycastle:bcprov-debug-jdk14
Introduced in: 1.49Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-debug-jdk14
Maven/org.bouncycastle:bcprov-debug-jdk15to18
Introduced in: 0Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-debug-jdk15to18
Maven/org.bouncycastle:bcprov-debug-jdk18on
Introduced in: 0Fixed in: 1.74
Fix# pom.xml: bump <version>1.74</version> for org.bouncycastle:bcprov-debug-jdk18on
Maven/org.bouncycastle:bcprov-jdk15on
Introduced in: 1.49

No fixed version published yet for org.bouncycastle:bcprov-jdk15on (maven). Pin to a known-safe version or switch to an alternative.

Maven/org.bouncycastle:bcprov-ext-jdk15on
Introduced in: 1.49

No fixed version published yet for org.bouncycastle:bcprov-ext-jdk15on (maven). Pin to a known-safe version or switch to an alternative.

Maven/org.bouncycastle:bcprov-debug-jdk15on
Introduced in: 1.49

No fixed version published yet for org.bouncycastle:bcprov-debug-jdk15on (maven). Pin to a known-safe version or switch to an alternative.

References