Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
PATCH-CVE-2026-31431-Ubuntu_Debian — Permanent mitigation scripts for CVE-2026-31431 (Copy Fail) on Ubuntu 24.04, blacklisting the vulnerable algif_aead kernel module and updating initramfs to persist across reboots. | Kitploit
Tools/GitHubGitHub/sunl0w/patch-cve-2026-31431-ubuntu_debian
Defensive ToolsVulnerability AnalysisConfiguration Auditing
GitHubsunl0w/patch-cve-2026-31431-ubuntu_debian

PATCH-CVE-2026-31431-Ubuntu_Debian

Permanent mitigation scripts for CVE-2026-31431 (Copy Fail) on Ubuntu 24.04, blacklisting the vulnerable algif_aead kernel module and updating initramfs to persist across reboots.

View Repository

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
13 months agoNot yet reviewed

🛡️ CVE-2026-31431 (Copy Fail) Mitigation - Linux Kernel

This repository contains scripts designed to neutralize the critical vulnerability CVE-2026-31431, nicknamed "Copy Fail", on Ubuntu systems.

[!IMPORTANT] Compatibility: These scripts are tailored for and tested on Ubuntu Server 24.04 LTS. While the logic is similar for other distributions, they have not been tested on Debian or other Linux flavors.


📋 Prerequisites & Installation

Before applying the patch, download the official detection script (developed by rootsecdev) to validate your system's current status :

root@kitploit:~
# Download the detection script
wget https://raw.githubusercontent.com/rootsecdev/cve_2026_31431/main/test_cve_2026_31431.py

# Ensure you have python3 installed
python3 --version

📝 Vulnerability Context

The CVE-2026-31431 vulnerability ($CVSS\ 7.8$) affects the Linux kernel's cryptographic subsystem (algif_aead module).

The Issue

A local user can corrupt the system's Page Cache by exploiting a flaw in the "in-place" optimization of the splice() function. This allows an attacker to force the kernel to write arbitrary data (sequence numbers) into memory pages of files that should be read-only (such as SUID binaries or sensitive system files).

Why a simple modprobe -r is not enough

The Linux kernel uses a mechanism called auto-loading. If a process or script (like the detector) requests a socket of type AF_ALG, the kernel automatically reloads the module even if it was manually removed. The method used in this patch ("Hard Block") physically prevents the module binary from being loaded by the kernel.


🚀 Usage

1. Verify Vulnerability

Run the tester to confirm if your current kernel is exposed :

root@kitploit:~
python3 test_cve_2026_31431.py

If the script displays [!] VULNERABLE, proceed to the next step.

2. Apply Mitigation

The patch-CVE-2026-31431.sh script neutralizes the attack vector permanently. It creates a configuration file in /etc/modprobe.d/ and updates the initramfs to ensure the block persists after a reboot.

root@kitploit:~
chmod +x patch-CVE-2026-31431.sh
sudo ./patch-CVE-2026-31431.sh

3. Post-Patch Verification

Run the detection script again. You should now see a message indicating that prerequisites are not met : [+] Precondition not met ('authencesn(...) cannot be instantiated).

This confirms the module is successfully neutralized.


🔄 Reverting (Post-Update)

Once Ubuntu releases an official fix via a kernel update (check apt upgrade notes for CVE-2026-31431), you should restore the native cryptographic capabilities :

root@kitploit:~
chmod +x unpatch-CVE-2026-31431.sh
sudo ./unpatch-CVE-2026-31431.sh

🛠️ Technical Details

The protection relies on the following directive within /etc/modprobe.d/cve-2026-31431-mitigation.conf :

root@kitploit:~
blacklist algif_aead
install algif_aead /bin/true

The install command redirects the kernel's attempt to load the module to /bin/true, which returns a "success" exit code without executing any vulnerable code.


Patch made by :

Developper SunL0w
Download Tool