CVE-2021-22555 Overview
CVE-2021-22555 is a heap out-of-bounds write vulnerability in the Linux kernel's Netfilter subsystem, specifically within net/netfilter/x_tables.c. This vulnerability has existed since Linux kernel version 2.6.19-rc1 and allows an attacker with local access to gain elevated privileges or cause a denial of service through heap memory corruption. The vulnerability is exploitable through user namespaces, making it particularly dangerous in containerized environments where unprivileged users may have access to create user namespaces.
Critical Impact
This vulnerability is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, indicating confirmed active exploitation in the wild. Successful exploitation enables local privilege escalation to root, potentially compromising the entire system.
Affected Products
- Linux Kernel (versions since 2.6.19-rc1)
- NetApp C400/C250 Firmware
- NetApp H410C/H300S/H500S/H700S/H410S Firmware
- NetApp FAS 8300/8700 Firmware
- NetApp AFF A400/A250/500F Firmware
- NetApp H610C/H610S/H615C Firmware
- NetApp Cloud Backup
- NetApp HCI Management Node
- NetApp SolidFire
- Brocade Fabric Operating System
Discovery Timeline
- July 7, 2021 - CVE-2021-22555 published to NVD
- October 27, 2025 - Last updated in NVD database
Technical Details for CVE-2021-22555
Vulnerability Analysis
This vulnerability resides in the Netfilter x_tables component, which is responsible for handling packet filtering rules in the Linux kernel. The flaw occurs during the translation of IPT_SO_SET_REPLACE operations when processing compat structures. When converting between 32-bit and 64-bit representations of iptables rules, the code fails to properly validate memory boundaries, leading to a heap out-of-bounds write condition.
The vulnerability is particularly significant because it can be triggered through user namespaces. In many Linux distributions, unprivileged users can create user namespaces, which grants them access to Netfilter operations. This means the attack surface extends beyond just privileged users to any local user on affected systems.
Root Cause
The root cause lies in improper memory offset calculations within the xt_compat_target_from_user() and related functions in x_tables.c. When the kernel processes compat iptables rules, it allocates a buffer based on the 64-bit target size but fails to account for padding differences between 32-bit and 64-bit structures. This miscalculation allows an attacker to write data beyond the allocated heap buffer, corrupting adjacent kernel memory structures.
The vulnerability specifically manifests when padding bytes are written outside the intended memory region during the compat translation process, enabling controlled heap corruption that can be leveraged for privilege escalation.
Attack Vector
The attack requires local access to the system with the ability to interact with Netfilter through system calls. The exploitation flow involves:
- Creating a user namespace to gain access to Netfilter operations
- Crafting malicious iptables rules with carefully calculated padding values
- Triggering the compat translation code path to cause out-of-bounds writes
- Leveraging the heap corruption to overwrite kernel structures
- Achieving arbitrary code execution in kernel context for privilege escalation
The attack can be performed by unprivileged local users on systems where user namespaces are enabled (which is the default on many distributions).
Detection Methods for CVE-2021-22555
Indicators of Compromise
- Unexpected kernel crashes or panics related to Netfilter/x_tables subsystem
- Suspicious iptables or netfilter-related system calls from unprivileged processes
- Processes running with elevated privileges that originated from unprivileged user context
- Audit logs showing unusual setsockopt() calls with IPT_SO_SET_REPLACE options
- Memory corruption artifacts in kernel logs referencing x_tables.c or Netfilter components
Detection Strategies
- Monitor for processes creating user namespaces followed by Netfilter operations using syscall auditing
- Implement kernel integrity monitoring to detect unauthorized privilege changes
- Deploy SIEM rules to correlate user namespace creation with subsequent privileged operations
- Use eBPF-based monitoring tools to track Netfilter-related system calls from non-root processes
Monitoring Recommendations
- Enable auditd rules for setsockopt syscalls involving IPPROTO_IP and IPPROTO_IPV6
- Monitor /proc/sys/kernel/unprivileged_userns_clone for changes
- Implement real-time alerting on unexpected privilege escalation events
- Review kernel logs for Netfilter-related errors or warnings
How to Mitigate CVE-2021-22555
Immediate Actions Required
- Apply the latest kernel patches from your Linux distribution immediately
- If patching is not immediately possible, disable unprivileged user namespaces by setting kernel.unprivileged_userns_clone=0
- Audit systems for signs of exploitation using the indicators of compromise listed above
- Prioritize patching systems running containerized workloads where user namespaces are commonly used
Patch Information
Patches are available through the official Linux kernel repository. Two key commits address this vulnerability:
Additionally, NetApp has released Security Advisory NTAP-20210805-0010 for affected products. Kernel live patches are also available as documented in Kernel Live Patch Security Notices.
Workarounds
- Disable unprivileged user namespaces to prevent exploitation by non-root users
- Restrict access to Netfilter operations using SELinux or AppArmor policies
- Implement network segmentation to limit the impact of potential privilege escalation
- Use container runtime security features to restrict namespace operations
# Disable unprivileged user namespaces (temporary mitigation)
echo 0 > /proc/sys/kernel/unprivileged_userns_clone
# Make the change persistent across reboots
echo "kernel.unprivileged_userns_clone = 0" >> /etc/sysctl.conf
sysctl -p
# Verify the setting is applied
sysctl kernel.unprivileged_userns_clone
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


