# CVE-2016-3697: Privilege Elevation in runc

> Local attackers can gain privileges by exploiting improper UID handling in the Docker runtime's user lookup logic.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jun 2016
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2016-3697, GHSA-q3j5-32m5-58c2, GO-2021-0070, MGASA-2016-0209, RHSA-2016:1034, RHSA-2016:2634, SUSE-SU-2016:1159-1

## What is CVE-2016-3697?

CVE-2016-3697 is a high-severity vulnerability in Opensuse Opensuse, published on 1 Jun 2016. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

libcontainer/user/user.go in runC before 0.1.0, as used in Docker before 1.11.2, improperly treats a numeric UID as a potential username, which allows local users to gain privileges via a numeric username in the password file in a container.

Weakness: CWE-264

## Which versions are affected by CVE-2016-3697?

3 open source packages ship an affected version, including github.com/opencontainers/runc. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/opencontainers/runc` | Go | All versions | 0.1.0 |
| `github.com/opencontainers/runc` | Go | All versions | 0.1.0 |
| `github.com/opencontainers/runc` | Go | All versions | 0.1.0 |
| `docker` | Red Hat:rhel_extras_other:7 | All versions | 0:1.10.3-57.el7 |
| `docker` | Red Hat:rhel_extras_other:7 | All versions | 0:1.9.1-40.el7 |
| `docker-common` | Red Hat:rhel_extras_other:7 | All versions | 0:1.10.3-57.el7 |
| `docker-common` | Red Hat:rhel_extras_other:7 | All versions | 0:1.9.1-40.el7 |
| `docker-forward-journald` | Red Hat:rhel_extras_other:7 | All versions | 0:1.9.1-40.el7 |
| `docker-logrotate` | Red Hat:rhel_extras_other:7 | All versions | 0:1.10.3-57.el7 |
| `docker-logrotate` | Red Hat:rhel_extras_other:7 | All versions | 0:1.9.1-40.el7 |
| `docker-lvm-plugin` | Red Hat:rhel_extras_other:7 | All versions | 0:1.10.3-57.el7 |
| `docker-novolume-plugin` | Red Hat:rhel_extras_other:7 | All versions | 0:1.10.3-57.el7 |
| `docker-rhel-push-plugin` | Red Hat:rhel_extras_other:7 | All versions | 0:1.10.3-57.el7 |
| `docker-selinux` | Red Hat:rhel_extras_other:7 | All versions | 0:1.10.3-57.el7 |
| `docker-selinux` | Red Hat:rhel_extras_other:7 | All versions | 0:1.9.1-40.el7 |
| `docker-v1.10-migrator` | Red Hat:rhel_extras_other:7 | All versions | 0:1.10.3-57.el7 |
| `docker` | SUSE:Linux Enterprise Module for Containers 12 | All versions | 1.10.3-66.1 |
| `docker` | SUSE:OpenStack Cloud 6 | All versions | 1.10.3-66.1 |

Products: Docker Docker, Linuxfoundation Runc, Opensuse Opensuse.

## How do I fix CVE-2016-3697?

Upgrade github.com/opencontainers/runc to 0.1.0 or later.

## Is CVE-2016-3697 being exploited?

There is no known exploitation of CVE-2016-3697 in the wild and no public exploit code.

## Other vulnerabilities in Opensuse Opensuse

- [CVE-2014-9357](https://insights.sbomify.com/CVE-2014-9357/): Arbitrary Code Execution (critical 10.0)
- [CVE-2020-14298](https://insights.sbomify.com/CVE-2020-14298/): Privilege escalation in Docker (high 8.8)
- [CVE-2020-14300](https://insights.sbomify.com/CVE-2020-14300/): Privilege escalation in Docker (high 8.8)
- [CVE-2018-15514](https://insights.sbomify.com/CVE-2018-15514/): Deserialization in n/a (high 8.8)
- [CVE-2014-9356](https://insights.sbomify.com/CVE-2014-9356/): Path Traversal in Docker (high 8.6)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-3697 and fix it if it is affected.

What it is: CVE-2016-3697 is a high-severity vulnerability in Opensuse Opensuse, published on 1 Jun 2016. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2016-3697 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/opencontainers/runc (Go): affected all versions; fixed in 0.1.0
- github.com/opencontainers/runc (Go): affected all versions; fixed in 0.1.0
- github.com/opencontainers/runc (Go): affected all versions; fixed in 0.1.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2016-3697/ (Markdown: https://insights.sbomify.com/CVE-2016-3697/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2016-3697
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2016-3697
- OSV: https://osv.dev/vulnerability/CVE-2016-3697

---
From sbomify Insights: https://insights.sbomify.com/CVE-2016-3697/
Summaries are generated and may contain mistakes; the official description above is the record.
