Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Privilege Escalation in Nomad via artifact stanza #6176

Closed
langmartin opened this issue Aug 21, 2019 · 1 comment · Fixed by #6203
Closed

Privilege Escalation in Nomad via artifact stanza #6176

langmartin opened this issue Aug 21, 2019 · 1 comment · Fixed by #6203

Comments

@langmartin
Copy link
Contributor

langmartin commented Aug 21, 2019

Nomad’s artifact stanza can be exploited by an untrusted operator to escalate to root privileges by exploiting setuid.

This vulnerability affects all versions of Nomad.

Background

To execute workloads, nomad uses task drivers that provide different resource isolation guarantees. The exec driver provides basic isolation by running tasks in a filesystem sandboxing environment, chroot, and as an unprivileged user, nobody,by default. These controls aim to restrict the task’s destructive access to the host.

In an internal review, we discovered that a malicious operator can use the artifact feature to escalate their privilege in exec driver to run tasks as root, to manipulate host filesystems, and perform destructive host operations. The operator can use an artifacts archive that contains an executable with setuid bit enabled to gain root access.

setuid is a Unix access rights flag that allows users to run executables with the permissions of the executable's owner. sudo, the widespread tool, uses setuid to run commands in temporary and controlled root privileges context. A malicious attacker can create an executable that escalate to root without sudo-like checks.

Nomad 0.9.5 fixes the attack vector by disabling setuid flag from any files downloaded through artifacts.

langmartin added a commit that referenced this issue Aug 21, 2019
@preetapan preetapan changed the title Security reserved Privilege Escalation in Nomad via artifact stanza Aug 22, 2019
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants