CVE-2026-31431 "Copy Fail" — Linux Kernel algif_aead Deterministic Local Privilege Escalation Affecting All Major Distributions

CVE-2026-31431 "Copy Fail" (TL-2026-0486), also tracked as Copy Fail, is a high-severity software vulnerability scored CVSS 7.8, first published 2026-05-08. It has no confirmed attribution, affects Linux Kernel Linux Kernel (algif_aead), references 1 CVE (CVE-2026-31431), maps to 19 MITRE ATT&CK techniques (T1003, T1003.008, T1059), and is covered by 9 detection rules and 17 indicators of compromise.

Key facts for TL-2026-0486

Threat ID
TL-2026-0486
Also known as
Copy Fail
Severity
HIGH
CVSS
7.8 (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
Status
ACTIVE
Category
VULNERABILITY
First published
2026-05-08
Last reviewed
2026-05-08
Attribution confidence
NONE
Motivation
UNKNOWN
Target sectors
technology, cloud-services, financial, government, healthcare, telecommunications, education, manufacturing, media, saas, fintech, container-platforms
Target regions
Global
Detection rules
9
Indicators of compromise
17

Malware and tooling in CVE-2026-31431 "Copy Fail"

Malware and tooling: copy_fail.py (Unit 42 PoC)

CVE-2026-31431 ("Copy Fail") is a deterministic logic flaw in the Linux kernel's algif_aead module (AF_ALG crypto interface, authencesn algorithm) that lets an unprivileged local user escalate to UID 0 with 100% reliability via a 732-byte Python script. The bug is a regression of a 2017 in-place optimization (commit 72548b093ee3) and yields a four-byte controlled overwrite into the kernel page cache, which an attacker uses to stealthily patch cached setuid binaries (su, sudo, passwd) entirely in memory. It affects Linux 4.14 through 6.19.12 across virtually every major distribution (Ubuntu, Debian, RHEL, SUSE, AlmaLinux, Amazon Linux) and enables Kubernetes container escapes and multi-tenant host takeover.

How CVE-2026-31431 "Copy Fail" works

## Overview

CVE-2026-31431, publicly named "Copy Fail", is a high-severity local privilege escalation vulnerability in the Linux kernel crypto subsystem disclosed on the oss-security mailing list on 2026-04-29 and analyzed in detail by Unit 42 (Palo Alto Networks) on 2026-05-05. The vulnerability is a deterministic four-byte arbitrary write into the kernel page cache reachable from any unprivileged local user via the AF_ALG socket interface. Unlike heap-grooming or race-condition LPEs, exploitation is deterministic — no retries, no offset guessing, 100% reliability on first attempt — and the public 732-byte Python proof-of-concept is portable across distributions without modification.

## Technical Root Cause

The Linux kernel exposes its hardware-accelerated crypto primitives to userspace through the AF_ALG socket family. Submodules like algif_skcipher, algif_aead, and algif_hash provide socket-based APIs to symmetric ciphers, AEAD modes, and hash algorithms. The `algif_aead` driver implements the AEAD (Authenticated Encryption with Associated Data) interface used by algorithms such as `gcm(aes)`, `ccm(aes)`, and the legacy ESN variant `authencesn(...)`.

In 2017, kernel commit `72548b093ee3` ("crypto: algif_aead - skip SGL entries with NULL page") introduced an "in-place" optimization for the `authencesn` algorithm path that allowed encryption to operate directly on user-supplied scatterlist memory rather than allocating an intermediate destination buffer. The optimization assumed that the source and destination pages were always private to the calling task and writable. That assumption is wrong: user pages submitted via `sendmsg(MSG_MORE)` may be shared, read-only, or — critically — backed by the kernel page cache (e.g. mmaps of files on tmpfs, executables, or shared libraries).

When the AEAD authentication tag (the trailing 16 bytes of the ciphertext, of which only four bytes are within the attacker-controlled associated-data length boundary on the ESN variant) is written back "in place", the kernel writes attacker-chosen bytes into a page-cache page belonging to a kernel-trusted file. Because the page cache is shared across all processes that map the same inode, the corruption is visible to every subsequent reader — including the kernel's binfmt loader.

## Exploitation Chain

1. **Setup** — The attacker opens an `AF_ALG` socket, binds it with `sockaddr_alg.salg_type = "aead"` and `salg_name = "authencesn(hmac(sha1),cbc(aes))"`, sets a key with `setsockopt(SOL_ALG, ALG_SET_KEY, ...)`, and `accept()`s a child socket for the operation handle. 2. **Cache Hydrate** — The attacker reads `/usr/bin/su` (or `sudo`/`passwd`) so the relevant page is loaded into the page cache, then `mmap`s the file `MAP_SHARED | PROT_READ`. 3. **Submit** — The attacker calls `sendmsg(MSG_MORE)` on the AEAD socket with the mmap'd page as the source iovec, supplying an attacker-chosen four-byte tag value and the precise associated-data length that will steer the in-place write to the offset of the setuid check inside the binary. 4. **Trigger** — A single read on the operation socket triggers the kernel to perform the encrypt-and-tag operation. The four-byte tag is written into the page-cache page covering `/usr/bin/su`. 5. **Escalate** — The attacker `exec`s `/usr/bin/su`. The loader maps the corrupted page-cache copy. The patched bytes neutralize the credential check, and the binary preserves its setuid-root file mode — the attacker now has UID 0. 6. **Cleanup** — Page-cache eviction (memory pressure or `echo 1 > /proc/sys/vm/drop_caches`) restores the on-disk copy. There is no forensic artifact on disk; only volatile memory carries evidence of the modification.

## Why It Is Deterministic

Copy Fail does not rely on a heap spray, a TOCTOU race, or KASLR brute-force. The page-cache offset of any setuid binary is trivially derivable from `/proc/[pid]/maps` (no privilege required) and the algif_aead in-place path follows a fully deterministic control-flow once the algorithm name and associated-data length are fixed. The attacker writes the exact bytes they intend, at the exact offset they intend, on every kernel where the optimization is present. This is what makes Copy Fail comparable to Dirty Cow (CVE-2016-5195) and Dirty Pipe (CVE-2022-0847) in significance, but materially more reliable than either.

## Container and Multi-Tenant Impact

In a Kubernetes or shared-tenancy environment, all containers on a node share the host's kernel page cache. A compromised pod that hydrates and corrupts `/usr/bin/su` in the page cache corrupts that page for every other pod and the host itself, because Linux page-cache pages are keyed on `(inode, offset)` and inodes are shared by bind-mounted images. This collapses the container security boundary entirely: a pod with default capabilities can take over the host and every neighbor pod, with no on-disk artifact to detect.

## Affected Versions

The vulnerable optimization is present in every Linux kernel from 4.14 (where commit 72548b093ee3 was merged) through 6.19.12 inclusive. Distributions confirmed vulnerable include Ubuntu (all LTS in support), Amazon Linux 2 and 2023, RHEL 8/9/10, Debian 11/12/13, SUSE SLES 15, and AlmaLinux 8/9/10. Hardened kernels with `CONFIG_USER_NS=n` or seccomp profiles that block `socket(AF_ALG, ...)` are not exploitable; the latter is the recommended short-term mitigation.

## Patch

The upstream patch is commit `a664bf3d603d` ("crypto: algif_aead - revert in-place optimization"), which reverts `72548b093ee3` and restores the explicit destination-buffer copy. Distributions began shipping fixed kernels on 2026-05-06. There is no workaround that preserves the in-place fast-path; the optimization is unsafe in any form that does not validate page ownership, and a defense-in-depth seccomp filter is the recommended interim control until patched kernels are deployed everywhere.

## Detection Posture

Because the corruption lives in the page cache, traditional file-integrity monitoring (AIDE, Tripwire, auditd `-w /usr/bin/su -p wa`) will not flag the modification: the on-disk file is never touched. Detection must focus on (a) anomalous use of the `AF_ALG` socket family by non-crypto-aware processes, (b) auditd `execve` events where a setuid binary is invoked by an unprivileged ancestor and immediately yields a euid=0 child, and (c) eBPF instrumentation of `aead_recvmsg` or `algif_aead`-tagged kmem_cache allocations. See accompanying detections for SPL, KQL, and Sigma rules.

MITRE ATT&CK techniques used in TL-2026-0486

Credential Access

T1003 OS Credential Dumping; T1003.008 /etc/passwd and /etc/shadow

Execution

T1059 Command and Scripting Interpreter; T1059.004 Unix Shell; T1059.006 Python

Privilege Escalation

T1068 Exploitation for Privilege Escalation; T1548 Abuse Elevation Control Mechanism; T1548.001 Setuid and Setgid; T1548.003 Sudo and Sudo Caching; T1611 Escape to Host

Defense Evasion

T1070 Indicator Removal; T1574 Hijack Execution Flow; T1620 Reflective Code Loading

Discovery

T1082 System Information Discovery; T1083 File and Directory Discovery; T1613 Container and Resource Discovery

Initial Access

T1195 Supply Chain Compromise

Persistence

T1543 Create or Modify System Process

defense-impairment

T1601 Modify System Image

Affected products and versions in CVE-2026-31431 "Copy Fail"

  • Linux Kernel — Linux Kernel (algif_aead)
    Vulnerable versions: 4.14 through 6.19.12 inclusive
    Fixed in: 5.4.295; 5.10.241; 5.15.187; 6.1.150; 6.6.105; 6.12.41; 6.19.13
  • Canonical — Ubuntu
    Vulnerable versions: 18.04 ESM; 20.04 LTS; 22.04 LTS; 24.04 LTS; 25.10
    Fixed in: kernels shipped via USN-7491-1 (2026-05-06)
  • Red Hat — Red Hat Enterprise Linux
    Vulnerable versions: RHEL 8; RHEL 9; RHEL 10
    Fixed in: kernels shipped via RHSA-2026:2611
  • Debian — Debian GNU/Linux
    Vulnerable versions: 11 (bullseye); 12 (bookworm); 13 (trixie)
    Fixed in: kernels shipped via DSA-5912-1
  • SUSE — SUSE Linux Enterprise Server
    Vulnerable versions: SLES 15 SP4; SLES 15 SP5; SLES 15 SP6
    Fixed in: kernels shipped via SUSE-SU-2026:1547-1
  • Amazon Web Services — Amazon Linux
    Vulnerable versions: Amazon Linux 2; Amazon Linux 2023
    Fixed in: ALAS2-2026-2611; ALAS2023-2026-0419
  • AlmaLinux Foundation — AlmaLinux
    Vulnerable versions: 8; 9; 10
    Fixed in: kernels shipped via ALSA-2026:2611

Remediation for CVE-2026-31431 "Copy Fail"

Patches

  • Linux upstream commit a664bf3d603d (reverts 72548b093ee3) — included in stable releases 5.4.295, 5.10.241, 5.15.187, 6.1.150, 6.6.105, 6.12.41, 6.19.13.
  • Ubuntu USN-7491-1 (kernel-aws, kernel-azure, kernel-gcp, kernel-oracle).
  • RHSA-2026:2611 (RHEL 8/9/10).
  • Debian DSA-5912-1.
  • SUSE SUSE-SU-2026:1547-1.
  • Amazon Linux ALAS2-2026-2611, ALAS2023-2026-0419.
  • AlmaLinux ALSA-2026:2611.

Immediate actions

  • Apply distribution kernel updates carrying upstream commit a664bf3d603d (Ubuntu USN, RHSA, Debian DSA, SUSE SU, ALAS — released starting 2026-05-06).
  • On unpatched hosts, deploy a system-wide seccomp profile blocking socket(AF_ALG, ...) for all non-crypto-service processes.
  • Audit running container images and CI/CD runner base images for kernel versions <= 6.19.12 and flag for emergency patch cycles.
  • Restrict CAP_SYS_ADMIN-less containers from creating AF_ALG sockets via Pod Security Admission baseline + explicit seccomp default.

Workarounds

  • Block AF_ALG socket creation in seccomp-bpf default profile (Docker, containerd, Kubernetes).
  • Set sysctl kernel.unprivileged_userns_clone=0 to limit nested-namespace exploit primitives (defense-in-depth, not a fix).
  • Disable algif_aead module load via /etc/modprobe.d (install algif_aead /bin/false) where userspace crypto is not required.
  • Remove SUID bit from non-essential binaries (chmod u-s) to shrink the corruption target set.

Longer-term hardening

  • Deploy Linux Lockdown mode (lockdown=integrity) on production hosts to block additional kernel attack surface.
  • Adopt eBPF-based runtime threat detection (Falco, Tetragon) with rules covering AF_ALG socket creation by non-crypto processes.
  • Move toward per-pod user namespace remapping in Kubernetes (rootless Kubelet) to limit blast radius of kernel LPEs.
  • Establish automated kernel CVE intake → patch SLA workflow keyed on CISA KEV and oss-security disclosures.

CVEs associated with CVE-2026-31431 "Copy Fail"

CVE-2026-31431

Weaknesses (CWE) in CVE-2026-31431 "Copy Fail"

CWE-787, CWE-119, CWE-269, CWE-264

Timeline of CVE-2026-31431 "Copy Fail"

  • Linux kernel commit 72548b093ee3 ("crypto: algif_aead - skip SGL entries with NULL page") merges the in-place AEAD optimization that becomes the root cause of CVE-2026-31431. Optimization ships in Linux 4.14 and is preserved in every subsequent stable branch.
  • Justin Moore (Unit 42, Palo Alto Networks) discovers the in-place page-cache write primitive in algif_aead during AI-assisted kernel auditing. Time-to-discovery reported as approximately one hour from prompt to working primitive.
  • Coordinated disclosure begins with the Linux kernel security team and major distribution vendors (Canonical, Red Hat, Debian, SUSE, Amazon).
  • CVE-2026-31431 disclosed publicly on the oss-security mailing list with a 732-byte Python proof-of-concept. NVD publishes the CVE record the same day with CVSS 7.8 (HIGH).
  • oss-security follow-up message posted with additional reproducibility notes and confirmation that the PoC works unmodified across Ubuntu, Debian, RHEL and Amazon Linux.
  • Unit 42 publishes "Copy Fail: What You Need to Know About the Most Severe Linux Threat in Years" with full technical write-up, exploit chain analysis, and detection guidance. Upstream patch commit a664bf3d603d is merged the same day.
  • First wave of distribution patches released — Ubuntu USN-7491-1, Red Hat RHSA-2026:2611, Amazon Linux ALAS2023-2026-0419, AlmaLinux ALSA-2026:2611.
  • Second wave of distribution patches — Debian DSA-5912-1, SUSE SUSE-SU-2026:1547-1.
  • Threadlinqs Intelligence Platform publishes TL-2026-0486 with full MITRE mapping, IOCs, detection rules, and adversary simulation guidance. Status set to ACTIVE pending CISA KEV listing.
  • As of 2026-05-29, CVE-2026-31431 "Copy Fail" remains a live, actively exploited Linux LPE: CISA added it to KEV in early May with a May 15 FCEB patch deadline, and weaponized Python/Go/Rust PoCs are circulating. Distro patches (commit a664bf3d603d) shipped May 1-7, but exploitation continues against the huge unpatched fleet, especially containers.

Sources cited for CVE-2026-31431 "Copy Fail"

Threats related to CVE-2026-31431 "Copy Fail"

Detection coverage for TL-2026-0486

As of 2026-05-08, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-0486 across Splunk SPL, Microsoft KQL and Sigma, covering 17 indicator(s) of compromise. The whole corpus is readable without an account; a free account unlocks full detection query text in Splunk SPL, Microsoft KQL and Sigma; paid tiers add raw indicator values, correlation and the MCP server. Threadlinqs MCP server · View plans.

Threadlinqs Intelligence — Real-Time Threat Detection Platform

[ 0 threats ] [ 0 det ] [ CRIT: 0 ] [ HIGH: 0 ]
// threat_feed
$ sort --newest
Showing all threats

Latest Threats