CVE-2022-46337

9.8 CRITICAL

📋 TL;DR

CVE-2022-46337 is an LDAP authentication bypass vulnerability in Apache Derby database systems. Attackers can use specially crafted usernames to bypass LDAP authentication, potentially leading to disk exhaustion, malware execution, and unauthorized data access. Organizations using LDAP-authenticated Derby installations are affected.

💻 Affected Systems

Products:
  • Apache Derby
Versions: All versions before 10.17.1.0
Operating Systems: All operating systems running Derby
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Derby installations using LDAP authentication. Databases protected by SQL GRANT/REVOKE authorization have reduced impact.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise including malware execution with server privileges, disk exhaustion causing denial of service, and unauthorized access to sensitive database data and functions.

🟠

Likely Case

Unauthorized database creation leading to disk space consumption and potential data corruption in databases without SQL authorization controls.

🟢

If Mitigated

Limited impact if proper SQL GRANT/REVOKE authorization is implemented alongside LDAP authentication.

🌐 Internet-Facing: HIGH - Internet-facing Derby servers with LDAP authentication are directly exploitable.
🏢 Internal Only: MEDIUM - Internal systems are still vulnerable but require network access.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW - Simple username manipulation required

Exploitation requires LDAP authentication to be enabled and knowledge of the vulnerability.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Derby 10.17.1.0

Vendor Advisory: https://lists.apache.org/thread/q23kvvtoohgzwybxpwozmvvk17rp0td3

Restart Required: Yes

Instructions:

1. Upgrade to Derby 10.17.1.0 with Java 21. 2. For older Java versions, build from patched release families: 10.16 (Java 17), 10.15 (Java 11), or 10.14 (Java 8). 3. Restart all Derby services.

🔧 Temporary Workarounds

Implement SQL Authorization

all

Add SQL GRANT/REVOKE authorization controls to databases to limit impact even if LDAP bypass occurs

GRANT/REVOKE statements specific to your database schema

🧯 If You Can't Patch

  • Disable LDAP authentication and use alternative authentication methods
  • Implement strict network access controls to limit exposure to Derby servers

🔍 How to Verify

Check if Vulnerable:

Check Derby version and LDAP authentication configuration. Versions below 10.17.1.0 with LDAP enabled are vulnerable.

Check Version:

java -jar derby.jar --version or check derby.properties/configuration files

Verify Fix Applied:

Verify Derby version is 10.17.1.0 or higher, or built from patched release families (10.16, 10.15, 10.14).

📡 Detection & Monitoring

Log Indicators:

  • Unusual database creation events
  • Failed LDAP authentication attempts followed by successful access
  • Disk space alerts

Network Indicators:

  • Unexpected connections to Derby ports (default 1527)
  • Unusual database creation traffic patterns

SIEM Query:

source="derby.log" AND ("database created" OR "authentication bypass" OR "LDAP failure")

🔗 References

📤 Share & Export