CVE-2026-31431 "Copy Fail":Linux 内核页缓存 4 字节写漏洞,732 字节 PoC 可通杀 2017 年以来所有主流发行版
-
安全研究团队 Theori 旗下的 Xint Code 于 4 月 29 日公开披露 CVE-2026-31431(“Copy Fail”)——一个在 Linux 内核加密子系统中潜伏近十年的直线逻辑缺陷,无需竞态条件、无需内核版本特定偏移,同一支 732 字节 Python 脚本(仅用标准库)可在 Ubuntu、Amazon Linux、RHEL、SUSE 四大发行版上稳定获取 root shell,并已确认可作为容器逃逸原语横穿 Kubernetes 节点边界(Part 2 技术细节待发)。漏洞根本原因在于三个独立修改在时间轴上的交叉:2011 年
authencesn加入内核以支持 IPsec ESN 时将调用方目标 scatterlist 当作 ESN 字节交换的临时暂存区;2015 年AF_ALG获得 AEAD 支持并引入splice()路径,可将页缓存页(包含 setuid 二进制文件的内存镜像)以引用方式直接喂入加密 scatterlist;2017 年algif_aead.c引入"就地(in-place)"优化,令req->src = req->dst且通过sg_chain()把页缓存的 tag 页链接到可写目标 scatterlist——至此authencesn的越界 4 字节写正好落入页缓存中,而该写入完全绕过 VFS writeback 路径,磁盘文件保持不变,基于磁盘校验的完整性工具无法检测。利用时攻击者以splice()将/usr/bin/su的页缓存喂入 AF_ALG socket,通过选择 assoclen 与 splice 偏移精确控制写入位置,通过 sendmsg AAD bytes 4–7(seqno_lo)控制写入值,多轮调用后在内存中注入 shellcode,execve("/usr/bin/su")即触发提权——无需特权,唯需普通本地用户账号。漏洞于 3 月 23 日向 Linux 内核安全团队报告,4 月 1 日主线提交修复(commit
a664bf3d603d,撤销 2017 年的 in-place 优化,将req->src与req->dst重新分离为独立 scatterlist),4 月 22 日分配 CVE 编号,4 月 29 日公开披露。主流发行版(RHEL、Ubuntu、SUSE、Debian)正在或已推送含修复的内核包。紧急缓解措施为禁用algif_aead模块:执行echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf && rmmod algif_aead 2>/dev/null;此操作对 dm-crypt/LUKS、kTLS、IPsec/XFRM、OpenSSL 默认构建均无影响,仅影响显式启用afalg引擎的少数配置。对 CI runner、容器沙盒、多租户主机等不可信工作负载,无论是否已打补丁均建议通过 seccomp 阻断AF_ALGsocket 创建。Copy Fail | Xint Blog | GitHub PoC | Red Hat | Ubuntu | Debian | SUSE
Copy Fail — 732 Bytes to Root
Copy Fail (CVE-2026-31431): a 732-byte Linux LPE — straight-line, no race, no per-distro offsets. Same Python script roots Ubuntu, Amazon Linux, RHEL, SUSE since 2017. Page-cache write bypasses on-disk file-integrity tools and crosses container boundaries. Found by Xint Code.
Xint (copy.fail)
Copy Fail: 732 Bytes to Root on Every Major Linux Distribution. - Xint
Xint Code disclosed CVE-2026-31431, an authencesn scratch-write bug chaining AF_ALG + splice() into a 4-byte page cache write. A 732-byte PoC gets root on Ubuntu, Amazon Linux, RHEL, SUSE. | AI for Security, Vulnerability Research
(xint.io)
GitHub - theori-io/copy-fail-CVE-2026-31431
Contribute to theori-io/copy-fail-CVE-2026-31431 development by creating an account on GitHub.
GitHub (github.com)