Files
magpie/internal
yetone 4f72725e39 gateway: a drawn SVG is served under a CSP that runs nothing
The image server's files (b2ccfe25d keeps them an hour, behind a link
with a token) were served with the vendor's type and nosniff only. A
Recraft SVG opened from its link is a document on the gateway's own
origin, and a page there is same-origin to the gateway, which a local
request reaches without a key: script in the SVG could have asked
/v1/chat/completions on the user's subscriptions. An SVG is now served
with "default-src 'none'; style-src 'unsafe-inline'; sandbox", as the
GUI's SVG icons already are (library.go, providers.go). Other types
are unchanged, so a video still plays in its own page.

Run: go test -run TestImageMCP ./internal/gateway ok (mote).
Broken by hand: with the header line removed,
TestImageMCPSVGRunsNothing is red (mica).
Not tried: a real Recraft SVG in a browser.
2026-11-13 11:08:44 +08:00
..
…
…
…
…
…
…
…
…
…
…
…
…