Skip to content

Crihexe/copy-fail-tiny-elf-CVE-2026-31431

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy Fail Tiny ELF - CVE-2026-31431

Minimal 436-bytes exploit for Copy Fail, thanks to the power of golfing

Magic

This ELF ultra golfs the exploit by being totally unmapped, rwx, and by using itself conditionally as the ELF payload to use to poison the cache. More cursed ELF internals golfs coming soon

Have a better idea? Compete at https://copy.golf/

=== BEGIN SLOPPED PORTION ===

References

Requirements

  • Linux x86_64
  • gcc
  • ld
  • strip

On Debian/Ubuntu:

sudo apt install build-essential binutils

Nix Environment

The repository includes a pinned shell.nix and .envrc.

With nix-shell:

nix-shell

With direnv:

direnv allow

This provides the reproducible toolchain used here:

gcc 15.2.1
GNU ld / strip from llvmPackages_19.bintools
python3

Build

make

If you are using Nix or direnv, make will use the toolchain from the shell automatically.

Quick VM Test

You can also try the exploit inside a quick Ubuntu Server 24.04 LTS VM

cd test-vm
./quick-test.sh

Check size

make size

Clean

make clean

Tested toolchain

gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
GNU ld (GNU Binutils for Ubuntu) 2.42
GNU strip (GNU Binutils for Ubuntu) 2.42

Reproducible smaller build:

gcc 15.2.1
GNU ld 2.46
GNU strip with --strip-section-headers

Final size varies with GCC, binutils, and the strip implementation.