Live demo: the same vulnerable Rust zip crate (RUSTSEC-2026-0367 setuid + CVE-2026-115905 zip cloaking) contained by a deny-by-default Cosmonic WebAssembly sandbox.
Read the full story on the Cosmonic blog: Stopping Remote Code Execution with a Sandbox

The Rust zip crate shipped two serious vulnerabilities nine days apart, one of them a CVSS 10.0.
This repo runs that exact vulnerable code, unpatched, inside a deny-by-default
Cosmonic sandbox, and lets you fire real crafted archives at it. Every
attack runs. None of them can do anything.
Step by step: Sandboxed zip extractor (the docs walkthrough)
You can't execute what you don't have. A sandbox doesn't have to recognize the attack. It starts with nothing and hands the code only the capabilities you grant: here, one scratch folder and no network. See principles of secure agent platforms.
The demo page has one red button per scenario. Each streams a real crafted archive into the sandbox; nothing is patched.
| Button | Vulnerability | What the crafted archive does | In the sandbox |
|---|---|---|---|
| Bug 1: setuid bits | RUSTSEC-2026-0367 · setuid · CVSS 7.3 | Three entries carry setuid, setgid and sticky bits. On a Unix extractor they'd hand a dropped file root-level powers. | All three bits reach the report; zero are applied. |
| Bug 2: zip slip | CWE-22 / CWE-59 · zip slip via symlinks | Three symlink entries aimed at known paths outside the folder: /etc/cron.d, /root/.ssh/authorized_keys and /tmp. zip 8.6.0 refuses ../ names, but on Unix its extract() plants these links unchecked. | All three land as plain files holding the target text; no link exists. |
| Bug 3: zip cloaking | CVE-2026-115905 · zip cloaking · CVSS 10.0 | The central directory shows a scanner release-notes.txt; the local header tells the crate's streaming extractor to write home/you/.ssh/authorized_keys. | The cloaked write is honored but lands inside /tmp/unzip, a throwaway folder. |
| Run all attacks | all three at once | One archive carrying every attack above. | All of the above, contained together. |
Other IDs, if you're searching for them: RUSTSEC-2026-0367 is GHSA-vv5m-jxxh-4627 (CWE-732), and CVE-2026-115905 is GHSA-m665-v7pm-7grj (CWE-436).
Both advisories affect zip 8.6.0, the version used here on purpose. In your own code, upgrade to
zip 9.0.5, which fixes both.
Install Cosmonic Desktop. It runs WebAssembly components as
sandboxed workloads on macOS, Windows and Linux, and listens on 127.0.0.1:8200.
Apply the manifest. deploy/zip-sandbox.workload.yaml
pins both components by digest on ghcr, so there's nothing to build. The easiest route is an AI
assistant connected to Desktop's MCP server
(Connect coding agents):
"Apply
deploy/zip-sandbox.workload.yamlto Cosmonic Desktop, then show me its status."
Or copy the manifest to workloads/default/zip-sandbox.yaml under Desktop's state directory
(cosmonicd paths prints it).
Open http://zip-sandbox.localhost:8200/ and press the red buttons, one per scenario, or upload your own zip.
One gotcha. The extractor needs its
/tmp/unzipvolume. Desktop's quick-deploy paths (cosmonic dev, publish drafts, pasting an image link) build a spec from the image alone and drop thevolumessection, and the extractor then answers"sandbox unavailable". Apply the manifest as written.
Each scenario has an API mode and a downloadable archive, so you can inspect the raw bytes:
| Scenario | Run it | Download the archive |
|---|---|---|
| Bug 1: setuid bits | /run?mode=suid (the default) | /suid.zip |
| Bug 2: zip slip | /run?mode=slip | /slip.zip |
| Bug 3: zip cloaking | /run?mode=cloak | /cloak.zip |
| Run all attacks | /run?mode=all | /all.zip |
B=http://127.0.0.1:8200
curl -s -H 'Host: zip-sandbox.localhost' "$B/run?mode=all" | python3 -m json.tool
# or upload your own zip
curl -s -H 'Host: zip-sandbox.localhost' -H 'content-type: application/zip' \
--data-binary @your.zip "$B/run" | python3 -m json.tool
A contained run of mode=all reports:
MITIGATED: 3 privileged (setuid/setgid/sticky) entries in the archive, 0 applied;
3 zip-slip symlinks neutralized; 1 cloaked entry (CVE-2026-115905) honored but confined.
Everything stayed inside /tmp/unzip.
native-demo/ is a small CLI that runs the same vulnerable crate directly on
macOS or Linux, with no sandbox, so you can watch the attacks succeed first. It needs a Rust toolchain.
cd native-demo
cargo run # bug 1 (the setuid bit survives) and bug 3 (the cloaked path is written)
cargo run -- cloak # bug 3 only
Bug 1 ends with VULNERABLE: 1 file(s) kept a SUID/SGID/sticky bit after extraction, and
ls -l on the extracted file shows -rwsr-xr-x. Bug 3 shows the scanner seeing
release-notes.txt while the streaming extractor writes config/app.conf. Same code, same kind
of archive; the only difference is what the code was handed.
One workload, two WebAssembly components, each its own sandbox with its own grants. web streams the
uploaded archive to extractor over a live stream<u8> inside the host; the browser only ever talks
to web.
| Component | Filesystem | Network | HTTP | Job |
|---|---|---|---|---|
web | none | no egress | serves wasi:http/handler | UI and upload; never stores the archive |
extractor | /tmp/unzip only (ephemeral) | no egress | none, reachable only through the link | the unzip, with the vulnerable crate |
Those grants are the whole mitigation:
wasm32-wasip2, which isn't a
Unix target, so the crate's #[cfg(unix)] permission code is compiled out. The bit arrives and the
report shows it; nothing can apply it./tmp/unzip is the only path that exists inside the sandbox anyway.allowedHosts: [].The crafted archives are non-weaponized: their contents are inert text. Only the permission bits and entry names are hostile, and no real privilege escalation is ever performed.
The same manifest runs unchanged on Kubernetes with Cosmonic Control, where you can enforce these grants with admission policies. See Securing a cluster.
The quickstart pulls prebuilt images from ghcr
(ghcr.io/cosmonic-labs/demo-zip-rce-sandbox/web and .../extractor). To rebuild: