Skip to content
Access control Advisory Intermediate CVE-2022-38060

OpenStack Kolla sudo privilege escalation vulnerability

A sudoers misconfiguration in OpenStack Kolla containers allows a low-privileged user to run arbitrary commands as root by manipulating environment variables. An attacker with access to a container can exploit this to gain root privileges, and in privileged containers, potentially compromise the host.

Keane O'Kelley Follow

Originally disclosed on Cisco Talos

High 8.8 View original

A privilege escalation vulnerability exists in the sudo functionality of OpenStack Kolla git master 05194e7618. A misconfiguration in /etc/sudoers within a container can lead to increased privileges.

Keane O'Kelley and Brian Scott, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The sudoers configuration includes the 'setenv' option without 'secure_path', allowing users to modify the PATH environment variable and influence which external programs are executed by privileged scripts.

Impact

An attacker with a low-privileged account in a Kolla container could gain root privileges inside the container, and if the container is privileged, this may lead to root access on the host.

What the attacker needed

Access to a Kolla container as a low-privileged user; User must be in the kolla group; Container must have the vulnerable sudoers configuration

The fix

The sudoers configuration should use the secure_path option and remove the setenv option, using env_keep for safe variables instead; additionally, avoid using privileged containers.

How it was found

  1. Check current user privileges inside the container.
  2. Create a malicious script named after a program that the Kolla script calls (e.g., update-ca-certificates) in a writable directory.
  3. Add that directory to the PATH environment variable.
  4. Run the affected Kolla script with sudo -E to execute the malicious script as root.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In some OpenStack Kolla containers, a configuration file called sudoers lets a normal user run certain scripts as the root (administrator) user. Because of a setting that allows environment variables to be changed, the user can trick those scripts into running other programs with root rights. This means someone who already has a low-level account inside the container can become the administrator.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.