Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-31431-live-code-corruption — CVE-2026-31431 (Copy Fail) novel exploit: live code corruption via page cache. Overwrites libc exit() code through MAP_PRIVATE page sharing — affects ALL running processes. | Kitploit
Tools/GitHubGitHub/ikow/cve-2026-31431-live-code-corruption
Privilege EscalationExploit FrameworksVulnerability AnalysisExploitationBinary Exploitation
GitHubikow/cve-2026-31431-live-code-corruption

CVE-2026-31431-live-code-corruption

CVE-2026-31431 (Copy Fail) novel exploit: live code corruption via page cache. Overwrites libc exit() code through MAP_PRIVATE page sharing — affects ALL running processes.

Share
View Repository
1416 months agoNot yet reviewed

CVE-2026-31431 — Live Code Corruption via Page Cache

A novel exploitation technique for CVE-2026-31431 ("Copy Fail") that corrupts executable code of running processes through the Linux kernel's page cache, achieving root privilege escalation.

What's Different

All published exploits for this CVE corrupt data files — modifying /etc/passwd to change root's UID, or patching setuid binaries on disk. This exploit does something fundamentally different: it corrupts live executable code in memory through the kernel's page cache mechanism.

Published exploitsThis exploit
TargetData files (/etc/passwd, /usr/bin/su)Executable code (libc .text section)
MechanismFile content parsed by programsCode pages directly executed by CPU
ScopeSingle fileALL processes mapping libc
Disk changeYes (file content modified)No (only page cache in memory)
DetectionFile integrity monitoringInvisible to filesystem checks

How It Works

The Page Cache Insight

When Linux maps a shared library with MAP_PRIVATE, it doesn't immediately copy the file pages. Instead, the process's page table entries point directly to the page cache physical pages. The copy only happens on write (copy-on-write). For code pages (.text), processes never write to them — so they remain shared with page cache forever.

Process A (bash)     Process B (su)      Page Cache (libc)
  ┌──────┐            ┌──────┐            ┌──────────┐
  │ PTE  │───────────>│      │            │ exit():  │
  │      │            │ PTE  │───────────>│ endbr64  │
  └──────┘            └──────┘            │ push rax │
    MAP_PRIVATE         MAP_PRIVATE       │ ...      │
    (clean page)        (clean page)      └──────────┘
                                               ↑
                                    Copy Fail writes here!

CVE-2026-31431 gives us a controlled 4-byte write to any readable file's page cache. By corrupting libc's code pages, we modify the instructions that every process executes.

The Exploit

  1. Write shellcode (39 bytes) to the on_exit() function location in libc's page cache — 10 writes of 4 bytes each
  2. Patch exit() to jump to our shellcode — 1 write of 4 bytes
  3. Trigger: any program that calls exit() (virtually every program) executes our shellcode

The shellcode performs setuid(0) → setgid(0) → execve("/bin/sh"), giving a root shell.

CVE-2026-31431 Overview

  • Bug: Logic error in crypto/algif_aead.c — the 2017 in-place optimization (72548b093ee3) allows splice() to feed page cache pages into AEAD decrypt. The authencesn algorithm's ESN rearrangement writes 4 scratch bytes back to the source scatterlist, corrupting the spliced file's page cache.
  • Primitive: Deterministic 4-byte write to any readable file's page cache
  • Requirements: None — AF_ALG sockets available to unprivileged users
  • Fix: Copy to out-of-place buffer before crypto operation (kernel 6.12.85+, 6.15+)

Usage

# Compile
gcc -o exploit exploit.c

# Run as unprivileged user
./exploit /lib/x86_64-linux-gnu/libc-2.31.so

# Trigger — run any program (it calls exit())
su -c id
# uid=0(root) gid=0(root) groups=0(root)

Tested On

  • Kernel: 6.12.79 (Ubuntu/Debian, before fix in 6.12.85)
  • glibc: 2.31-0ubuntu9.7
  • Result: Full root shell, verified by kernel log: process 'id' launched '/bin/sh'

Files

  • exploit.c — Full exploit with shellcode injection
  • copyfail_test.c — Primitive verification (tests 4-byte write)

Timeline

  • 2017: In-place optimization introduced (72548b093ee3)
  • 2026-04-29: CVE-2026-31431 disclosed
  • 2026-04-30: Fix released in kernel 6.12.85
  • 2026-05-06: This exploit developed (novel live code corruption technique)

References

  • NVD — CVE-2026-31431
  • Fix commit
  • Copy Fail analysis (Xint)

Disclaimer

This tool is provided for authorized security research and educational purposes only. Do not use against systems you do not own or have explicit permission to test.

Related: Dirty Frag (May 7, 2026)

Dirty Frag disclosed two more page-cache write variants in the same bug class:

  • ESP path (esp4/esp6): Same authencesn sink as Copy Fail, reached via IPsec ESP-in-UDP. Requires user namespaces. 4-byte write.
  • RxRPC path (rxrpc/rxkad): pcbc(fcrypt) in-place decrypt on splice-pinned page. No namespaces needed. 8-byte write.

The live code corruption technique in this repo works with any of these page-cache write primitives — just replace the write4() function with the ESP or RxRPC trigger. The technique is primitive-agnostic.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    837
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    536
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    424
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    355
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    294
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    276

Explore all tools

Browse our collection of tools

View all tools →