Join our Newsletter — 33% off our NHI Course
Home› Guides› Landmark Linux Privilege Escalation CVEs: Dirty COW, Dirty…
Guide Vulnerability Management

Landmark Linux Privilege Escalation CVEs: Dirty COW, Dirty Pipe, PwnKit, Baron Samedit and Looney Tunables

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 13 min read
On this page

Five Linux bugs, disclosed between 2016 and 2023, turned any local account into root on most mainstream distributions, and all five still turn up on unpatched servers, appliances and container images. Dirty COW (CVE-2016-5195), Baron Samedit (CVE-2021-3156), PwnKit (CVE-2021-4034), Dirty Pipe (CVE-2022-0847) and Looney Tunables (CVE-2023-4911) sit in three different layers: the kernel, setuid userspace tools and the C library's dynamic loader. That difference decides how you patch, whether a reboot is needed, and what a container boundary does or does not protect. This guide explains each one at defender level, compares them side by side and draws out the patching and detection lessons. It is for Linux administrators, SOC analysts and vulnerability managers. It contains no exploit code. For the wider family of escalation techniques, see the Linux Privilege Escalation Techniques Guide.

Key takeaways

  • All five are in the CISA KEV catalogue. CISA lists every one as a Known Exploited Vulnerability, and records PwnKit as known to be used in ransomware campaigns, so they belong in the "fix now" tier, not the backlog.
  • Layer decides the fix. Dirty COW and Dirty Pipe are kernel bugs (new kernel plus reboot, or a live patch); PwnKit, Baron Samedit and Looney Tunables are userspace packages (polkit, sudo, glibc) where an update takes effect without a kernel reboot, though long-running processes may keep old libraries loaded.
  • Containers share the kernel. A kernel escalation bug inside a container is a route to the host (ATT&CK T1611 Escape to Host); a userspace bug gives root only inside the container unless that container is already privileged.
  • Old code, long exposure. The pkexec flaw dated from 2009 and the sudo flaw from 2011, so "we have not changed that package in years" is a reason to check, not a reason to relax.
  • Detection is behavioural. Watch for unprivileged processes that become root without a sanctioned path, unusual setuid executions and tampering with setuid files, because signatures for specific exploits age quickly.

Why these five matter

Local privilege escalation is the step that turns a foothold (a compromised web application user, a stolen SSH key for a low-privilege account, a container breakout attempt) into full control of the host. ATT&CK tracks it as T1068 Exploitation for Privilege Escalation. These five are the reference cases because each was reliable, affected default installations of major distributions and was quickly weaponised in public tooling.

NameCVEDisclosedComponentAffected (per primary source)Fix
Dirty COWCVE-2016-51952016 (exploited in the wild October 2016)Linux kernel memory management (copy-on-write in mm/gup.c)Kernel 2.x through 4.x before 4.8.3Patched kernel and reboot, or vendor live patch
Baron SameditCVE-2021-315626 January 2021sudo (sudoedit argument parsing, heap overflow)sudo 1.8.2 to 1.8.31p2 and 1.9.0 to 1.9.5p1 (also 1.7.7 to 1.7.10p9)sudo 1.9.5p2 or 1.8.32, or the distribution's patched package
PwnKitCVE-2021-403425 January 2022polkit pkexec (setuid helper)pkexec since its introduction in May 2009Patched polkit package; no reboot needed
Dirty PipeCVE-2022-08477 March 2022Linux kernel pipe buffer handlingKernel 5.8 and later until fixed releases; Android kernels also affectedKernel 5.16.11, 5.15.25, 5.10.102 or vendor backport, then reboot or live patch
Looney TunablesCVE-2023-49113 October 2023glibc dynamic loader ld.so (GLIBC_TUNABLES handling)glibc 2.34 up to before 2.39 per the CVE record; vendors backported fixesPatched glibc package from the distribution

Version ranges are those in the upstream advisories and CVE records. Enterprise distributions backport fixes without changing the upstream version number, so always judge exposure by your vendor's advisory and package release, not by the version string alone. The How to Read a CVE Advisory Guide covers this in more detail.

Dirty COW

Dirty COW was a race condition in the kernel's copy-on-write handling that let an unprivileged local user write to read-only memory mappings. The CVE record notes it was exploited in the wild in October 2016, and Red Hat's bulletin explains that attackers could use it to modify setuid files. Red Hat listed RHEL 5, 6 and 7 as affected and offered a SystemTap-based interim workaround that intercepted the vulnerable call path without a reboot, with clear limits: it had to be built for each exact kernel, was not reloaded after boot and was supported only for a short window after final patches shipped.

  • Lesson for patching: interim kernel mitigations are fragile. They buy days, not months, and they vanish at reboot unless reapplied.
  • Lesson for asset management: the bug reached back across years of kernels, so embedded devices and appliances with frozen kernels stayed exposed long after servers were fixed.

Dirty Pipe

Dirty Pipe was found by Max Kellermann while investigating file corruption reports, and disclosed on 7 March 2022. An uninitialised flags field in pipe buffers let an unprivileged user overwrite data in the page cache of files they could read, including read-only files. The discoverer's write-up traces the uninitialised field back to Linux 4.9 and exploitability to a change in 5.8. Fixed releases were 5.16.11, 5.15.25 and 5.10.102, and the bug was reproduced on an Android phone, so mobile and embedded kernels were in scope too.

  • Forensic catch: the change lives in the page cache, not on disk, until the page is evicted or written back. On-disk file integrity checks may see nothing, and a reboot can erase the evidence. Capture memory and volatile state before rebooting a suspected host; see the Linux Forensics Guide.
  • Lesson for prioritisation: a newer kernel is not automatically safer. Dirty Pipe only affected 5.8 onwards, so fleets that had just upgraded were exposed while older long-term kernels were not.

PwnKit

PwnKit, disclosed by Qualys on 25 January 2022, was a memory corruption flaw in pkexec, the setuid-root helper in polkit that lets permitted users run commands as another user. pkexec did not handle an empty argument list correctly and could end up treating environment variables as commands. Qualys reported exploiting default installations of Ubuntu, Debian, Fedora and CentOS, and noted the flaw had existed since pkexec was added in May 2009.

  • Interim options differ by vendor: Qualys suggested removing the setuid bit from pkexec where no patch was available. Red Hat's bulletin RHSB-2022-001 instead offered a SystemTap mitigation and cautioned that removing setuid breaks legitimate pkexec use. Decide per estate, test, and record the choice.
  • Log traces: the Qualys advisory notes that its exploitation method leaves syslog messages from pkexec about the SHELL variable not being found in /etc/shells or an environment variable containing suspicious content, while warning that trace-free exploitation is possible. Treat those strings as a useful hunt lead, not a complete detection.
  • Containers: Red Hat listed container images that ship polkit as affected. Rebuild images from patched bases, do not just patch hosts.

Baron Samedit

Baron Samedit was a heap-based buffer overflow in sudo's handling of escaped characters when invoked as sudoedit in shell mode. Qualys found it, and sudo's own advisory dated 26 January 2021 lists affected versions 1.7.7 to 1.7.10p9, 1.8.2 to 1.8.31p2 and 1.9.0 to 1.9.5p1, fixed in 1.8.32 and 1.9.5p2. Qualys traced it to a July 2011 change and confirmed it on Ubuntu 20.04, Debian 10 and Fedora 33. Crucially, any local user could exploit it, whether or not they were listed in sudoers.

  • No workaround: the sudo project states that the only remedy is a fixed version. Plan for package updates on every host, including build agents and jump hosts.
  • Safe version check: the sudo advisory describes a non-destructive test, based on the message sudoedit prints in shell mode, that tells a patched build from a vulnerable one. Prefer your scanner or package inventory, and use the advisory's check to confirm edge cases.
  • Beyond Linux: Qualys later noted reports that macOS, AIX and Solaris builds of sudo were also affected, which it had not independently verified. Inventory sudo on every Unix-like platform, not just Linux.

Looney Tunables

Looney Tunables, disclosed by Qualys on 3 October 2023, was a buffer overflow in the glibc dynamic loader ld.so when processing the GLIBC_TUNABLES environment variable. Because ld.so runs for every dynamically linked program, including setuid ones, a crafted variable could yield root. Qualys reported the bug was introduced in glibc 2.34 in April 2021 and confirmed default installs of Fedora 37 and 38, Ubuntu 22.04 and 23.04, and Debian 12 and 13. Alpine Linux was not affected because it uses musl libc. CISA added it to KEV on 21 November 2023.

  • Lesson for coverage: glibc is in almost every image. Software composition and image scanning must look at base layers, not only at application packages.
  • Lesson for mandatory access control: Qualys noted that SELinux and AppArmor rules blocked its method against some specific setuid programs. MAC limited the damage but did not remove the flaw; see the Reference Monitors and Mandatory Access Control Guide.

Detection and patching lessons

Kernel versus userspace patching

QuestionKernel bugs (Dirty COW, Dirty Pipe)Userspace bugs (PwnKit, Baron Samedit, Looney Tunables)
What fixes itNew kernel package plus reboot, or a vendor live patch for the running kernelUpdated polkit, sudo or glibc package
Reboot neededYes, unless live patched (and a later full reboot is still advisable)No kernel reboot; restart services that hold the old glibc, or reboot for certainty after a glibc update
Container imagesImage rebuild does not help; the host kernel must be fixedRebuild every image whose base layer carries the vulnerable package
How to verifyRunning kernel version or live patch status, not just the installed packageInstalled package version against the vendor advisory
Interim mitigationVendor-supplied SystemTap or similar, kernel-specific and short-livedVendor guidance only (for example, removing pkexec setuid), tested first

Live patching (kpatch, Livepatch, Ksplice, SUSE Live Patching) closes the gap for kernel bugs on hosts that cannot reboot quickly, but it is not a substitute for regular reboots onto a fixed kernel. See the Linux Kernel Live Patching Guide for scope and limits.

Container escape implications

  • Kernel bugs cross the boundary: containers share the host kernel, so a kernel privilege escalation from inside a container can become host compromise (T1611). Seccomp profiles, dropping capabilities and user namespaces narrow the attack surface but do not fix the kernel; see the Linux Namespaces and cgroups Security Guide.
  • Userspace bugs stay inside, mostly: root inside an unprivileged container is contained by namespaces, but a privileged container, a mounted host path or a container runtime socket turns that root into host access.
  • Remove what you do not need: minimal and distroless images often ship without sudo or polkit, which removed two of these five from scope entirely.

Detection with auditd and EDR (concept level)

SignalTelemetryRelevant to
Process gains effective UID 0 without a sanctioned parent (sudo with a sudoers match, su, systemd)auditd execve and setuid syscalls with auid and euid fields; EDR process lineageAll five
pkexec executed with an empty argument list, or pkexec syslog messages about SHELL or suspicious environment contentauditd execve records for /usr/bin/pkexec; syslog or journalPwnKit
sudoedit invoked in shell mode by users not in sudoers, repeated sudo crashesauditd execve; sudo logs; core dump or crash recordsBaron Samedit
Setuid binary launched with an unusually long or malformed GLIBC_TUNABLES environment valueEDR process environment capture (auditd does not record environment by default)Looney Tunables
Writes to, or changed hashes of, setuid binaries, /etc/passwd or /etc/shadowauditd watches (-w with write and attribute permissions); file integrity monitoring; in-memory checks for page cache tamperingDirty COW, Dirty Pipe
Container process spawning host-namespace processes or touching host pathsContainer runtime and EDR telemetry, Kubernetes audit logsKernel bugs used for escape

Build these into analytics as described in the Linux Logging and auditd for Defenders Guide and the Linux Detection and Response Guide.

Rollout order

  1. Inventory first: list running kernels, and installed sudo, polkit and glibc versions, across hosts and container images, mapped to vendor advisories.
  2. Rank by local access: multi-user hosts, shared build agents, web servers running untrusted code and Kubernetes nodes go first, because these are where an attacker is most likely to already have a low-privilege foothold.
  3. Pilot ring: patch a representative group, check services and container networking (Red Hat warned that a polkit update on RHEL 7 with Docker could reset IP forwarding), then widen.
  4. Apply interim mitigations only where patching must wait: record each one with an owner and expiry date.
  5. Verify: confirm the running kernel or live patch state and the installed package versions, then rebuild and redeploy affected images.
  6. Roll back cleanly: keep the previous kernel as a boot option and package rollback available; if you roll back, reapply an interim mitigation the same day.

Measuring progress

  • Percentage of hosts running a kernel fixed for Dirty COW and Dirty Pipe (running, not just installed).
  • Median days from vendor advisory to fix for KEV-listed Linux CVEs, against your SLA.
  • Number of container images in registries and in production with vulnerable sudo, polkit or glibc.
  • Count of interim mitigations past their expiry date.
  • Coverage: percentage of Linux hosts sending auditd or EDR process telemetry to the SIEM.

Framework mapping

FrameworkReferenceHow it applies
MITRE ATT&CK v20T1068 Exploitation for Privilege Escalation; T1611 Escape to HostThe technique these CVEs enable, and the container consequence of the kernel bugs
NIST SP 800-53 Rev 5SI-2 Flaw Remediation; RA-5 Vulnerability Monitoring and Scanning; CM-7 Least Functionality; AU-12 Audit Record Generation; SI-4 System MonitoringPatch, scan, remove unneeded setuid tools, log and monitor
NIST CSF 2.0ID.RA-01; PR.PS-02; DE.CM-09Identify vulnerabilities, maintain software by risk, monitor runtime environments
CISAKnown Exploited Vulnerabilities catalogueAll five listed; use KEV status to set remediation deadlines

Practitioner checklist

  • Confirm every Linux host runs a kernel fixed for CVE-2016-5195 and CVE-2022-0847, checking the running kernel or live patch status.
  • Confirm sudo, polkit and glibc packages are at or above the vendor's fixed release for CVE-2021-3156, CVE-2021-4034 and CVE-2023-4911.
  • Scan container registries and running workloads for these packages in base layers, and rebuild affected images.
  • Remove sudo, polkit and other setuid helpers from images and servers that do not need them.
  • Run no privileged containers or host path mounts without a recorded exception, so a kernel bug is not a free route to the host.
  • Alert on unexpected transitions to UID 0, pkexec with no arguments, sudoedit shell mode by non-sudoers and writes to setuid binaries.
  • Capture memory before rebooting a host suspected of page cache tampering.
  • Track interim mitigations with owners and expiry dates, and remove them once patched.

Standards and references

Related NHI Mgmt Group resources: Linux Privilege Escalation Techniques Guide · Linux Kernel Live Patching Guide · Linux File Permissions, SUID and ACLs Guide · Linux Server Hardening Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.