CVE-2022-0185

8.4 HIGH

📋 TL;DR

CVE-2022-0185 is a heap-based buffer overflow vulnerability in the Linux kernel's Filesystem Context API legacy handling. It allows a local attacker to escalate privileges to root, potentially gaining full system control. Affected systems are those with unprivileged user namespaces enabled or where attackers have namespaced CAP_SYS_ADMIN privileges.

💻 Affected Systems

Products:
  • Linux Kernel
Versions: Linux kernel versions 5.1 through 5.16.2
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Requires unprivileged user namespaces enabled (default on many distributions) or namespaced CAP_SYS_ADMIN privilege. Exploitation requires ability to open a filesystem that doesn't support Filesystem Context API.

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with root privileges, allowing complete control over the system, data theft, persistence installation, and lateral movement.

🟠

Likely Case

Local privilege escalation to root by authenticated users or processes with initial access, leading to system takeover.

🟢

If Mitigated

Limited impact if unprivileged user namespaces are disabled and proper access controls restrict CAP_SYS_ADMIN privileges.

🌐 Internet-Facing: LOW - This is a local privilege escalation vulnerability requiring local access to exploit.
🏢 Internal Only: HIGH - Internal attackers with local access can exploit this to gain root privileges and compromise the entire system.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Multiple public proof-of-concept exploits exist. Exploitation requires local access and specific conditions but has been weaponized in real attacks.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Linux kernel 5.16.3 and later

Vendor Advisory: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=722d94847de2

Restart Required: Yes

Instructions:

1. Update Linux kernel to version 5.16.3 or later. 2. For distributions: Use package manager to update kernel package (e.g., 'apt update && apt upgrade' for Debian/Ubuntu, 'yum update kernel' for RHEL/CentOS). 3. Reboot system to load new kernel.

🔧 Temporary Workarounds

Disable unprivileged user namespaces

linux

Prevents exploitation by unprivileged users by disabling the user namespace feature

echo 0 > /proc/sys/user/max_user_namespaces
sysctl -w user.max_user_namespaces=0

Restrict CAP_SYS_ADMIN

linux

Limit CAP_SYS_ADMIN privileges to prevent exploitation

Use Linux capabilities framework to restrict CAP_SYS_ADMIN: setcap -r /path/to/binary
Configure containers with reduced capabilities

🧯 If You Can't Patch

  • Implement strict access controls to limit local user access to vulnerable systems
  • Deploy endpoint detection and response (EDR) solutions to detect privilege escalation attempts

🔍 How to Verify

Check if Vulnerable:

Check kernel version: 'uname -r'. If version is between 5.1 and 5.16.2, system is vulnerable. Also check if unprivileged user namespaces are enabled: 'cat /proc/sys/user/max_user_namespaces' (non-zero means enabled).

Check Version:

uname -r

Verify Fix Applied:

After patching, verify kernel version is 5.16.3 or later with 'uname -r'. Test with known exploit PoC to confirm failure.

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic logs
  • OOM killer activity related to kernel processes
  • Unusual privilege escalation in audit logs
  • Failed mount operations with legacy filesystems

Network Indicators:

  • None - this is a local privilege escalation vulnerability

SIEM Query:

source="kernel" AND ("panic" OR "Oops" OR "general protection fault") OR source="audit" AND "cap_sys_admin" AND "escalation"

🔗 References

📤 Share & Export