CODERED VTA

Linux Kernel Flaw Grants Root Access to Any Local User Across All Major Distributions

Medium
Linux Kernel Flaw Grants Root Access to Any Local User Across All Major Distributions
Image from Freepik

A critical vulnerability tracked as CVE-2026-31431 affects virtually every mainstream Linux distribution released between 2017 and April 2026, allowing any unprivileged local user to gain complete root access to the system. The flaw resides in the kernel's crypto API (AF_ALG), specifically in the algif_aead module that ships enabled by default in standard configurations across Ubuntu, Red Hat Enterprise Linux, Amazon Linux, SUSE, Debian, Arch, Fedora, and numerous other distributions. The vulnerability requires no special privileges, no network access, and no kernel debugging features just a basic local user account. A proof-of-concept exploit demonstrating the attack is merely 732 bytes of Python code that works unmodified across all affected distributions, making this an exceptionally dangerous threat to multi-tenant environments, container platforms, and cloud infrastructure.

The vulnerability exploits a 2017 optimization in the algif_aead module that performs in-place encryption operations. This optimization inadvertently allows user-controlled data to corrupt the kernel's page cache, which stores recently accessed file contents in memory for performance. An attacker can manipulate the page cache entries of setuid binaries like /usr/bin/su, injecting malicious code that executes with root privileges when the binary is next invoked. The attack chain requires only Python 3.10 or later with standard libraries, using socket operations to interact with the AF_ALG interface and compress/decompress functions to craft the payload. Because the page cache is shared across the entire system including between containers on the same host this vulnerability breaks tenant isolation boundaries in Kubernetes clusters, container platforms, and any multi-user Linux environment. The exploit modifies the in-memory representation of setuid binaries without touching disk, making detection through traditional file integrity monitoring ineffective.

This vulnerability poses an immediate critical risk to cloud service providers, CI/CD infrastructure, shared development environments, and any platform executing untrusted code from multiple users or tenants. Kubernetes clusters are particularly vulnerable since a malicious container can compromise the underlying node and pivot to other tenants sharing the same kernel. GitHub Actions self-hosted runners, GitLab CI systems, and Jenkins build agents face severe risk as a malicious pull request can escalate to root on the runner infrastructure. Major Linux distributions have released patches reverting the 2017 optimization, and organizations must prioritize kernel updates immediately. For systems that cannot be immediately patched, disabling the algif_aead module provides effective mitigation with minimal operational impact, as the AF_ALG userspace interface is rarely used by production applications. Organizations running multi-tenant Linux infrastructure should treat this as a break-glass patching scenario and implement seccomp filters to block AF_ALG socket creation for untrusted workloads regardless of patch status.

Attack Surface

Endpoint OS, Server OS, Cloud Service, Infrastructure

Tactics

Privilege Escalation, Defense Evasion

Techniques

  • T1068 – Exploitation for Privilege Escalation
  • T1611 – Escape to Host
  • T1055 – Process Injection

SuperPRO's Threat Countermeasures Procedures

  1. Immediately update Linux kernel packages to versions including mainline commit a664bf3d603d which reverts the 2017 algif_aead optimization for Ubuntu 24.04 LTS, RHEL 10.1, Amazon Linux 2023, SUSE 16, and all affected distributions
  2. For systems awaiting patch deployment, disable algif_aead module immediately using command: echo install algif_aead /bin/false > /etc/modprobe.d/disable-algif.conf && rmmod algif_aead
  3. Implement seccomp filters blocking AF_ALG socket creation (socket family 38) for all container workloads, CI/CD runners, and untrusted user processes regardless of patch status
  4. Audit multi-tenant Linux hosts, Kubernetes nodes, GitHub Actions self-hosted runners, GitLab runners, and Jenkins agents for kernel versions between 4.10 (2017) and patched versions released April 2026
  5. Monitor for AF_ALG socket usage on production systems using lsof | grep AF_ALG and ss -xa commands to identify potentially affected or exploited services
  6. Verify patch effectiveness by testing the published proof-of-concept exploit (SHA256: a567d09b15f6e4440e70c9f2aa8edec8ed59f53301952df05c719aa3911687f9) in isolated test environments before production deployment
  7. Review and restrict local user account creation policies on shared development boxes, jump hosts, build servers, and any multi-user Linux systems until patches are verified deployed

References

  1. https://github.com/theori-io/copy-fail-CVE-2026-31431/blob/main/copy_fail_exp.py
  2. https://github.com/theori-io/copy-fail-CVE-2026-31431
  3. https://copy.fail/