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-3888-snap-confine-privilege-escalation — Exploit para CVE-2026-3888: race condition en snap-confine con hijack del loader para escalar a root en Linux. | Kitploit
Tools/GitHubGitHub/alannewberry/cve-2026-3888-snap-confine-privilege-escalation
Privilege EscalationExploitationPayload Development
GitHubalannewberry/cve-2026-3888-snap-confine-privilege-escalation

CVE-2026-3888-snap-confine-privilege-escalation

Exploit para CVE-2026-3888: race condition en snap-confine con hijack del loader para escalar a root en Linux.

View Repository
Share
11 month agoNot yet reviewed

CVE-2026-3888 - snap-confine - Privilege Escalation to Root

Description

I developed this chain to exploit CVE-2026-3888, a race condition in snap-confine during the preparation of the sandbox mount namespace. Running as an unprivileged user, the race is won to swap the namespace's library directory for one I control, hijacking the dynamic loader (ld-linux-x86-64.so.2) that then executes the SUID binary snap-confine as root. The result is code execution as root.

Components

  • snap-confine-privesc.sh - orchestrator that coordinates the three threads of the attack (materialize the private /tmp, destroy the cached namespace, run the race helper and trigger the SUID)
  • firefox_2404.c - helper that sets up the .snap/.exchange directory and performs the atomic swap (renameat2 with RENAME_EXCHANGE) at the exact moment of the race
  • librootshell.c - minimal libc-free payload: performs setreuid(0,0), setregid(0,0) and execve("/tmp/sh"), used as a fake loader

How it works

  1. Materialize sandbox: I launch the firefox hook via snap-confine so that the sandbox's private /tmp is created and I wait for root's .snap to be cleaned up by the janitor
  2. Destroy cached namespace: I force an error with --base snapd to invalidate the cached mount namespace
  3. Set up the exchange: The helper replicates the real library directory in .snap/usr/lib/x86_64-linux-gnu.exchange
  4. Win the race: When snap-confine emits the expected trigger, the helper performs the atomic swap so that the namespace uses my library directory
  5. Loader hijack: I overwrite ld-linux-x86-64.so.2 inside the victim's namespace with my payload and copy a busybox to /tmp/sh
  6. Root: Upon re-entering the sandbox, the SUID snap-confine loads my loader as root; I leave a SUID bash at /var/snap/firefox/common/bash for a stable shell

Compilation

gcc -O2 -o firefox_2404 firefox_2404.c
gcc -nostdlib -static -o librootshell.so librootshell.c

Usage

On the target, with the three files in the same working directory:

# if your working directory is not $HOME, export it:
# export WORKDIR=/path/to/workdir
chmod +x snap-confine-privesc.sh
./snap-confine-privesc.sh

Technical details

  • Vector: race condition in snap-confine's mount namespace preparation
  • Primitive: atomic directory swap with renameat2(RENAME_EXCHANGE)
  • Hijack target: ld-linux-x86-64.so.2 loaded by the SUID snap-confine
  • Impact: code execution as root (local privilege escalation)

Legal notice

This tool is solely for authorized security testing and educational purposes. Always obtain written authorization before testing against any system.

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.

    806
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    523
  • 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.

    441
  • 4

    redforge

    cybersecurity91/redforge

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

    346
  • 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.

    270
  • 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.

    264

Explore all tools

Browse our collection of tools

View all tools →