Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
appview/repo/blob.go: fix XSS via raw blob endpoint master
Replace the image/ prefix match with an explicit allowlist of safe binary MIME types. SVG is intentionally excluded as it supports embedded scripts. Normalize the knot-supplied Content-Type with mime.ParseMediaType before classification to strip parameters and prevent bypass attempts. Add X-Content-Type-Options: nosniff as defence-in-depth. Add tests covering the allowlist invariants and the normalization behaviour. Signed-off-by: Matías Insaurralde <matias@insaurral.de>
Author Matías Insaurralde Committer Tangled Date (Apr 8, 2026, 4:40 AM UTC) Commit 5b01f997 5b01f9975e7ec4e828e57202bd7cb87ff4e137df Parent 8c987975 8c98797542a2c0c413b725d342555224dd845c31