
Differential lab and PoC for CVE-2026-130335: OS command injection in Info-ZIP zip -T via crafted archive names, with vulnerable and patched builds.
zip -T: OS command injection through a crafted archive name| CVE | CVE-2026-130335 (Debian DSA, bugs.debian.org/1143866) |
| Component | Info-ZIP Zip 3.0 (and 3.1 beta – 3.1c) — check_zipfile() in zip.c |
| Affected | Zip 3.0, 3.1b–3.1c; fixed in Debian zip/3.0-16 (fix-command-injection.patch) |
| Fixed in | the genuine Debian/Info-ZIP fix — quote_arg() proper quoting (this lab's fixed side) |
| CWE | CWE-78 (OS Command Injection) |
| Impact | Arbitrary command execution with the privileges of whoever runs zip -T on an attacker-influenced archive name — CI pipelines, packaging services, upload-verify flows |
| Vector | Local/queued: the attacker controls the archive name; the victim (or pipeline) runs zip -T <name>; the CVE notes no common scenario ships untrusted names to zip -T — the lab models the precondition honestly |
| Trigger | an archive name containing a single quote, e.g. a.zip';id>pwned;# |
zip -T verifies a freshly written archive by building a shell command
and calling system():
/* zip 3.0 check_zipfile() — the UNIX branch wraps the name in SINGLE quotes */
strcat(cmd, "'");
strcat(cmd, zipname);
strcat(cmd, "'");
...
result = system(cmd);
A name containing a single quote breaks out of that quoting and runs
attacker commands. Debian's fix (3.0-16) introduces quote_arg() —
double-quote wrapping with per-character escaping of ", !, $,
backtick and backslash. This laboratory builds both sides from the
upstream 3.0 source with the Debian patch series, differing only by
the one fix patch.
Single quotes are not a quoting mechanism that survives attacker input
containing single quotes. check_zipfile() builds (on UNIX):
sh -c "unzip -tqq 'a.zip';id>pwned;#'"
The first ' after a.zip closes the quoted span; the rest is shell.
The fix quotes with double quotes and escapes the five dangerous
characters, so the name reaches unzip as one literal argument.
| service | image | role |
|---|---|---|
zip-vuln | cve-2026-130335:vuln | Zip 3.0 + Debian patches without fix-command-injection.patch (= 3.0-15) |
zip-fixed | cve-2026-130335:fixed | same + the fix patch (= 3.0-16) — genuine vendor/distro fix |
poc | cve-2026-130335-poc:local | stdlib-only Python driver |
The packaging service models the documented precondition: the caller
chooses the archive name, a real zip is created under that name, and
zip -T verifies it — exactly what upload/CI pipelines do. The
filename is passed to zip as a single argv element (no shell at the
service layer), so any breakout happens inside Zip's own system()
call. unzip is installed because zip -T shells out to unzip -tqq.
./run-lab.sh build # builds zip 3.0 twice (with/without the fix patch)
./run-lab.sh up # cve130335lab network, zip-vuln, zip-fixed
./run-lab.sh sweep # check / exploit / probe / mitigation on both sides
./run-lab.sh down
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).
uid=0(root) ... in the lab).| run | zip-vuln (3.0-15) | zip-fixed (3.0-16) |
|---|---|---|
check benign | zip exit 0, no marker | exit 0, no marker |
check breakout | marker created — injected id ran | safely quoted, no marker |
exploit | uid=0(root) gid=0(root) groups=0(root) | (no injection) |
probe dollar form | executes (/root in marker) | safe |
probe backtick form | exit 8 (intercepted by the quoting context) | safe |
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.
cve130335lab network.The name-shape matrix is the surface sweep (evidence/0day-sweep.txt):
the fix neutralizes every breakout form; on the vulnerable build the
single-quote and dollar forms execute arbitrary commands. No second
injection sink was found beyond check_zipfile's system() call.
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 (zip 3.0 with/without the fix)
lab/patches/ the Debian patch series (series file included)
lab/service.py the packaging service (the documented precondition)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)