Security Advisory – HIGH

Linux Kernel Local Privilege Escalation – Copy Fail (CVE-2026-31431)

Thông tin Chi tiết

Mức độ nghiêm trọngHIGH — CVSS 3.1 = 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
Ngày phát hành2026-04-29 (public disclosure)
Ngày phát hiện2026-03-23 (báo cáo Linux kernel security team)
Ngày patch upstream2026-04-01
Nguồn gốc sự cốLogic flaw trong Linux kernel, module crypto/algif_aead, do tối ưu in-place AEAD merge từ 2017 (commit 72548b093ee3)
Phạm vi bị ảnh hưởngLinux kernel >= 4.14 (2017) đến trước commit a664bf3d603d (2026-04-01) — toàn bộ distro lớn
Tình trạng vendor (kernel fix & mitigation notice)Ubuntu 20.04 / 22.04 / 24.04 / 25.10: kmod mitigation notice đã phát hành; kernel fix package rollout theo USN (vd Ubuntu 22.04: linux-image >= 5.15.0-176-generic)       
RHEL 8 / 9 / Rocky / Alma: RHSA per stream — kiểm tra access.redhat.com/security/cve/cve-2026-31431       
Debian 11 / 12: DSA backport theo security tracker       
Amazon Linux 2 / 2023: ALAS per release       
CloudLinux: KernelCare đã release live-patch       
Self-built kernel: xem bảng upstream Section 3.1
Cách đọc nhanhChạy uname -r → so version với distro tương ứng. Nếu < mốc patched → VULNERABLE; nếu >= → AN TOÀN.
CVECVE-2026-31431 ("Copy Fail")
CWECWE-669 — Incorrect Resource Transfer Between Spheres
PoC publicCó — theori-io/copy-fail-CVE-2026-31431 (Python ~732 byte)
Trạng tháiĐÃ CÓ PATCH UPSTREAM — yêu cầu hành động ngay
Tham chiếu chínhhttps://nvd.nist.gov/vuln/detail/CVE-2026-31431

1. Tóm tắt sự cố

SOC ghi nhận lỗ hổng nghiêm trọng trong Linux kernel — tên gọi "Copy Fail" (CVE-2026-31431) — cho phép bất kỳ local user không đặc quyền nào leo thang lên root chỉ trong vài giây. Lỗi nằm tại module crypto/algif_aead, nơi tối ưu in-place AEAD operation từ 2017 cho phép user ghi đè vào page cache thuộc file root-owned thông qua AF_ALG socket.

YÊU CẦU XỬ LÝ NGAY

PoC đã public. Bất kỳ user có shell trên server vulnerable đều có thể đạt root trong vài giây. Tất cả host Linux (đặc biệt multi-tenant, K8s worker, bastion) phải apply mitigation hoặc upgrade kernel trong 24h.

Hai điểm nguy hiểm đặc biệt:

  • Container không bảo vệ được — bug ở kernel của host, không phải image. Patch image không có tác dụng.
  • lsmod trống KHÔNG có nghĩa an toàn — kernel autoload module qua MODULE_ALIAS khi user tạo AF_ALG socket. Detection chính xác phải dựa vào package version.

2. Cơ chế khai thác

Cuộc tấn công tận dụng cách kernel xử lý AEAD operation theo dạng in-place trên interface algif_aead:

  1. Abuse AEAD interface: Local user khai thác algif_aead AEAD interface được expose qua AF_ALG. Việc này không cần đặc quyền — bất kỳ user nào có shell đều làm được.
  2. Trigger autoload: Kernel tự load module algif_aead qua MODULE_ALIAS (không cần CAP_SYS_MODULE).
  3. Chain page-cache vào destination scatterlist: Trong một số flow AF_ALG / splice(), lỗi in-place optimization cho phép page-cache pages (thuộc file root-owned đang được kernel cache, vd /etc/shadow) bị đưa vào writable destination/output scatterlist.
  4. Trigger in-place AEAD: Khi kernel encrypt/decrypt, output bị ghi lên chính các page-cache pages này thay vì vào buffer riêng của user — sinh ra controlled write trực tiếp vào page cache của file root-owned.
  5. Leverage thành full root: Controlled write vào page cache của privileged file — đặc biệt là setuid binary — dẫn tới Local Privilege Escalation lên root.

Trích NVD: "There is no benefit in operating in-place in algif_aead since the source and destination come from different mappings. Get rid of all the complexity added for in-place operation and just copy the AD directly."

Patch fix: bỏ in-place optimization, đảm bảo destination/output scatterlist của AEAD operation không thể bị chain với các source pages (bao gồm page-cache pages) — quay lại xử lý out-of-place hoàn toàn. Commit fix: a664bf3d603d.

Khả năng của exploit:

  • Local Privilege Escalation từ user thường lên root
  • Reliable trên mọi distro lớn (Ubuntu, RHEL, Debian, Amazon Linux, CloudLinux)
  • PoC nhỏ (~732 byte Python) — dễ embed vào supply-chain attack hoặc bypass tooling
  • Không có user interaction, không có network exposure — pure local

3. Phạm vi ảnh hưởng

PHẠM VI RẤT RỘNG

Mọi Linux kernel merge commit 72548b093ee3 (2017) đến trước commit a664bf3d603d (2026-04-01). Tất cả distro lớn đều ảnh hưởng cho đến khi vendor backport patch.

Bạn có thể bị ảnh hưởng nếu:

  • Server chạy kernel Linux phiên bản cũ hơn ngày patch của distro
  • Có local user có thể tạo shell hoặc đạt code execution (web app RCE, supply-chain trên CI runner...)
  • K8s node chạy untrusted workload (multi-tenant cluster)
  • Container có quyền tạo AF_ALG socket (mặc định, không cần CAP đặc biệt)

3.1 Upstream kernel fixed versions

Cách dùng: chạy uname -r → lấy 2 số đầu (vd: 5.15.0-130-generic → series 5.15) → tìm row tương ứng → so version với cột "An toàn từ".

Series kernel bạn đang chạyVULNERABLE nếuAN TOÀN nếu
5.10.x< 5.10.254>= 5.10.254
5.15.x< 5.15.204>= 5.15.204
6.1.x< 6.1.170>= 6.1.170
6.6.x< 6.6.137>= 6.6.137
6.12.x< 6.12.85>= 6.12.85
6.18.x< 6.18.22>= 6.18.22
6.19.x< 6.19.12>= 6.19.12
7.0 (rc)rc1 → rc6rc7 trở lên
Series khác (4.14 → 6.18 không LTS)bất kỳ version nào trong seriesphải upgrade sang LTS đã patch ở trên

Ví dụ nhanh: uname -r ra 5.15.0-130-generic → series 5.15 → cần >= 5.15.204 → VULNERABLE (cần patch).

Lưu ý: Distro (Ubuntu / RHEL...) có ABI numbering riêng (vd Ubuntu 5.15.0-176-generic), không trùng với upstream version. Bảng "Phiên bản đã vá theo distro" ở đầu file là tham chiếu chuẩn cho distro; bảng này dùng cho self-built kernel hoặc cross-check.

4. Dấu hiệu phát hiện

4.1 Module / runtime indicators

LoạiChi tiết
Module namealgif_aead (cùng họ: algif_skcipher, algif_hash, algif_rng)
Module triggerTạo AF_ALG socket (autoload qua MODULE_ALIAS)
Capability cần để exploitKHÔNG có yêu cầu (user thường đủ)

4.2 Process / behavioral indicators (post-exploit hunting)

LoạiChi tiết
Suspicious syscall patternsocket(AF_ALG, SOCK_SEQPACKET, 0) từ non-crypto process
File integrityThay đổi bất thường ở /etc/passwd, /etc/shadow, /etc/sudoers không qua user-space syscall thông thường
Audit logauditd log có process non-root tạo AF_ALG socket sau đó privilege escalate

4.3 Reference & PoC

LoạiChi tiết
NVD entryhttps://nvd.nist.gov/vuln/detail/CVE-2026-31431
Ubuntu CVEhttps://ubuntu.com/security/CVE-2026-31431
Red Hat advisoryhttps://access.redhat.com/security/cve/cve-2026-31431
Public PoChttps://github.com/theori-io/copy-fail-CVE-2026-31431
Technical writeupwebsec.net writeup

5. Hướng dẫn kiểm tra

uname -r

So kết quả với bảng "Tình trạng vendor" ở đầu file (USN / DSA / RHSA / ALAS) hoặc bảng 3.1 (self-built kernel). Nếu version thấp hơn mốc patched của vendor → VULNERABLE.

Lưu ý: Trên distro mainstream (Ubuntu / RHEL / Debian / Amazon Linux), uname -r trả về ABI version do vendor đánh dấu (vd 5.15.0-176-generic) — đây chính là chuỗi advisory dùng để công bố fixed version, nên check như vậy là đủ. Chỉ cần soi sâu hơn (dpkg -l / rpm -q --changelog / dnf updateinfo info CVE-2026-31431) khi nghi ngờ ABI numbering bị custom hoặc kernel built từ source.

6. Hướng xử lý bắt buộc

6.1 Mitigation tức thời (không reboot, < 1 phút)

Block module autoload — đây là hàng rào tạm trong khi chờ upgrade kernel:

sudo tee /etc/modprobe.d/disable-algif-aead.conf <<'EOF'
    install algif_aead /bin/false
    EOF
    
# Rebuild initramfs để mitigation áp dụng từ early-boot sudo update-initramfs -u # Debian / Ubuntu sudo dracut -f # RHEL / Fedora / Rocky / Alma
# Unload nếu đang load sudo modprobe -r algif_aead 2>/dev/null || true
# Verify lsmod | grep algif_aead # phải trống sudo modprobe algif_aead 2>&1 # phải báo "install /bin/false ... failed"

Caveat: Mitigation chỉ chặn algif_aead — đường khai thác trực tiếp của CVE này (theo guidance công khai từ Ubuntu/Sysdig/Tenable). Workload dùng AF_ALG cipher AEAD (vài crypto userspace tool, một số IPSec stack) sẽ break sau mitigation. Test trên 1 host stage trước; sau apply check journalctl | grep -i alg để soi error.

6.1.a Alternative: initcall_blacklist qua GRUB (nếu module built-in)

Nếu kernel build algif_aead built-in (CONFIG_CRYPTO_USER_API_AEAD=y) thay vì module — modprobe.d không có tác dụng. Dùng GRUB để chặn ở init time:

# Mở /etc/default/grub, thêm "initcall_blacklist=algif_aead_init" vào
    # GRUB_CMDLINE_LINUX. Hoặc dùng sed:
    sudo sed -i 's|GRUB_CMDLINE_LINUX="\(.*\)"|GRUB_CMDLINE_LINUX="\1 initcall_blacklist=algif_aead_init"|' /etc/default/grub
    
# Apply sudo update-grub # Debian / Ubuntu sudo grub2-mkconfig -o /boot/grub2/grub.cfg # RHEL / Rocky / Alma sudo reboot
# Verify sau reboot dmesg | grep -i "blacklisting initcall"

6.2 Upgrade kernel (yêu cầu reboot)

# Ubuntu / Debian
    sudo apt update
    sudo apt install --only-upgrade linux-image-generic linux-headers-generic linux-image-virtual
    sudo reboot
    
# RHEL / CentOS / Rocky / Alma sudo dnf update kernel sudo reboot
# Amazon Linux 2 sudo yum update kernel && sudo reboot
# Amazon Linux 2023 sudo dnf update kernel && sudo reboot

6.3 Container / K8s rolling upgrade

Container không patch được trong image — phải patch host kernel + reboot từng node:

# Lấy hostname (không có prefix "node/")
    NODES=$(kubectl get nodes -o jsonpath='{.items[*].metadata.name}')
    
for node in $NODES; do echo "=== $node ===" kubectl drain "$node" \ --ignore-daemonsets \ --delete-emptydir-data \ --force
ssh "$node" ' sudo apt update sudo apt install -y --only-upgrade \ linux-image-generic \ linux-headers-generic \ linux-image-virtual sudo reboot '
# Đợi node về Ready until kubectl get node "$node" 2>/dev/null | grep -q ' Ready '; do sleep 10 done kubectl uncordon "$node" done

6.3.a Mitigation nhanh qua DaemonSet (chặn module — không reboot)

Khi chưa kịp lên lịch rolling reboot, dùng DaemonSet để áp Section 6.1 đồng loạt mọi node trong vài giây. Đây là chữa cháy, KHÔNG thay thế upgrade kernel — vẫn phải làm Section 6.3 trong SLA P0/P1.

apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: cve-2026-31431-mitigation
      namespace: kube-system
    spec:
      selector:
        matchLabels: { app: cve-2026-31431-mitigation }
      template:
        metadata:
          labels: { app: cve-2026-31431-mitigation }
        spec:
          hostPID: true
          tolerations:
            - operator: Exists
          containers:
            - name: mitigate
              image: debian:12-slim          # cần update-initramfs/modprobe → KHÔNG dùng busybox
              command: ["/bin/sh", "-c"]
              args:
                - |
                  set -eu
                  chroot /host /bin/sh -c '
                    cat > /etc/modprobe.d/disable-algif-aead.conf <<EOF
                  install algif_aead /bin/false
                  EOF
                    update-initramfs -u
                    modprobe -r algif_aead 2>/dev/null || true
                    # verify
                    lsmod | grep algif_aead && exit 1
                    modprobe algif_aead 2>&1 | grep -q "install /bin/false" || exit 1
                    echo "[OK] $(hostname) mitigated"
                  '
                  sleep infinity
              securityContext:
                privileged: true
                runAsUser: 0
              volumeMounts:
                - { name: host-root, mountPath: /host }
          volumes:
            - { name: host-root, hostPath: { path: / } }

Verify mọi node đã chặn:

kubectl logs -n kube-system -l app=cve-2026-31431-mitigation --tail=1 --prefix
    # Mỗi node phải in: [OK] <hostname> mitigated

Lưu ý các pitfall thường gặp:

  • ❌ image: busybox — không có update-initramfs, bash → mitigation không persist qua reboot.
  • ❌ Quên chroot /host — script chạy trong filesystem của container chứ không phải host.
  • ❌ Quên sleep infinity — pod restart liên tục, log khó đọc.
  • ❌ Block thừa các module khác họ algif_* — không cần thiết cho CVE này, có thể break workload IPSec/AF_ALG hợp lệ.

6.4 Post-fix verification

uname -r                                       # >= 5.15.0-176-generic (Ubuntu 22.04)
    dpkg -l linux-image-$(uname -r) | tail -1      # Debian/Ubuntu
    rpm -q kernel                                  # RHEL family
    lsmod | grep algif_aead                        # vẫn trống nếu giữ mitigation

7. Khuyến nghị dài hạn (Defense-in-depth)

7.1 Least-privilege & access control

  • Least-privilege shell access — chỉ user vận hành mới có shell thật. App account / service account dùng /sbin/nologin hoặc /bin/false. Audit /etc/passwd định kỳ (getent passwd | awk -F: '$7 ~ /(bash|sh|zsh)$/ {print $1}') để soi user shell ngoài expected list.
  • Hardened bastion / SSH — SSH lên prod chỉ qua bastion + MFA, không cho direct SSH từ Internet. Disable password auth, enforce key-based + per-user audit trail.
  • Network segmentation — server production chỉ cho phép truy cập từ bastion / jump host hoặc qua VPN. Block ingress từ Internet trên SSH port.
  • Sudo policy chặt — không cấp NOPASSWD rộng, không cấp ALL=(ALL) mà whitelist command cụ thể; log mọi sudo invocation qua auditd.

8. Liên hệ hỗ trợ

Nếu team nào đang vận hành Linux server và nghi ngờ bị ảnh hưởng, hoặc cần hỗ trợ trong quá trình kiểm tra / mitigation / upgrade, vui lòng liên hệ SOC để được hỗ trợ xử lý.

Liên hệ nội bộ: SOC Team

Tham chiếu chính

MỨC ĐỘ ƯU TIÊN: HIGH – PoC PUBLIC – XỬ LÝ NGAY