Skip to main content

CVE-2022-29162: CWE-276: Incorrect Default Permissions in opencontainers runc

Medium
Published: Tue May 17 2022 (05/17/2022, 00:00:00 UTC)
Source: CVE
Vendor/Project: opencontainers
Product: runc

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.

AI-Powered Analysis

AILast updated: 06/23/2025, 09:04:59 UTC

Technical Analysis

CVE-2022-29162 is a vulnerability in the opencontainers project’s runc tool, a widely used CLI utility for spawning and running Linux containers according to the Open Container Initiative (OCI) specification. The vulnerability affects versions of runc prior to 1.1.2 and relates to incorrect default permissions involving Linux process capabilities. Specifically, when using the `runc exec --cap` command, processes were created with non-empty inheritable Linux process capabilities. This is atypical because inheritable capabilities allow a process to elevate its capabilities during an execve(2) system call if the executed program has inheritable file capabilities. Although the container security sandbox was not directly compromised—since the inheritable set never exceeded the container's bounding set—this behavior created an unusual Linux environment that could potentially be leveraged for privilege escalation within the container context. The vulnerability stems from CWE-276 (Incorrect Default Permissions), where the default capability sets were improperly configured, allowing unintended capability inheritance. The issue was addressed in runc version 1.1.2 by modifying the behavior of `runc exec --cap` to exclude inheritable capabilities from the additional capabilities granted to the executed process. Additionally, the `runc spec` command was updated to ensure that the example OCI spec (`config.json`) no longer sets any inheritable capabilities by default. No known exploits have been reported in the wild, and the vulnerability primarily affects container environments running vulnerable runc versions on Linux hosts.

Potential Impact

For European organizations, the impact of this vulnerability is primarily related to containerized environments that utilize runc versions prior to 1.1.2. Since runc is a foundational container runtime component used by popular container platforms such as Docker and Kubernetes, organizations relying on container orchestration and deployment could be exposed. The vulnerability could allow processes within containers to gain elevated capabilities unexpectedly, potentially enabling privilege escalation or unauthorized access to resources within the container boundary. While the container sandbox itself remains intact, this flaw could facilitate lateral movement or privilege escalation attacks inside containers, which may lead to data exposure or disruption of containerized applications. Industries with heavy container adoption—such as finance, telecommunications, manufacturing, and cloud service providers—may face increased risk. Additionally, organizations with multi-tenant container environments or those running sensitive workloads in containers should be particularly cautious, as attackers exploiting this flaw could compromise container integrity or confidentiality. However, the absence of known exploits and the medium severity rating suggest that the immediate risk is moderate, but it warrants timely remediation to prevent potential exploitation.

Mitigation Recommendations

To mitigate this vulnerability effectively, European organizations should: 1) Audit container environments to identify runc versions in use, focusing on versions prior to 1.1.2. 2) Upgrade runc to version 1.1.2 or later to apply the fix that removes inheritable capabilities from processes spawned with `runc exec --cap`. 3) Review and harden container runtime configurations, especially any custom OCI specs (`config.json` files), to ensure no inheritable capabilities are set inadvertently. 4) Implement strict container security policies that limit the use of `--cap` flags and avoid granting unnecessary capabilities to container processes. 5) Monitor container runtime logs and system audit logs for unusual capability changes or execve calls that could indicate attempts to exploit this vulnerability. 6) Employ runtime security tools that can detect anomalous capability escalations or suspicious process behavior within containers. 7) Educate DevOps and security teams about the implications of Linux capabilities and the importance of minimal privilege principles in container environments. These steps go beyond generic patching advice by emphasizing configuration review, monitoring, and operational security best practices tailored to container ecosystems.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-04-13T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9843c4522896dcbf2edf

Added to database: 5/21/2025, 9:09:23 AM

Last enriched: 6/23/2025, 9:04:59 AM

Last updated: 8/1/2025, 3:08:33 AM

Views: 9

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats