Páginas

segunda-feira, 4 de maio de 2026

The “Copy Fail” Vulnerability (CVE‑2026‑31431)

 




Protect SUSE Linux systems from CVE-2026-31431 (Copy Fail LPE) with detection commands, automation scripts, and temporary mitigations. Includes a Raspberry Pi lab for safe practice. Stay secure long after the patch lands.


SUSE released an important kernel update

 (SUSE‑SU‑2026:1676‑1) to fix CVE‑2026‑31431, a high‑severity local privilege escalation (LPE) flaw in the Linux kernel’s algif_aead cryptographic interface

The vulnerability, nicknamed “Copy Fail,” allows any unprivileged local user to gain root access by writing only four bytes to the page cache of any readable file. The flaw affects all major Linux distributions and has been present in the kernel since 2017.

Although the patch is now available, this guide provides reusable, evergreen advice that you can apply today and for years to come—no matter when you read this.


How to Check if You Are Vulnerable (SUSE Linux)


Run the following commands to determine whether your SUSE system is exposed to CVE‑2026‑31431.

Quick Kernel Version Check

bash
uname -r


The fixed kernel for openSUSE Leap 15.5 is 5.14.21‑150500.13.130.1 or later. If your version is older, you are vulnerable.

Verify the algif_aead Module Status

bash
lsmod | grep algif_aead
modinfo algif_aead



If the module is loaded or built into the kernel, the system remains vulnerable. The default SUSE kernel often includes algif_aead as a built‑in module, making the modprobe workaround ineffective.


Automated Checker Script (for any Linux distribution)


Use the cve‑2026‑31431‑check script to get a clear verdict without relying solely on version numbers:
bash
git clone https://github.com/ForensicFoundry/cve-2026-31431-check.git
cd cve-2026-31431-check
chmod +x cve-2026-31431-check
sudo ./cve-2026-31431-check


The script reports whether algif_aead is loaded, built in, or blacklisted and whether the system has rebooted after applying the latest kernel update.


Automation Script to Apply the Fix



Warning: Always test updates in a staging environment before deploying to production. The following script applies the official SUSE kernel patch, then reboots the system.

Save this script as apply-copy-fail-fix.sh and run it with root privileges:

bash
#!/bin/bash
# apply-copy-fail-fix.sh – Updates SUSE Linux kernel to fix CVE-2026-31431
# Compatible with: openSUSE Leap 15.5, SUSE Linux Enterprise Micro 5.5

set -e

echo "=== CVE-2026-31431 (Copy Fail) Fix for SUSE Linux ==="

# Ensure we are root
if [ "$EUID" -ne 0 ]; then
    echo "Error: Please run as root (sudo)."
    exit 1
fi

# Detect product and apply the correct patch command
if grep -q "openSUSE Leap 15.5" /etc/os-release; then
    echo "Detected: openSUSE Leap 15.5"
    zypper --non-interactive patch SUSE-2026-1676=1
elif grep -q "SUSE Linux Enterprise Micro 5.5" /etc/os-release; then
    echo "Detected: SUSE Linux Enterprise Micro 5.5"
    zypper --non-interactive patch SUSE-SLE-Micro-5.5-2026-1676=1
else
    echo "Warning: Unrecognized SUSE version. Attempting generic zypper patch."
    zypper --non-interactive patch
fi

echo "Kernel update installed. Rebooting in 10 seconds..."
sleep 10
reboot

After the reboot, re‑run the checker script from Section 1 to confirm that the vulnerability is gone.




Build Your Own Security Lab with a Raspberry Pi Kit


The best way to understand and test kernel vulnerabilities is to build a dedicated lab. A Raspberry Pi kit, provides an affordable, isolated environment where you can safely:

  • Test all mitigation methods without risking production systems
  • Practice kernel updates and rollbacks


                                                           CanaKit RaspberryPi


Buy on Amazon (advertising)  https://amzn.to/3OHBSEZ

This post contains affiliate links. We may earn a commission on qualifying purchases.


Alternative Mitigation (If You Can’t Update Now)



When a kernel update is not immediately possible, apply one of these temporary workarounds.

Option A: Blacklist the algif_aead Module (if algif_aead is a separate module)

bash
echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif_aead.conf
rmmod algif_aead 2>/dev/null || true


Check: Verify that the module is not loaded:

bash
lsmod | grep algif_aead

Important: On many SUSE systems algif_aead is built into the kernel, so this method will have no effect. Always verify with lsmod | grep algif_aead after running the commands.

Option B: Kernel Command‑Line Blacklist (Grubby) – Works for Built‑in Modules

If algif_aead is built in, the only reliable temporary fix is to blacklist its initialisation via the kernel command line:

bash
sudo grubby --update-kernel=ALL --args="initcall_blacklist=algif_aead_init"
sudo reboot


After reboot, confirm the parameter is active:

bash
sudo grubby --info=ALL | grep initcall_blacklist


To revert after installing the patched kernel:

bash
sudo grubby --update-kernel=ALL --remove-args="initcall_blacklist=algif_aead_init"
sudo reboot


Compatibility note: This blacklist does not affect dm‑crypt/LUKS, kTLS, IPsec, SSH, or standard OpenSSL/GnuTLS builds. Only applications that directly use AF_ALG for AEAD ciphers (e.g., OpenSSL with the afalg engine) are impacted.


Option C: Least Privilege via AppArmor / seccomp (for advanced users)
If you cannot modify the kernel command line, use mandatory access controls to block unprivileged creation of AF_ALG sockets. This is a fine‑grained approach, but do not enable AppArmor or SELinux from scratch just for this – they require careful tuning. Instead, adapt existing profiles or use seccomp filters to deny the socket call for untrusted processes.


Conclusion 



CVE‑2026‑31431 (Copy Fail) is a persistent, high‑risk local privilege escalation that affects almost every Linux system built since 2017. While the official patch exists, security is an ongoing process, not a one‑time event.

What you should do today:

 1. Check your SUSE systems with the commands in Section 1.

 2. Apply the official update using the automation script in Section 2.

 3. If immediate patching is impossible, deploy one of the temporary mitigations from Section 3.

 4. Set up a Raspberry Pi lab to practice these skills safely.

Bookmark this guide – it will remain accurate and useful for years, regardless of when the next kernel update drops.


Nenhum comentário:

Postar um comentário