runc: Incorrect Default Permissions
CVE-2022-29162 is a high-severity incorrect default permissions vulnerability in runc from Opencontainers, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. Affected runc versions: < 1.1.2. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.39% chance of exploitation within 30 days, which is low compared with other CVEs.
High severity with no evidence of exploitation so far.
What to do
- Check which version of runc you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Opencontainers | runc | < 1.1.2 | Not stated |
| Fedora Project | Fedora | 34; 35; 36 | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 5.9 | Medium | CNA (github.com) |
| CVSS 3.1 | 7.8 | High | NVD |
| CVSS 2.0 | 4.6 | Medium | NVD |
Official description
runc is a CLI tool for spawning and running containers on Linux according to the OCI specification. A bug was found in runc prior to version 1.1.2 where `runc exec --cap` created processes with non-empty inheritable Linux process capabilities, creating an atypical Linux environment and enabling programs with inheritable file capabilities to elevate those capabilities to the permitted set during execve(2). This bug did not affect the container security sandbox as the inheritable set never contained more capabilities than were included in the container's bounding set. This bug has been fixed in runc 1.1.2. This fix changes `runc exec --cap` behavior such that the additional capabilities granted to the process being executed (as specified via `--cap` arguments) do not include inheritable capabilities. In addition, `runc spec` is changed to not set any inheritable capabilities in the created example OCI spec (`config.json`) file.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Incorrect Default Permissions
During installation, installed file permissions are set to allow anyone to modify those files.
How developers prevent this class of flaw
- The architecture needs to access and modification attributes for files to only those users who actually require those actions.
- Compartmentalize the system to have safe areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
More Incorrect Default Permissions vulnerabilities (CWE-276)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/opencontainers/runc/security/advisories/GHSA-f3fp-gc8g-vw66Third Party Advisory
Patches and release notes
- github.com/opencontainers/runc/commit/d04de3a9b72d7a2455c1885fc75eb36d02cd17b5Third Party Advisory
- github.com/opencontainers/runc/releases/tag/v1.1.2Release Notes, Third Party Advisory
Other references
- lists.debian.org/debian-lts-announce/2023/03/msg00023.html
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AVPZBV7ISA7QKRPTC7ZX…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/D77CKD3AXPMU4PMQIQI5…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GPQU4YC4AAY54JDXGDQH…
Other vulnerabilities in runc
- 7.5 High severity
- 7.5 High severity
- 7.8 High severity
- 8.6 High severity
- 7.8 High severity
Recent Incorrect Default Permissions vulnerabilities
- 7.8 High severity
- 7.8 High severity
- 7.5 High severity
- 7.5 High severity
- 7.8 High severity
- 7.5 High severity
Spotted an error? Tell us.