CVE-2022-46337
📋 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
- Apache Derby
📦 What is this software?
Derby by Apache
Derby by Apache
Derby by Apache
⚠️ 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.
🎯 Exploit Status
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
allAdd 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")