#106 Pages artifact download policy is invalid (two splats), allowing active HTML/SVG
Problem
The Pages artifact download policy is invalid: Cloudflare _headers allows only one * wildcard per rule, but HEADERS_FILE emits /releases/*/*. Wrangler reports it invalid and skips it, so release artifacts are served as active same-origin HTML/SVG instead of downloads. This means f0rge #97 is still open on Pages even though hu13 serve is fixed.
Verified reproduction
wrangler pages dev 4.154.0 over a dist with .forge/releases/out/v1/evil.html and evil.svg:
Found 1 invalid header rule:
Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping /releases/*/*.
at dist/_headers:7 | /releases/*/*
Then:
GET /releases/v1/evil.svg -> 200 image/svg+xml, no Content-Disposition
GET /releases/v1/evil.html -> 308 Location: /releases/v1/evil
GET /releases/v1/evil -> 200 text/html, no Content-Disposition
Both artifact bodies are script-bearing and execute in the inbox origin. src/build.rs:1157, docs/cloudflare.md:94, and .forge/wiki/deploy:69 all claim the artifact download policy exists.
Fix candidate
Use /releases/:version/* (one splat plus a placeholder). Verified with Wrangler: it parses as valid, applies Content-Disposition: attachment to extensionless artifact URLs and artifact directory indexes, and leaves /releases/v1 release pages inline. Add a real Wrangler/Pages header test instead of only checking the string.
Uunknown ·
Fixed in PR #61 (
3df93c3a-bd5e-43f4-bb73-0f3dd886eeb1, commitee6e71b, mergede834a46). CI run2026-10-27T19-50-04.907798288Zpassed; fullcargo test,node --test tests/pages_inbox.test.mjs, fmt, and clippy green._headersnow emits/releases/:version/*(one named placeholder + one splat). Wrangler 4.154.0 reports "Parsed 3 valid header rules";/releases/v1/evil.html308→/releases/v1/evil200 withContent-Disposition: attachment, and.svg/.txtartifacts also download. Regression testtests/review5_hardening.rs::pages_headers_use_one_splat_for_artifacts.