## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-RIPPSEC-CVE-2026-31431-COPY-FAIL
# CVE-2026-31431 โ "Copy Fail": Linux ์ปค๋ `algif_aead` ๋ก์ปฌ ๊ถํ ์์น
> **CISA KEV | CVSS 7.8 HIGH | Linux ์ปค๋ 4.14 ~ 2026๋
์ด๋ฐ ์ํฅ (~9๋
)**
* * *
## ๋ชฉ์ฐจ
1. ์์ฝ
2. ์ํ ํ๊ฐ
3. ๊ธฐ์ ์ฌ์ธต ๋ถ์
4. ๊ณต๊ฒฉ ๋ฐฉ๋ฒ๋ก โ ๋ ๋ ํ
5. ํ์ง ๋ฐ ์ฌ๊ณ ๋์ โ ๋ธ๋ฃจ ํ
6. ํจ์น ๋ฐ ์์
7. ๋ฉ ํ๊ฒฝ
8. ์ฐธ๊ณ ์๋ฃ
* * *
## 1\. ์์ฝ
**CVE-2026-31431** ์ **"Copy Fail"**์ด๋ผ๋ ๋ณ์นญ์ผ๋ก ๋ถ๋ฆฌ๋, Linux ์ปค๋์ ์ํธํ ํ์ ์์คํ
์์ ๋ฐ์ํ๋ ๋์ ์ฌ๊ฐ๋์ ๋ก์ปฌ ๊ถํ ์์น(LPE) ์ทจ์ฝ์ ์
๋๋ค. ๋ฎ์ ๊ถํ์ ๋ก์ปฌ ์ฌ์ฉ์๋ ํจ์น๋์ง ์์ ๋ชจ๋ ์์คํ
์์ **์ ์ด ๋ด์ root๋ก ๊ถํ์ ์์น** ํ ์ ์์ต๋๋ค.
์์ฑ| ๊ฐ
---|---
CVE| CVE-2026-31431
๋ณ์นญ| Copy Fail
CVSS v3.1| **7.8 HIGH**
๊ณต๊ฒฉ ๋ฒกํฐ| ๋ก์ปฌ
ํ์ํ ๊ถํ| ๋ฎ์
์ฌ์ฉ์ ์ํธ์์ฉ| ์์
๊ตฌ์ฑ ์์| `crypto/algif_aead.c` โ `authencesn` ํ
ํ๋ฆฟ
๋์
์์ | 2017๋
(์ปค๋ฐ `72548b093ee3`)
๊ณต๊ฐ ์์ | 2026๋
์ ๋ณต ๊ธฐ๊ฐ| ~9๋
CISA KEV| **์**
๊ณต๊ฐ PoC| **์** (732๋ฐ์ดํธ ๋
๋ฆฝํ Python ์คํฌ๋ฆฝํธ)
### ๋น์ฆ๋์ค ์ํฅ
* ํจ์น๋์ง ์์ ๋ชจ๋ Linux ์๋ฒ, VM, ํด๋ผ์ฐ๋ ์ธ์คํด์ค ๋๋ ์ปจํ
์ด๋ ํธ์คํธ์์ **root ์ก์ธ์ค** ๊ฐ๋ฅ
* Kubernetes ํ๋์์ **์ปจํ
์ด๋ ํ์ถ** โ ํ์ด์ง ์บ์๋ ํธ์คํธ ์ปค๋๊ณผ ๊ณต์ ๋จ
* **๋์คํฌ ๋ด ํ์ ์ ๋ก** โ ์
์ฉ ์ ํ์ผ ๋ณ๊ฒฝ, ๋ํฐ ํ์ด์ง, ํ์ค ํ์ผ ๋ฌด๊ฒฐ์ฑ ๋๊ตฌ(Tripwire, AIDE)๋ฅผ ํตํ ๊ฐ์ฌ ์ถ์ ์ด ๋จ์ง ์์
* **Red Hat, Ubuntu, Debian, SUSE, Amazon Linux** ๋ฐ 2017๋
์ดํ ์ปค๋์ ์คํํ๋ ์ฌ์ค์ ๋ชจ๋ ์ฃผ์ ๋ฐฐํฌํ์ ์ํฅ
### ๊ถ์ฅ ์ฆ์ ์กฐ์น
1. **์์ ์ํ ์กฐ์น** (์ง๊ธ ๋ฐฐํฌ, ๋ชจ๋์ด ๋ก๋๋์ง ์์ ๊ฒฝ์ฐ ์ฌ๋ถํ
๋ถํ์): ```bash echo "install algif_aead /bin/false" | sudo tee /etc/modprobe.d/disable-algif-aead.conf sudo rmmod algif_aead 2>/dev/null || true
root@kitploit:~
2. **์๊ตฌ์ ํด๊ฒฐ์ฑ
** : ๋ฐฐํฌํ์ ํจํค์ง ๊ด๋ฆฌ์๋ฅผ ํตํด ์ปค๋ ํจํค์ง๋ฅผ ์
๋ฐ์ดํธํ๊ณ ์ฌ๋ถํ
ํฉ๋๋ค.
3. **๊ฒ์ฆ** : ์กฐ์น ์ ํ์ `detection/check_vulnerable.sh`๋ฅผ ์คํํฉ๋๋ค.
* * *
## 2\. ์ํ ํ๊ฐ
### CVSS 3.1 ๋ฒกํฐ ๋ฌธ์์ด```
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
root@kitploit:~
| Metric | Value | Rationale |
|--------|-------|-----------|
| Attack Vector | **Local** | ์
ธ ์ก์ธ์ค ํ์(SSH, ์ปจํ
์ด๋ exec, ๋ฌผ๋ฆฌ์ ์ก์ธ์ค) |
| Attack Complexity | **Low** | ์ ๋ขฐํ ์ ์๊ณ ์์ ์๋ํ โ ๊ฒฝ์ ์กฐ๊ฑด ๋ถํ์ |
| Privileges Required | **Low** | ๊ถํ ์๋ ์ผ๋ฐ ์ฌ์ฉ์ ๊ณ์ |
| User Interaction | **None** | ํผํด์ ์ํธ์์ฉ ๋ถํ์ |
| Confidentiality | **High** | ์ ์ฒด ์์คํ
์ฅ์
|
| Integrity | **High** | ์ ์ฒด ์์คํ
์ฅ์
|
| Availability | **High** | ์ ์ฒด ์์คํ
์ฅ์
|
### ์ํ ํ๊ฒฝ
| Factor | Assessment |
|--------|-----------|
| PoC Availability | ๊ณต๊ฐ, ๋ฌด๊ธฐํ๋จ, 732๋ฐ์ดํธ ๋
๋ฆฝํ Python |
| Exploit Reliability | ๋์ โ ์์ ์์ด ํ
์คํธ๋ ๋ฐฐํฌํ ์ ๋ฐ์์ ์๋ |
| Detection Difficulty | ๋์ โ ๋์คํฌ ์ฐ๊ธฐ ์์, ๋ํฐ ํ์ด์ง ์์ |
| Attacker Skill Required | ๋ฎ์ โ ๊ณต๊ฐ PoC๋ฅผ ์ฌ์ฉํ๋ ์คํฌ๋ฆฝํธ ํค๋ |
| CISA KEV | 2026๋
์ถ๊ฐ โ ์ ๊ทน์ ์ผ๋ก ๋ชจ๋ํฐ๋ง๋จ |
| Microsoft Defender | ํ๋ฐํ ์กฐ์ฌ ์ค์ผ๋ก ํ๋๊ทธ ์ง์ ๋จ |
### ์ํฅ๋ฐ๋ ํ๊ฒฝ
| Environment | Risk |
|-------------|------|
| ๋ฒ ์ด๋ฉํ Linux ์๋ฒ | Critical |
| Linux VM(ํด๋ผ์ฐ๋ ๋๋ ์จํ๋ ๋ฏธ์ค) | Critical |
| Kubernetes ๋
ธ๋ | Critical(์ปจํ
์ด๋ ํ์ถ๋ ๊ฐ๋ฅ) |
| Docker ํธ์คํธ | Critical |
| ๊ณต์ ํธ์คํ
/ ๋ฉํฐ ํ
๋ํธ | Critical |
| WSL2 / Windows์ Linux | ์ปค๋ ๋ฒ์ ๋ณ ํ๊ฐ |
---
## 3. ๊ธฐ์ ์ฌ์ธต ๋ถ์
### 3.1 ๋ฐฐ๊ฒฝ: AF_ALG ๋ฐ AEAD
Linux ์ปค๋์ **AF_ALG ์์ผ**(`AF_ALG = 38`)์ ํตํด ์ฌ์ฉ์ ๊ณต๊ฐ์ ์ํธํ ์์
์ ๋
ธ์ถํฉ๋๋ค. ์ด ์ธํฐํ์ด์ค(`algif_aead`)๋ ๊ถํ ์๋ ์ ํ๋ฆฌ์ผ์ด์
์ด ์ปค๋ ๋ชจ๋ ์ฝ๋ ์์ด ์ปค๋ ์ํธํ ํ๋์จ์ด ๊ฐ์๊ธฐ๋ฅผ ํธ์ถํ ์ ์๊ฒ ํฉ๋๋ค.
**AEAD**(์ฐ๊ด ๋ฐ์ดํฐ ์ธ์ฆ ์ํธํ) ์๊ณ ๋ฆฌ์ฆ์ธ AES-GCM ๋ฐ ChaCha20-Poly1305๋ TLS, ๋์คํฌ ์ํธํ, VPN ํ๋กํ ์ฝ์ ๋๋ฆฌ ์ฌ์ฉ๋ฉ๋๋ค. ์ทจ์ฝํ ํ
ํ๋ฆฟ์ `authencesn` โ IPsec์์ ์ผ๋ฐ์ ์ผ๋ก ์ฌ์ฉ๋๋ ํ์ฅ ์ํ์ค ๋ฒํธ(ESN) ์ง์๊ณผ ํจ๊ป `hmac(sha256)` + `cbc(aes)`๋ฅผ ์ฌ์ฉํ๋ AEAD ๊ตฌ์ฑ์
๋๋ค.
### 3.2 ๊ทผ๋ณธ ์์ธ
2017๋
, ์ปค๋ฐ `72548b093ee3`์ ์ฑ๋ฅ ์ต์ ํ๋ก `algif_aead`์ **์ ์๋ฆฌ AEAD ์์
**์ ๋์
ํ์ต๋๋ค โ ์ํธํ ์์ง์ด ๋์ผํ ๋ฒํผ๋ฅผ ์ฝ๊ณ ์ธ ์ ์๊ฒ ํ๋ ๊ฒ์
๋๋ค. ์ด๋ ๊ฒฐํจ์ด ์์์ต๋๋ค:```
The bug chain:
1. Caller binds AF_ALG socket to:
authencesn(hmac(sha256),cbc(aes))
2. Caller sends a decryption request via sendmsg() with specific flags
3. Caller uses splice() to feed PAGE CACHE PAGES from an open file
descriptor directly into the socket's scatterlist
4. The authencesn template, during ESN header processing, uses the
OUTPUT BUFFER as scratch space โ writing 4 bytes past the
expected output boundary
5. Because the scatterlist contains page cache pages (not private
copies), this scratch write lands DIRECTLY IN THE PAGE CACHE
6. Page cache is shared kernel-wide โ all processes reading the
same file now see the modified bytes
Key insight: splice() is zero-copy โ it hands page cache references
to the socket. The in-place "optimization" then writes INTO those
pages. No dirty bit is set because the write goes through the crypto
engine, not the normal write path.
### 3.3 ์ฐ๊ธฐ ํ๋ฆฌ๋ฏธํฐ๋ธ
์ด ์ทจ์ฝ์ ์ ๊ณต๊ฒฉ์๊ฐ ์ฝ๊ธฐ์ฉ์ผ๋ก ์ด ์ ์๋ ๋ชจ๋ ํ์ผ์ **ํ์ด์ง ์บ์์ ๋ํ ์ ์ด๋ 4๋ฐ์ดํธ ์ฐ๊ธฐ** ๋ฅผ ์ ๊ณตํฉ๋๋ค:
์ฐ๊ธฐ๋ ๋ฐ๋ณต ๊ฐ๋ฅํฉ๋๋ค โ ์ต์คํ๋ก์์ ๋ ํฐ ์ฝ๋ ์ํ์ค๋ฅผ ํจ์นํ๊ธฐ ์ํด 4๋ฐ์ดํธ ์ฐ๊ธฐ๋ฅผ ๋ฐ๋ณตํฉ๋๋ค.
### 3.4 ์ต์คํ๋ก์ ์ฒด์ธ```
[1] Open /usr/bin/su (or any setuid-root binary) for reading โ [2] Map a copy to find target instruction bytes (e.g., UID check, execve path, security gate) โ [3] Compute exact page cache offset of target bytes โ [4] Set up AF_ALG socket โ authencesn(hmac(sha256),cbc(aes)) โ [5] splice() the target binary's page cache into the socket โ [6] Trigger decryption โ authencesn scratch write patches the target bytes in page cache (4 bytes per iteration) โ [7] Repeat for each 4-byte patch needed โ [8] Execute /usr/bin/su โ runs root-owned setuid binary but now with attacker-controlled code in page cache โ [9] Root shell
root@kitploit:~
### 3.5 ํ์ค ๋ฐฉ์ด ์ฒด๊ณ๊ฐ ๋ฌด๋ ฅํ๋๋ ์ด์
| ๋ฐฉ์ด ์ฒด๊ณ | ์ฐํ ๊ฐ๋ฅ? | ์ด์ |
|---------|-----------|--------|
| ํ์ผ ๋ฌด๊ฒฐ์ฑ ๋ชจ๋ํฐ๋ง (Tripwire/AIDE) | **์** | ๋์คํฌ์ ๋ณ๊ฒฝ ์์ |
| IDS ํ์ผ ํด์ ๊ฒ์ฌ | **์** | ๋์คํฌ ๋ฐ์ดํธ ๋ถ๋ณ |
| `inotify` ํ์ผ ๊ฐ์ | **์** | VFS ์ฐ๊ธฐ ์ด๋ฒคํธ ์์ |
| SELinux / AppArmor | **๋ถ๋ถ์ ** | ํ๋ก์ธ์ค๋ฅผ ์ ์ดํ์ง๋ง ์ํธํ ์์ง์ ํตํ ํ์ด์ง ์บ์ ์ฐ๊ธฐ๋ ์ ์ดํ์ง ๋ชปํจ |
| ์ฝ๊ธฐ ์ ์ฉ ๋ง์ดํธ | **์** | ํ์ด์ง ์บ์๊ฐ ๋ง์ดํธ๊ฐ ์๋ ๋ฉ๋ชจ๋ฆฌ ๋ด์์ ์์ ๋จ |
| ๋ฐ์ด๋๋ฆฌ ๋์ `auditd` ๊ฐ์ | **์** | Audit์ VFS ์ฐ๊ธฐ๋ฅผ ๊ฐ์ โ ์ด ๊ธฐ๋ฒ์ VFS๋ฅผ ์ฐํํจ |
### 3.6 ์ํฅ๋ฐ๋ ์ปค๋ ๋ฒ์
| ๋ธ๋์น | ์ทจ์ฝํ ๋ฒ์ | ์์ ๋ ๋ฒ์ |
|--------|-------------------|------------|
| 4.14.x | ์ ์ฒด (์ทจ์ฝ์ ๊ธฐ์) | ์
์คํธ๋ฆผ ์์ ์์ (EOL) |
| 5.4.x (LTS) | ์ ์ฒด | ๋ฐฐํฌํ ๋ฐฑํฌํธ ํ์ |
| 5.10.x (LTS) | ์ ์ฒด | ๋ฐฐํฌํ ๋ฐฑํฌํธ ํ์ |
| 5.15.x (LTS) | ์ ์ฒด | ๋ฐฐํฌํ ๋ฐฑํฌํธ ํ์ |
| 6.1.x (LTS) | โค 6.1.129 | **6.1.130+** |
| 6.6.x (LTS) | โค 6.6.86 | **6.6.87+** |
| 6.12.x (LTS) | โค 6.12.22 | **6.12.23+** |
| 6.15-rc | rc์์ ์์ ๋จ | **6.15-rc+** |
> ๋ฐฐํฌํ ์ปค๋์ ์๋ก ๋ค๋ฅธ ๋ฒ์ ๋ฒํธ๋ก ์์ ์ฌํญ์ ๋ฐฑํฌํธํ์ ์ ์์ต๋๋ค. ํญ์ ํด๋น ๋ฐฐํฌํ์ ๋ณด์ ๊ถ๊ณ ๋ฅผ ํ์ธํ์ธ์.
---
## 4. ๊ณต๊ฒฉ ๋ฐฉ๋ฒ๋ก โ ๋ ๋ ํ
> **๊ถํ ํ์.** ์ด ์น์
์ ๋ฐฉ์ด์๊ฐ ๊ณต๊ฒฉ์์ ๊ด์ ์ ์ดํดํ๋๋ก ๋๊ธฐ ์ํด ์กด์ฌํฉ๋๋ค. ์์ ํ ์์คํ
๋๋ ๋ช
์์ ์ธ ์๋ฉด ์น์ธ์ ๋ฐ์ ์์คํ
์์๋ง ์คํํ์ธ์.
### 4.1 ์ฌ์ ์๊ตฌ ์ฌํญ
- ๋์์์์ ๋ฎ์ ๊ถํ ์
ธ (SSH, ์ปจํ
์ด๋ exec, RCE ์ฒด์ธ)
- Python 3.10+ **๋๋** ์ปดํ์ผ๋ C ๋ฐ์ด๋๋ฆฌ
- `algif_aead`๋ฅผ ์ฌ์ฉํ ์ ์๋ ํจ์น๋์ง ์์ ์ปค๋
### 4.2 ์ ์ฐฐ```bash
# Check if vulnerable
uname -r
cat /proc/crypto | grep -A10 "authencesn"
lsmod | grep algif_aead
# Verify setuid target exists
ls -la /usr/bin/su /usr/bin/sudo /usr/bin/passwd
### 4.3 ๊ณต๊ฐ PoC
์๋ ์ฐ๊ตฌ์๋ค(Theori)์ ์์ ํ ์๋ํ๋ 732๋ฐ์ดํธ ๋
๋ฆฝํ Python PoC๋ฅผ ๊ณต๊ฐํ์ต๋๋ค:
* **์ ์ฅ์** : https://github.com/theori-io/copy-fail-CVE-2026-31431
* **์น์ฌ์ดํธ** : https://copy.fail
* **ํ์ผ** : `copy_fail_exp.py````bash
# Default: targets /usr/bin/su
python3 copy_fail_exp.py
# Custom target
python3 copy_fail_exp.py /usr/bin/passwd
root@kitploit:~
๋ก์ปฌ ๋ณต์ฌ๋ณธ์ `exploit/poc.py`์์ ํ์ธํ ์ ์์ต๋๋ค. ๊ธฐ์ ์ ๋ถ์์ `exploit/README.md`๋ฅผ ์ฐธ์กฐํ์ธ์.
### 4.4 ์ปจํ
์ด๋ ํ์ถ ์๋๋ฆฌ์ค
Linux ํ์ด์ง ์บ์๋ ๋์ผํ ํธ์คํธ์ ๋ชจ๋ ํ๋ก์ธ์ค(ํธ์คํธ์ ์ปจํ
์ด๋ ํฌํจ) ๊ฐ์ ๊ณต์ ๋๋ฏ๋ก:```
Attacker in container โ patches /usr/bin/su in HOST page cache
Host user runs su โ executes attacker code as root on host
This works even from non-privileged containers, as long as the host kernel is vulnerable.
### 4.5 MITRE ATT&CK ๋งคํ
* * *
## 5\. ํ์ง ๋ฐ ์ฌ๊ณ ๋์ โ ๋ธ๋ฃจ ํ
> **์ด ์ ์ฅ์์ ์ฃผ์ ์ด์ ์
๋๋ค.**
### 5.1 ์ทจ์ฝ์ ํ์ง
ํ์ง ์คํฌ๋ฆฝํธ๋ฅผ ๋ชจ๋ Linux ์์คํ
์์ ์คํํ์ธ์:```bash chmod +x detection/check_vulnerable.sh sudo ./detection/check_vulnerable.sh
root@kitploit:~
**๊ฒ์ฌ ํญ๋ชฉ:**
- ์๋ ค์ง ์ทจ์ฝ ๋ฒ์ ๋ฒ์์ ๋ํ ์ปค๋ ๋ฒ์
- `algif_aead` ๋ชจ๋ ๋ก๋ ์ํ ๋ฐ ๋ธ๋๋ฆฌ์คํธ ์ํ
- `/proc/crypto`์์ `authencesn` ์ฌ์ฉ ๊ฐ๋ฅ ์ฌ๋ถ
- setuid ๋ฐ์ด๋๋ฆฌ์ ํ์ด์ง ์บ์ ๋ฌด๊ฒฐ์ฑ (root ๊ถํ ํ์)
- ๋ฐฐํฌํ๋ณ ํจ์น ์ํ
- ํ์ฑ ์ต์คํ๋ก์ ์งํ์ ๋ํ ์คํ ์ค์ธ ํ๋ก์ธ์ค
ํ์์คํฌํ๊ฐ ํฌํจ๋ ๋ณด๊ณ ์๋ `/tmp/cve-2026-31431-report-*.txt`์ ์ ์ฅ๋ฉ๋๋ค.
### 5.2 YARA ํ์ง
`detection/yara/`์ ๋ ๊ฐ์ YARA ๊ท์น์ด ์ ๊ณต๋ฉ๋๋ค:
| ๊ท์น ํ์ผ | ์ฉ๋ |
|-----------|---------|
| `cve_2026_31431_base.yar` | ์๋ ค์ง ๊ณต๊ฐ PoC์ ์ ํํ ์ผ์น |
| `cve_2026_31431_enhanced.yar` | ๋๋
ํ, ์ปดํ์ผ ๋ฐ ๋ณํ ์ต์คํ๋ก์ ํ์ง |```bash
# Install YARA
apt-get install yara # Debian/Ubuntu
dnf install yara # RHEL/Fedora
apk add yara # Alpine
# Scan running process executables
sudo yara -r detection/yara/cve_2026_31431_enhanced.yar /proc/*/exe 2>/dev/null
# Scan common dropper locations
sudo yara -r detection/yara/cve_2026_31431_enhanced.yar /home /tmp /var/tmp /dev/shm
# Scan uploaded files / quarantine
yara detection/yara/cve_2026_31431_base.yar <suspect_file>
**๊ฐํ๋ ๊ท์น์ด ์ค์ํ ์ด์ ** : ๊ณต๊ฒฉ์๋ ๊ณต๊ฐ๋ Python PoC๋ฅผ ๋๋
ํํ ์ ์์ต๋๋ค(base64 ์ธ์ฝ๋ฉ ๋ฌธ์์ด, XOR ์ธ์ฝ๋ฉ ์๊ณ ๋ฆฌ์ฆ ์ด๋ฆ, C ๋ฐ์ด๋๋ฆฌ๋ก ์ปดํ์ผ, ์ฌ๋ณผ ์ ๊ฑฐ). ๊ฐํ๋ ๊ท์น์ ์ต์คํ๋ก์์ ๊นจ๋จ๋ฆฌ์ง ์๊ณ ๋ ์ ๊ฑฐํ ์ ์๋ ๋ถ๋ณ ์์๋ฅผ ๋์์ผ๋ก ํ์ฌ ์ด๋ฌํ ๋ณํ์ ํ์งํฉ๋๋ค:
* ์ปค๋์ ๋ฐ๋์ ์๊ณ ๋ฆฌ์ฆ ์ด๋ฆ์ผ๋ก `authesn`์ ์์ ํด์ผ ํฉ๋๋ค
* ์ต์คํ๋ก์์ ๋ฐ๋์ `splice()`๋ฅผ ์ฌ์ฉํ์ฌ ์ ๋ก์นดํผ ํ์ด์ง ์บ์ ์ ๊ทผ์ ๋ฌ์ฑํด์ผ ํฉ๋๋ค
* ์ต์คํ๋ก์์ ๋ฐ๋์ AF_ALG ์์ผ(ํจ๋ฐ๋ฆฌ `38`)์ ์์ฑํด์ผ ํฉ๋๋ค
### 5.3 Auditd ๊ท์น
`/etc/audit/rules.d/cve-2026-31431.rules`์ ๋ฐฐํฌํฉ๋๋ค:```bash
# Detect AF_ALG socket creation (family 38 = 0x26)
-a always,exit -F arch=b64 -S socket -F a0=38 -k cve_2026_31431_afalg
# Detect splice() calls โ used to feed page cache into the socket
-a always,exit -F arch=b64 -S splice -k cve_2026_31431_splice
# Monitor algif_aead module loading
-a always,exit -F arch=b64 -S init_module -S finit_module -k cve_2026_31431_modload
# Detect setuid binary execution by non-root users
-a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -k cve_2026_31431_suid_exec
root@kitploit:~
Reload:```bash
augenrules --load && service auditd restart
์ฟผ๋ฆฌ ๊ธฐ๋ฐ ๊ณต๊ฒฉ ์๋ ํ์:```bash
# Look for AF_ALG socket creation
ausearch -k cve_2026_31431_afalg --start today
# Correlate: same PID doing AF_ALG socket + splice
ausearch -k cve_2026_31431_afalg -k cve_2026_31431_splice --start today
root@kitploit:~
### 5.4 Falco / eBPF ํ์ง
`/etc/falco/rules.d/cve-2026-31431.yaml`์ ์ถ๊ฐ:```yaml
- rule: CVE-2026-31431 AF_ALG Socket Creation
desc: Detects unprivileged process creating AF_ALG socket (family 38) โ required step for Copy Fail exploit
condition: >
syscall.type = socket and
evt.arg.domain = 38 and
not user.uid = 0 and
not proc.name in (known_crypto_daemons)
output: >
CVE-2026-31431 exploitation attempt - AF_ALG socket (user=%user.name
uid=%user.uid pid=%proc.pid cmd=%proc.cmdline)
priority: CRITICAL
tags: [cve-2026-31431, lpe, kernel, crypto]
- list: known_crypto_daemons
items: [strongswan, charon, pluto, openssl]
- rule: CVE-2026-31431 Splice After AF_ALG
desc: Detects splice() syscall shortly after AF_ALG socket creation โ exploitation sequence
condition: >
syscall.type = splice and
not user.uid = 0 and
evt.elapsed < 5000000000
output: >
CVE-2026-31431 splice after AF_ALG socket (user=%user.name pid=%proc.pid)
priority: CRITICAL
tags: [cve-2026-31431, lpe]
### 5.5 ํ์ด์ง ์บ์ ๋ฌด๊ฒฐ์ฑ ๊ฒ์ฌ
์ต์คํ๋ก์์ด **๋์คํฌ์ ์ฐ์ง ์๊ณ ** ํ์ด์ง ์บ์๋ฅผ ์์ ํ๋ฏ๋ก, ํ์ค FIM ๋๊ตฌ๋ ์ด๋ฅผ ๊ฐ์งํ์ง ๋ชปํฉ๋๋ค. ์ด ๊ฒ์ฌ๋ ํ์ฑ ์ต์คํ๋ก์์ ํ์งํฉ๋๋ค:```bash #!/bin/bash
# Compare in-memory binary against on-disk binary
SETUID_BINS=("/usr/bin/su" "/usr/bin/sudo" "/usr/bin/passwd")
for binary in "${SETUID_BINS[@]}"; do [[ -f "$binary" ]] || continue LIVE_HASH=$(sha256sum "$binary" | awk '{print $1}') echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null # flush page cache DISK_HASH=$(sha256sum "$binary" | awk '{print $1}') if [[ "$LIVE_HASH" != "$DISK_HASH" ]]; then echo "CRITICAL: Page cache tampering detected on $binary" echo " Pre-flush: $LIVE_HASH" echo " Post-flush: $DISK_HASH" else echo "OK: $binary page cache matches disk" fi done
root@kitploit:~
**์ด์ ์ฐธ๊ณ ์ฌํญ:** `drop_caches`๋ ์ฑ๋ฅ ์ ํ๋ฅผ ์ ๋ฐํฉ๋๋ค. ์ ์ง๋ณด์ ์๊ฐ๋์ ์คํํ๊ฑฐ๋ ์ค์ํ์ง ์์ ์์คํ
์์ ๋จผ์ ์คํํ์ธ์.
### 5.6 ์นจํด ์งํ(IoC)
| IoC ์ ํ | ์งํ | ์ ๋ขฐ๋ |
|----------|-----------|-----------|
| ๋ฌธ์์ด(๋ฐ์ด๋๋ฆฌ/์คํฌ๋ฆฝํธ) | `authencesn(hmac(sha256),cbc(aes))` | ๋์ |
| 16์ง์ ๋ฐ์ดํธ | `78 DA AB 77 F5 71 63 62 64 64` (zlib ํ์ด๋ก๋ ํค๋) | ๋์ |
| ์์คํ
์ฝ ์ํ์ค | `socket(38,5,0)` โ `bind()` โ `splice()` | ๋์ |
| ๋คํธ์ํฌ | ์์ โ ์์ ๋ก์ปฌ ์ ์ฉ | ํด๋น ์์ |
| ํ์ผ | ๋์คํฌ ์ฐ๊ธฐ ์์(์๋) | โ |
| ํ๋ก์ธ์ค | AF_ALG ์์ผ์ ๊ฐ์ง ์๋ช
์ด ์งง์ Python/C ํ๋ก์ธ์ค | ์ค๊ฐ |
| ํ์ด์ง ์บ์ | setuid ๋ฐ์ด๋๋ฆฌ ํ์ด์ง ์บ์ โ ๋์คํฌ ํด์ | ์ฌ๊ฐ |
### 5.7 SIEM ํ์ง ์ฟผ๋ฆฌ
**Splunk(auditd ์์ค):**```spl
index=linux_audit sourcetype=auditd action=SYSCALL syscall=socket a0="0x26"
| join pid [
search index=linux_audit sourcetype=auditd action=SYSCALL syscall=splice
]
| where (_time - join_time) < 30
| table _time host user pid cmd a0
| eval severity="CRITICAL"
**Elastic KQL:** ```kql event.action: "SYSCALL" AND process.args: "socket" AND auditd.data.a0: "0x26" AND NOT user.id: "0"
root@kitploit:~
**Microsoft Sentinel (KQL):**```kql
Syslog
| where Facility == "kern" or ProcessName == "audit"
| where SyslogMessage contains "socket" and SyslogMessage contains "a0=0x26"
| extend UserName = extract("uid=([0-9]+)", 1, SyslogMessage)
| where UserName != "0"
| project TimeGenerated, Computer, UserName, SyslogMessage
| order by TimeGenerated desc
* * *
## 6\. ํจ์น ๋ฐ ์์
์๋ ํจ์น ์คํฌ๋ฆฝํธ๋ฅผ ์คํํฉ๋๋ค:```bash chmod +x patch/patch.sh sudo ./patch/patch.sh
root@kitploit:~
### 6.1 ์ฆ์ ์ํ ์กฐ์น (์ฌ๋ถํ
๋ถํ์*)```bash
# Blacklist the module permanently
echo "install algif_aead /bin/false" | sudo tee /etc/modprobe.d/disable-algif-aead.conf
echo "install authencesn /bin/false" | sudo tee -a /etc/modprobe.d/disable-algif-aead.conf
# Unload if currently loaded
sudo rmmod algif_aead 2>/dev/null || echo "Not loaded โ mitigation active after config"
# Verify
lsmod | grep algif_aead && echo "WARNING: still loaded โ reboot needed" || echo "OK: not loaded"
*`algif_aead`๊ฐ ์ด๋ฏธ ๋ก๋๋ ๊ฒฝ์ฐ, ๋ธ๋๋ฆฌ์คํธ๊ฐ ์์ ํ ์ ์ฉ๋๋ ค๋ฉด ์ฌ๋ถํ
์ด ํ์ํฉ๋๋ค.
**๋ถ์์ฉ:** AF_ALG๋ฅผ ํตํด ์ปค๋ AEAD ์ธํฐํ์ด์ค๋ฅผ ์ฌ์ฉํ๋ ์ ํ๋ฆฌ์ผ์ด์
(๋๋ฌผ์ง๋ง, ๋๋ถ๋ถ OpenSSL ์ฌ์ฉ์ ๊ณต๊ฐ์ ์ฌ์ฉ)์ ์คํจํ ์ ์์ต๋๋ค. ํ์ค TLS, ๋์คํฌ ์ํธํ, VPN ๋๊ตฌ๋ ์ผ๋ฐ์ ์ผ๋ก ์ํฅ์ ๋ฐ์ง ์์ต๋๋ค.
### 6.2 ์๊ตฌ ์์ โ ์ปค๋ ์
๋ฐ์ดํธ
### 6.3 Kubernetes ํด๋ฌ์คํฐ```bash
# Check all node kernel versions
kubectl get nodes -o wide
# Drain โ update node kernel โ uncordon (one node at a time)
kubectl drain \--ignore-daemonsets --delete-emptydir-data
# SSH into node and run kernel update
kubectl uncordon
root@kitploit:~
๋
ธ๋ ์๋ ์
๊ทธ๋ ์ด๋(Karpenter, Managed Node Groups)๋ฅผ ์ฌ์ฉํ๊ฑฐ๋, ๊ฐ๋ฅํ ๊ฒฝ์ฐ ํด๋ฌ์คํฐ ๋
ธ๋ ํ ๋กํ
์ด์
์ ํ์ฉํ์ธ์.
### 6.4 ํจ์น ํ ๊ฒ์ฆ```bash
# Re-run detection script
sudo ./detection/check_vulnerable.sh
# Quick manual verification
uname -r # confirm new kernel version
lsmod | grep algif_aead # should be empty
cat /proc/crypto | grep authencesn # should return nothing (or still listed but module blacklisted)
* * *
## 7\. ์คํ ํ๊ฒฝ
ํ์ง ๋๊ตฌ๋ฅผ ์์ ํ๊ฒ ํ
์คํธํ๊ธฐ ์ํ ์ต์ํ์ Alpine Docker ์คํ ํ๊ฒฝ์ด ์ ๊ณต๋ฉ๋๋ค.```bash cd lab/ docker compose up -d docker exec -it cve-2026-31431-lab /bin/sh
# Inside container:
/cve-2026-31431/detection/check_vulnerable.sh
root@kitploit:~
> **์ค์:** Docker ์ปจํ
์ด๋๋ ํธ์คํธ ์ปค๋์ ๊ณต์ ํฉ๋๋ค. ์ด ์ค์ต์ **ํธ์คํธ ์ปค๋์** ์ทจ์ฝ์ ์ํ๋ฅผ ํ
์คํธํฉ๋๋ค. ์ทจ์ฝ์ ๊ฒฐ๊ณผ๋ ์ค์ ํธ์คํธ ์์คํ
์ ๋ฐ์ํฉ๋๋ค โ ์ด๋ ํ์ค์ ์ธ ํ๊ฐ๋ฅผ ์ํ ์๋๋ ๋์์
๋๋ค.
ํน์ ์ทจ์ฝํ ์ปค๋ ๋ฒ์ ์ผ๋ก ๊ฒฉ๋ฆฌ๋ ํ
์คํธ๋ฅผ ์ํํ๋ ค๋ฉด ์ปค๋์ ๊ณ ์ ํ ์ ์ฉ VM์ ์ฌ์ฉํ์ธ์. VM ์ค์ ์ง์นจ์ `lab/README.md`๋ฅผ ์ฐธ์กฐํ์ญ์์ค.
---
## 8. ์ฐธ๊ณ ์๋ฃ
| ๋ฆฌ์์ค | ๋งํฌ |
|----------|------|
| NVD ๊ถ๊ณ | https://nvd.nist.gov/vuln/detail/CVE-2026-31431 |
| ์๋ณธ ์ฐ๊ตฌ | https://copy.fail |
| ๊ธฐ์ ๋ถ์ ๋ฌธ์ | https://xint.io/blog/copy-fail-linux-distributions |
| ๊ณต๊ฐ PoC | https://github.com/theori-io/copy-fail-CVE-2026-31431 |
| CISA KEV ์นดํ๋ก๊ทธ | https://www.cisa.gov/known-exploited-vulnerabilities-catalog |
| ์ปค๋ ์์ โ ์ปค๋ฐ ๋๋๋ฆฌ๊ธฐ | `a664bf3d603d` / `fafe0fa2995a` |
| ์ทจ์ฝ ์ปค๋ฐ | `72548b093ee3` |
| Microsoft Defender ๊ถ๊ณ | Microsoft Defender ์ํ ์ธํ
๋ฆฌ์ ์ค ๋ธ๋ก๊ทธ |
---
## ์ ์ฅ์ ๊ตฌ์กฐ```
cve-2026-31431/
โโโ README.md โ This document
โโโ exploit/
โ โโโ README.md โ Technical exploit breakdown
โ โโโ poc.py โ Public PoC (theori-io, for reference)
โโโ detection/
โ โโโ README.md โ Detection guide
โ โโโ check_vulnerable.sh โ Vulnerability & IoC detection script
โ โโโ yara/
โ โโโ cve_2026_31431_base.yar โ Detects known public PoC
โ โโโ cve_2026_31431_enhanced.yar โ Detects obfuscated/compiled variants
โโโ patch/
โ โโโ README.md โ Remediation guide
โ โโโ patch.sh โ Automated patch/mitigation script
โโโ lab/
โโโ README.md โ Lab setup guide
โโโ Dockerfile โ Alpine-based lab container
โโโ docker-compose.yml โ Lab orchestration
* * *
_๋ณธ ์ฐ๊ตฌ๋ ๊ต์ก ๋ฐ ๋ฐฉ์ด์ ๋ณด์ ๋ชฉ์ ์ผ๋ก๋ง ์ ๊ณต๋ฉ๋๋ค. ๋ชจ๋ ๋๊ตฌ๋ ๋ฐฉ์ด์๊ฐ ๋ณดํธ ๊ถํ์ ๊ฐ์ง ์์คํ
์์ CVE-2026-31431์ ํ์งํ๊ณ ์์ ํ๋ ๋ฐ ๋์์ ์ฃผ๊ธฐ ์ํด ์ค๊ณ๋์์ต๋๋ค._
_์ ์ฅ์๋rippsec์ด(๊ฐ) ์ ์ง ๊ด๋ฆฌํฉ๋๋ค._