
PoC and differential lab for CVE-2026-115565, a stored path traversal in storyblok-backup's writeJson that lets a crafted component name write files outside the backup directory.
| CVE | CVE-2026-115565 |
| Component | storyblok-backup — writeJson() (bin/storyblok-backup.mjs) |
| Affected | < 0.7.1 |
| Fixed in | 0.7.1 — commit f4e4bb1 (GHSA-vcx7-pfrh-mcfg) |
| CWE | CWE-22 (Path Traversal) |
| Impact | A component name containing path-traversal sequences causes backup files to be written outside the intended backup directory — a stored, second-order arbitrary file write on the machine of anyone who later backs up the affected Storyblok space |
| Vector | Stored — attacker with component-management access in the source Storyblok space plants a malicious component name |
| Trigger | component name = "../../pwned" |
The vulnerable writeJson built the output path by direct concatenation:
// storyblok-backup 0.7.0
const writeJson = (folder, file, content) => {
let outputFile = backupDir
if (folder !== null) outputFile += `/${folder}`
outputFile += `/${file}.json` // file = raw component name
fs.writeFileSync(outputFile, JSON.stringify(content, null, 2), ...)
}
The fix sanitizes the file name before building the path:
// 0.7.1 (commit f4e4bb1)
file = file.replaceAll('/', '_')
file = file.replaceAll('\\', '_')
file = file.replaceAll('..', '_')
For the components resource type, the backup file name is the component's
own name field — free text editable by anyone with component-management
access in the Storyblok CMS. writeJson(folder, file, content) concatenated
backupDir + "/" + folder + "/" + file + ".json" with no sanitization or
containment check, so a name like ../../pwned resolved to a path outside
the backup directory and wrote pwned.json there. Because the malicious
value is stored in Storyblok and only read back when the backup tool runs,
this is a stored, second-order vulnerability: planted once, it triggers on
every subsequent backup of that space. (Other resource types were already
safe: stories/datasources use numeric IDs, assets take the last path
segment.) The fix replaces /, \ and .. with _ in the file name.
| service | image | role |
|---|---|---|
sb-vuln | cve-2026-115565:vuln | real writeJson from storyblok-backup 0.7.0 |
sb-fixed | cve-2026-115565:fixed | real writeJson from 0.7.1 (vendor fix) |
poc | cve-2026-115565-poc:local | stdlib-only Python driver |
The harness embeds the verbatim writeJson() extracted from each tag's
bin/storyblok-backup.mjs, sets backupDir=/tmp/lab/backup, calls it with an
attacker-controlled component name, and reports whether the file escaped the
backup directory. Both sides differ only in the extracted upstream function.
./run-lab.sh build # installs both npm releases, embeds each writeJson
./run-lab.sh up # cve115565lab network: sb-vuln / sb-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py (stdlib only):
f4e4bb1.A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=sb-vuln
# exit 1 on confirmed path escape, 0 on a safe target
| component name | sb-vuln (0.7.0) | sb-fixed (0.7.1) |
|---|---|---|
../../pwned | escaped=true — written outside backup dir | escaped=false, contained as ____pwned.json |
normal-component | contained | contained |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/exploit-standalone-run.txt, evidence/exploit-standalone-fixed-run.txt,
evidence/versions.txt, evidence/0day-sweep.txt.
cve115565lab
network; Node 20 runtime in the lab images.The fixed writeJson replaces /, \ and .. with _ before building the
path, so traversal names are contained (____pwned.json) and benign component
names are unaffected. No path-escape remains for components. Other resource
types (stories/datasources by numeric ID, assets by last path segment) were
already safe per the advisory.
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone full-chain exploit
lab/lab.Dockerfile installs both npm releases
lab/vendor/ verbatim writeJson() from each tag
lab/harness.mjs calls writeJson, reports path escape
lab/service.mjs Node HTTP wrapper (POST /write, GET /info)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)