Apache Karaf through 4.4.12 lets viewers install code via ACL gap
feature:requirement-add and feature:requirement-remove were missing from the feature-scope shell ACL that limits other feature commands to admin.
ACL bypass in Apache Karaf feature requirement commands
Apache Karaf’s feature command ACL limits feature install, uninstall, start, and stop to the admin role, but omitted feature:requirement-add and feature:requirement-remove. A user authenticated only as viewer (with SSH) can invoke those commands. The provisioning resolver then downloads, installs, and starts an attacker-chosen bundle or feature with the full authority of the Karaf process, bypassing admin-only checks on feature:install and bundle:install.
What to do: Upgrade to Apache Karaf 4.4.12 or 4.5.0 or later. Until then, add “requirement-add = admin” and “requirement-remove = admin” to etc/org.apache.karaf.command.acl.feature.cfg; the change applies at runtime.
| Product | Affected | Fixed in |
|---|---|---|
| Apache Karaf | — | 4.4.12 or 4.5.0 (or later) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
The shell command ACL for the feature scope (etc/org.apache.karaf.command.acl.feature.cfg) restricts feature:install, feature:uninstall, feature:start and feature:stop to the admin role, but had no entry for feature:requirement-add or feature:requirement-remove. The provisioning resolver turns a requirement into the same install/start (or uninstall) action as feature:install / feature:uninstall: a bundle: requirement causes an arbitrary bundle to be downloaded and started, and a feature: requirement installs that feature. Because the two commands had no ACL, a user authenticated with only the viewer (and ssh) role could invoke them and cause Apache Karaf to download, install and start an attacker-chosen bundle, which then runs with the full authority of the Karaf process — thereby bypassing the admin-only authorization enforced on feature:install and bundle:install. This is the same class of issue as the feature:repo-add -i / feature:repo-remove -u bypass, on sibling commands not covered by that earlier fix.Mitigation:Upgrade to Apache Karaf 4.4.12 or 4.5.0 (or later), which restrict feature:requirement-add and feature:requirement-remove to the admin role. As an interim workaround on affected versions, add the following two lines to etc/org.apache.karaf.command.acl.feature.cfg; the change is picked up at runtime without a restart: requirement-add = admin requirement-remove = admin
feature:requirement-add and feature:requirement-remove were missing from the feature-scope shell ACL that limits other feature commands to admin.
Today 2.6K readers · 5.3K views · 342 reads · all time 290K views