ADR-0124 — An SVG is refused as an image and served as a document
Status: Accepted · Date: 2026-08-30 · Track: 010 artifact hosting, phase 01 · Supersedes: nothing · Related: 0103, 0122, 0123
Context
image/svg+xml is excluded from AllowedImageTypes and AllowedFileTypes, in
both cases deliberately, with F-5's reason in the comment: SVG is XML and can
carry script, which would execute same-origin if served inline.
The charter's phase 01 says the exclusion is to be answered, not deleted. The reason it can be answered is that F-5's sentence contains its own condition — served inline. An SVG the app draws inside its own pages is script on the product's origin. An SVG served as a document at its own address is a different thing, and 008 already built the machinery that makes it different.
Decision
The exclusion stands where it was made, and image/svg+xml is added to the
static-page allowlist only. Two doors, two answers:
- As an image the app draws — still refused.
AllowedImageTypesandAllowedFileTypesare untouched, and a test asserts all three facts together, so widening the wrong allowlist fails the build rather than passing review. - As a static page — accepted, and served with ADR-0103's headers whole:
sandbox(an opaque origin, no script permitted),default-src 'none'(it fetches nothing outward),nosniff,X-Frame-Options: DENY.
The bytes are served as stored. Markdown is rendered because the source is not
the document; an SVG is the document, so rendering it would mean rewriting
somebody's drawing. What the product decides is the content type — declared as
staticSVGContentType, chosen from the kind written on the row at upload
(ADR-0123), never from the file's name.
The gate, the interstitials, the schedule, the click limit and 009's lifecycle predicate hold on this kind for free, because the branch sits below them in the same serving path. Proved rather than assumed: a sensitive-content mark 302s to the door and a lapsed row 404s, on the same document that serves 200 when neither applies.
Consequences
check:hostingreads 3 of 5.zip-bundleandbundle-assetremain, and both are phase 02/03.- The risk moved, it did not vanish. What protects this SVG is a header, and
the watched-failing run shows what one deleted line costs: with no CSP of its
own the branch inherits the app's global policy, whose
script-src 'self'permits exactly the script inside the author's document, on the origin where sessions live. That is why the headers are asserted whole in the suite and why the separate origin (charter Blocker 3) remains the real answer. - H7 was refined here. Flipping the row failed the gate on three rows at
once: the check held every row to every
Content-Typeexpression its serving-path file sets, andstored_static.gonow holds three kinds' branches. The rule that has teeth is that no serving path sets a type no row declares; making each row restate its neighbours' decisions is noise a reviewer learns to skim, and noise is how a real finding gets missed. The check is now the union across the rows naming that file, and the attribution stays with the row that made the decision — the same shape of correction ADR-0121 made to 009's L4, found the same way, by using the gate. - A declared-SVG upload that sniffs as HTML is refused, as ADR-0123 refuses one declared as Markdown. The doors stay separate at the entrance rather than downstream.
- Evidence: the running-stack proof and both watched failures are in
.station/jobs/010-artifact-hosting/evidence/phase-01-svg-running-stack-2026-08-30.md.
Source: docs/decisions/0124-an-svg-is-refused-as-an-image-and-served-as-a-document.md