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-131842 — Proof-of-concept lab for CVE-2026-131842: Poppler pdfdetach path traversal via crafted embedded file names, with vulnerable/fixed containers and exploit scripts. | Kitploit
Tools/GitHubGitHub/googlesky/cve-2026-131842
ExploitationWeb Application ExploitationSecurity VirtualizationPenetration TestingPapers & ResearchLabs & Practice
GitHubgooglesky/cve-2026-131842

CVE-2026-131842

Proof-of-concept lab for CVE-2026-131842: Poppler pdfdetach path traversal via crafted embedded file names, with vulnerable/fixed containers and exploit scripts.

View Repository
1 day agoNot yet reviewed
Website
Share

CVE-2026-131842 — Poppler pdfdetach: path traversal via embedded file names (string-prefix containment bypass)

License: MIT Research status: validated

CVECVE-2026-131842
ComponentPoppler utils/pdfdetach.cc — -saveall / -savefile extraction
Affectedpdfdetach 24.03.0 through 26.11.0
Fixed inno upstream fix yet (work item 1826 OPEN); this lab's fixed side carries a documented synthetic component-aware containment patch
CWECWE-22 (Improper Limitation of a Pathname to a Restricted Directory)
ImpactArbitrary file create/overwrite with the privileges of whoever runs pdfdetach — any document pipeline that detaches embedded files from untrusted PDFs into a quarantine directory (pdfdetach -saveall -o <dir>) can be made to write outside that directory (config, cron, source trees, SSH keys — anything writable)
VectorFile format — a crafted PDF whose embedded-file name escapes the output directory
Triggerone upload whose embedded file name is ../<base-suffix>/… (sibling-prefix bypass) or passes through a symlink inside the output directory

Since 24.03.0 the output directory is "protected" by a string-prefix containment check:

// utils/pdfdetach.cc @ poppler-26.11.0 (~L220)
std::filesystem::path filePath = basePath;
filePath = filePath.append(currentFileName).lexically_normal();

if (!filePath.generic_string().starts_with(basePath.generic_string())) {
    error(errIO, -1, "Preventing directory traversal");
    return 3;
}
embFile->save(filePath.generic_string());

starts_with on the normalized string is not containment. With base /work/quarantine, an embedded name ../quarantine-staging/pwned.txt normalizes to /work/quarantine-staging/pwned.txt — outside the base, yet a string prefix of it — so the guard passes and save() writes the file. A symlink inside the output directory defeats the check the same way: the lexical path stays "inside" while fopen() follows the link. This laboratory demonstrates both forms deterministically.


1. Root cause

lexically_normal() + generic_string().starts_with(base) checks characters, not path components. Two consequences:

  1. Sibling-prefix escape — any normalized path that shares the base string as a prefix passes, including paths in sibling directories (../quarantine-staging/…) or, with a trailing-slash-less base, sibling entries at every level.
  2. Symlink following — the check never resolves symlinks, so an existing symlink inside the output directory redirects the write anywhere on the filesystem.

The older 2023-era fix (commit d8e7a8a9, "Fix directory traversal in pdfdetach") survived into 24.03+ in this weakened form; upstream work item 1826 tracks the bypass and is still open — there is no vendor fix to differential against yet.

2. Reproduction environment

serviceimagerole
pdf-vulncve-2026-131842:vulnpdfdetach built from upstream tag poppler-26.11.0 as-is
pdf-fixedcve-2026-131842:fixedsame tree + synthetic component-aware containment patch (sha256 in evidence/versions.txt)
poccve-2026-131842-poc:localstdlib-only Python driver that crafts the PDFs

The pipeline service models a real product flow: POST /detach accepts a PDF, runs pdfdetach -saveall -o /work/quarantine <pdf> as a child process, and reports every file created outside the quarantine directory. Two lab preconditions (identical on both sides) make the vectors deterministic and are documented as such: a sibling directory /work/quarantine-staging (writes need an existing parent) and a symlink /work/quarantine/link-escape → /work/escape-zone — both plausible in any pipeline that accumulates staging dirs and symlinks.

3. Running the environment

./run-lab.sh build     # builds poppler 26.11.0 twice (with/without the patch)
./run-lab.sh up        # cve131842lab network: pdf-vuln, pdf-fixed
./run-lab.sh sweep     # check / exploit / probe / mitigation on both sides
./run-lab.sh down

4. The PoC

A standalone full-chain exploit script ships at exploit/exploit.py (python3 exploit/exploit.py --host=<target>; exit 1 on confirmed exploitation, 0 on a safe target).

poc/poc.py (stdlib only — it writes the minimal PDF bytes itself):

  • check — benign embedded name (stays inside), then the sibling-prefix bypass; exit 1 when a file lands outside the quarantine, 0 when containment holds, 3 no worker, 2 unreachable.
  • exploit — narrated chain with the escaped file path and its marker content as proof.
  • probe — matrix: sibling-prefix, symlink, benign control, plain .. control.
  • mitigation — the synthetic patch side; the symlink residual is stated.

5. Expected results

casepdf-vuln (26.11.0)pdf-fixed (synthetic patch)
benign doc.txtsaved inside quarantine, exit 0exit 0
../quarantine-staging/pwned-prefix.txtwritten outside, exit 0rejected "Preventing directory traversal", exit 3
link-escape/pwned-sym.txtwritten through symlink, exit 0still written (residual)
../pwned-direct.txt (control)blocked, exit 3blocked, exit 3

Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt, evidence/probe-*-run.txt, evidence/mitigation-*-run.txt, evidence/versions.txt, evidence/0day-sweep.txt.

6. Environment preconditions

  • Podman (or Docker) with network-creation rights; containers bounded on the isolated cve131842lab network.
  • Outbound HTTPS at image build (gitlab.freedesktop.org git clone; debian mirrors).
  • Build needs cmake ≥ 3.28 (debian:trixie build stage); runtime needs freetype/fontconfig/harfbuzz shared libraries.

7. Additional findings (0-day sweep on the fixed line)

The probe matrix on the patched build (evidence/0day-sweep.txt) shows the synthetic component-aware check closes the sibling-prefix bypass but cannot close the symlink form — lexical containment never resolves links. The symlink variant remains exploitable on every release through 26.11.0 and on this lab's fixed side; it needs a std::filesystem::weakly_canonical-based check (or extraction into a directory the process cannot traverse out of, e.g. a per-job mount namespace). That residual is documented upstream in work item 1826. Deployment mitigations until a vendor fix: reject embedded names containing .. components before invoking pdfdetach, and run detachment in a container without write access outside the quarantine.

8. Repository layout

README.md             this write-up
run-lab.sh            environment driver (build / up / sweep / down)
Makefile              convenience targets
exploit/exploit.py    standalone full-chain exploit
poc/poc.py            the PoC (check / exploit / probe / mitigation)
poc/Dockerfile        runner image (python:3.12-alpine)
lab/lab.Dockerfile    multi-stage build (poppler 26.11.0 with/without patch)
lab/patches/fix-prefix-containment.patch   the synthetic fixed-side patch
lab/service.py        the document-pipeline service (POST /detach)
evidence/             captured runs of every mode on both sides
TRACKING.md           excluded (working record)

9. References

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.

    936
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    555
  • 3

    redforge

    cybersecurity91/redforge

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

    353
  • 4

    ARTEX

    baarai/artex

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

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

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

    288

Explore all tools

Browse our collection of tools

View all tools →
Download Tool