Exploit database

Vulnerability

CVE-2022-0492

Vulnerability details

Score
7.8
Severity
high

CVSS 3.1 · CISA-ADP

Vector string

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Description

A vulnerability was found in the Linux kernel’s cgroup_release_agent_write in the kernel/cgroup/cgroup-v1.c function. This flaw, under certain circumstances, allows the use of the cgroups v1 release_agent feature to escalate privileges and bypass the namespace isolation unexpectedly.

CVE Program

Exploit source choices

10 sources
Docker cgroups Container Escape
MSF-linux--local--docker_cgroup_escapeMetasploitLinux,Unix / remotePreferred

This exploit module takes advantage of a Docker image which has either the privileged flag, or SYS_ADMIN Linux capability. If the host kernel is vulnerable, its possible to escape the Docker image and achieve root on the host operating system. A vulnerability was found in the Linux kernel's cgroup_release_agent_write in the kernel/cgroup/cgroup-v1.c function. This flaw, under certain circumstances, allows the use of the cgroups v1 release_agent feature to escalate privileges and bypass the namespace isolation unexpectedly. More simply put, cgroups v1 has a feature called release_agent that runs a program when a process in the cgroup terminates. If notify_on_release is enabled, the kernel runs the release_agent binary as root. By editing the release_agent file, an attacker can execute their own binary with elevated privileges, taking control of the system. However, the release_agent file is owned by root, so only a user with root access can modify it.

2022-02-04docker_cgroup_escape.rb
cdk-team/cdk
GH-5a853275f3d5514fc655ded3e07c494eGitHubUnofficial GitHub source

📦 Make security testing of K8s, Docker, and Containerd easier.

2020-11-05157 files · 4,802 stars
ctrsploit/ctrsploit
GH-9a0531415465a45cdfdcbe664b81ee2cGitHubUnofficial GitHub source

A penetration toolkit for container environment

2021-08-031,072 files · 163 stars
paloaltonetworks/can-ctr-escape-cve-2022-0492
GH-5675cc4064a9b687537d495d07faba45GitHubUnofficial GitHub source

Test whether a container environment is vulnerable to container escapes via CVE-2022-0492

2022-02-284 files · 46 stars
chenaotian/cve-2022-0492
GH-b5a84fb64b84a245c4f7f8f73594ab64GitHubUnofficial GitHub source

CVE-2022-0492 EXP and Analysis write up

2022-03-1113 files · 35 stars
bashofmann/hacking-kubernetes
GH-5cfb9db52eb16eb26ac10eb55ca78e12GitHubUnofficial GitHub source

bashofmann/hacking-kubernetes source repository

2023-05-2320 files · 13 stars
sofianehamlaoui/cve-2022-0492-checker
GH-fb88da874ce5f30dcf0cb819ab917f66GitHubUnofficial GitHub source

A script to check if a container environment is vulnerable to container escapes via CVE-2022-0492

2022-03-065 files · 13 stars