Skip to main content
Mallory
HighPublic exploitVulnerability

CVE-2021-4154: Use-after-free in Linux kernel cgroup v1 parser

Published Feb 4, 2022 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS8.8High · v3.1
EPSS1.2%69th percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendors
Red HatNetAppLinux
IdentifiersCVE-2021-4154CWE-416 · Use After Free

CVE-2021-4154 is a use-after-free vulnerability in the Linux kernel's cgroup v1 parser, specifically in cgroup1_parse_param(). A local attacker with user-level privileges can exploit fsconfig syscall parameter handling to escalate privileges, escape a container, or cause a host denial of service.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can compromise host security through local privilege escalation and container breakout. Exploitation can also cause denial of service on the host system. The vulnerability affects the shared host kernel, so its consequences are not necessarily confined to the originating container.

Mitigation

If you can’t patch tonight, do this now.

Until patched, reduce exposure by preventing untrusted local users or container tenants from accessing vulnerable hosts and by avoiding cgroup v1 where operationally feasible. Restricting the ability to invoke relevant filesystem-configuration operations can further reduce exposure, but patching is the definitive mitigation.

Remediation

Patch, then assume compromise.

Install the applicable vendor kernel update containing the fix and reboot into the updated kernel. Fixed RHEL packages include kernel 4.18.0-305.34.2.el8_4 under RHSA-2022:0186 and kernel 4.18.0-348.20.1.el8_5 under RHSA-2022:0825. Corresponding real-time kernel fixes are available under RHSA-2022:0187 and RHSA-2022:0819. Supported RHEL deployments can alternatively apply the matching kpatch live update under RHSA-2022:0231 or RHSA-2022:0849 without a conventional reboot. For affected Android devices, install a vendor update with security patch level 2022-06-05 or later.

Public exploits

Exploits

2 exploits validated by Mallory's analysis.

View more in app →
CVE-2021-4154This repository contains two C-based exploits (exp.c and kctf_exp.c) for CVE-2021-4154, a Linux kernel use-after-free vulnerability in the fsconfig syscall. The exploit targets several major Linux distributions (CentOS, Debian, Fedora, Ubuntu) with specific kernel versions prior to the upstream patch. The exploit works by manipulating file descriptors and kernel memory to overwrite privileged files (such as /etc/passwd) or hijack kernel execution, resulting in local privilege escalation to root. The exp.c file implements a reliable privilege escalation by overwriting /etc/passwd, while kctf_exp.c demonstrates a more advanced exploitation technique involving kernel ROP chains and namespace manipulation, ultimately spawning a root shell. The repository also includes a detailed writeup (WRITEUP.md) explaining the vulnerability, exploitation primitives, and technical background. The exploit requires local code execution on a vulnerable system and does not require network access. Several system and kernel configuration files are accessed or modified during exploitation, and the attack is purely local. The code is operational and can be adapted for different kernel versions with some modification.Markakd · Disclosed Aug 11, 2022 · c · localOperationalCVE-2021-4154This repository contains a local privilege escalation exploit for CVE-2021-4154, targeting the Linux kernel. The main exploit logic is implemented in 'exp.c', which leverages a use-after-free vulnerability in the cgroup filesystem to gain write access to arbitrary files, specifically targeting '/etc/passwd' to escalate privileges. The exploit sets up a controlled environment using user, mount, and network namespaces, and uses a combination of file descriptor manipulation and race conditions to achieve the exploit. The 'boot.sh' script is used to launch a QEMU virtual machine with a custom kernel and initrd, providing a safe environment for testing the exploit. The Makefile automates the build and test process. The repository is structured for ease of use in CTF or research environments, and demonstrates a working privilege escalation attack on vulnerable Linux systems.veritas501 · Disclosed Feb 23, 2023 · c · bash · localOperational
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
LinuxLinux Kerneloperating_system
NetAppHci Baseboard Management Controllerapplication
Red HatEnterprise Virtualizationapplication
Red HatRed Hat Enterprise Linuxoperating_system
FAQ

Frequently asked questions

Is CVE-2021-4154 exploited in the wild?
As of Oct 25, 2026, Mallory has no reports of CVE-2021-4154 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2021-4154?
Yes. Mallory tracks 2 public exploits or proofs of concept for CVE-2021-4154, the earliest disclosed Aug 11, 2022.
Is there a patch for CVE-2021-4154?
Install the applicable vendor kernel update containing the fix and reboot into the updated kernel. Fixed RHEL packages include kernel 4.18.0-305.34.2.el8_4 under RHSA-2022:0186 and kernel 4.18.0-348.20.1.el8_5 under RHSA-2022:0825.
What products are affected by CVE-2021-4154?
Linux Kernel, Red Hat Enterprise Virtualization, NetApp Hci Baseboard Management Controller, and Red Hat Enterprise Linux.
How severe is CVE-2021-4154?
CVE-2021-4154 has a CVSS v3.1 score of 8.8 (High) and an EPSS score of 1.2% (69th percentile) as of Oct 25, 2026.
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.