Lucene search

K
githubGitHub Advisory DatabaseGHSA-HR8G-6V94-X4M9
HistoryJul 05, 2023 - 3:30 a.m.

Bouncy Castle For Java LDAP injection vulnerability

2023-07-0503:30:23
CWE-295
GitHub Advisory Database
github.com
105
bouncy castle
java
ldap
injection
vulnerability
x.500
certificate
validation
wild cards
information disclosure
self-signed
filter
special characters
attribute values
exploitation
blind injection
technique
ldap directory
errors
software

CVSS3

5.3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

LOW

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

EPSS

0.001

Percentile

23.2%

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 configurations

Vulners
Node
org.bouncycastle\bcprovMatchjdk15on
OR
org.bouncycastle\bcprovMatchjdk15on
OR
org.bouncycastle\bcprovMatchjdk15on
OR
org.bouncycastle\bcprovMatchjdk14
OR
org.bouncycastle\bcprovMatchjdk14
OR
org.bouncycastle\bcprovMatchjdk14
OR
org.bouncycastle\bcprovMatchjdk18on
OR
org.bouncycastle\bcprovMatchjdk15to18
OR
org.bouncycastle\bcprovMatchjdk18on
OR
org.bouncycastle\bcprovMatchjdk15to18
OR
org.bouncycastle\bcprovMatchjdk15to18
OR
org.bouncycastle\bcprovMatchjdk18on

CVSS3

5.3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

LOW

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

EPSS

0.001

Percentile

23.2%