CVE-2023-33201: Medium severity bouncycastle bc-java vulnerability

Published Jun 16, 2023
·
Updated

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.

Other sources

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.

Issue affecting: BC 1.73 and earlier.

Fixed versions: BC 1.74

Platform affected: Java 4 and later.

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.

https://github.com/bcgit/bc-java/wiki/CVE-2023-33201

Red Hat

The Bouncy Castle Crypto Package For Java (bc-java) could allow a remote attacker to obtain sensitive information, caused by not validating the X.500 name of any certificate in the implementation of the X509LDAPCertStoreSpi.java class. By using blind LDAP injection attack techniques, an attacker could exploit this vulnerability to obtain sensitive information, and use this information to launch further attacks against the affected system.

IBM

Affected Software

20 affected componentsFixes available
maven/org.bouncycastle:bcprov-debug-jdk15on>=1.49<=1.70
maven/org.bouncycastle:bcprov-ext-jdk15on>=1.49<=1.70
maven/org.bouncycastle:bcprov-jdk15on>=1.49<=1.70
maven/org.bouncycastle:bcprov-debug-jdk14>=1.49<1.74
1.74
maven/org.bouncycastle:bcprov-ext-jdk14>=1.49<1.74
1.74
maven/org.bouncycastle:bcprov-jdk14>=1.49<1.74
1.74
maven/org.bouncycastle:bcprov-debug-jdk18on<1.74
1.74
maven/org.bouncycastle:bcprov-debug-jdk15to18<1.74
1.74
maven/org.bouncycastle:bcprov-ext-jdk18on<1.74
1.74
maven/org.bouncycastle:bcprov-ext-jdk15to18<1.74
1.74
maven/org.bouncycastle:bcprov-jdk15to18<1.74
1.74
maven/org.bouncycastle:bcprov-jdk18on<1.74
1.74
redhat/BouncyCastle<1.74
1.74
bouncycastle bc-java<1.74
IBM Data Virtualization on Cloud Pak for Data<=3.0
IBM Watson Query on Cloud Pak for Data<=2.2
IBM Watson Query on Cloud Pak for Data<=2.1
IBM Watson Query on Cloud Pak for Data<=2.0
IBM Data Virtualization on Cloud Pak for Data<=1.8
IBM Data Virtualization on Cloud Pak for Data<=1.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-debug-jdk14 to a version that resolves this vulnerability.

    Fixed in 1.74
  2. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-ext-jdk14 to a version that resolves this vulnerability.

    Fixed in 1.74
  3. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-jdk14 to a version that resolves this vulnerability.

    Fixed in 1.74
  4. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-debug-jdk18on to a version that resolves this vulnerability.

    Fixed in 1.74
  5. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-debug-jdk15to18 to a version that resolves this vulnerability.

    Fixed in 1.74
  6. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-ext-jdk18on to a version that resolves this vulnerability.

    Fixed in 1.74
  7. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-ext-jdk15to18 to a version that resolves this vulnerability.

    Fixed in 1.74
  8. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-jdk15to18 to a version that resolves this vulnerability.

    Fixed in 1.74
  9. Upgrade

    Upgrade maven/org.bouncycastle:bcprov-jdk18on to a version that resolves this vulnerability.

    Fixed in 1.74
  10. Upgrade

    Upgrade redhat/BouncyCastle to a version that resolves this vulnerability.

    Fixed in 1.74
  11. Upgrade

    Upgrade bc-java to a version that resolves this vulnerability.

    Fixed in 1.74
  12. Configuration

    Ensure the fix that adds additional checking/escaping of any X.500 name used by X509LDAPCertStoreSpi.java is present so that certificate Subject/Issuer X.500 names inserted into LDAP search filters are properly escaped (pre-1.74 they were inserted without escaping).

    Bouncy Castle X509LDAPCertStoreSpi.java (CertPath/LDAP CertStore usage) X.500 name escaping in LDAP search filter = escape X.500 wild card characters

Event History

Jun 16, 2023
Data Sourced
via Red Hat·06:09 AM
DescriptionSeverityAffected Software
Jul 5, 2023
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·03:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
03:30 AM
Aug 15, 2025
Data Sourced
via IBM·03:29 PM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-33201?

CVE-2023-33201 is an LDAP injection vulnerability in Bouncy Castle for Java before version 1.74.

2

How does the LDAP injection vulnerability in Bouncy Castle affect me?

The LDAP injection vulnerability in Bouncy Castle allows an attacker to inject malicious LDAP statements, potentially leading to unauthorized access or data leakage.

3

What is the severity of CVE-2023-33201?

CVE-2023-33201 has a severity rating of 7.1 (high).

4

How do I fix the LDAP injection vulnerability in Bouncy Castle?

To fix the LDAP injection vulnerability, update Bouncy Castle for Java to version 1.74 or later.

5

Where can I find more information about CVE-2023-33201?

You can find more information about CVE-2023-33201 on the Bouncy Castle website and the official GitHub page for BC-Java.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203