
Standalone C++/x86-64 assembly implementation of CVE-2026-31431 (Copyfail) for local privilege escalation. Compiles to a dependency-free binary that opens a root shell on vulnerable Linux systems. Includes an ASCII bootstrap script for transfer.
Cfail is my implementation in C++ x86-64 Assembly of CVE-2026-31431 (aka Copyfail), with no dependecy required at all, included libc. In fact, you obtain am universal executable able to run stand-alone on every Linux x86-64 distribution, thanks to a minimal implementation of the standard libs. That makes this program is 'copile once deploy everywhere' type, where for 'everywhere' is intended a random vulnerable Linux x86-64 distribution.
Running the program as unprivileged user on a vulnerable system, will open a root shell.
The makefile also create a "bootstrap" shell script called 'cfail.sh' able to create the binary executable, byte by byte, used the embedded data, so the program can be distributed as ASCII bash script too, in case it's required by the specific testing constrains.
This code has been posted for information and educational purposes. The intrusion in systems and services without the owner's authorisation is illegal. The misuse of the information and the software in this repo can result in criminal charges brought against the perpetrator of the crime. Any actions and or activities related to the material contained within this Git Repository is solely your responsibility. The author will not be held responsible in the event any criminal charges be brought against any individuals misusing the information or the software in this website to break the law.
A CVE-2026-31431 vulnerable system.
The program was successfully used with:
and compiled with:
make
./cfail
make compact
./cfail.sh > cfail