| ▲ | amluto 3 hours ago | |||||||
An idea I’ve been kicking around (which isn’t quite applicable to this use case, I think) is to aggressively restrict the Sec-Fetch- headers on user content. If a server is willing to serve up an untrustworthy SVG, it could refuse to serve it at all unless Sec-Fetch-Dest has the correct value, and ‘document’ and ‘iframe’ would not be correct values. This would make it more difficult to fool a user or their browser by, for example, linking to an SVG file, or using a less-secure mechanism like embed to load it. This should be in addition to heavily restricting CSP on user content. (Hmm, surely all images should be served with the CSP header set.) | ||||||||
| ▲ | bawolff 3 hours ago | parent [-] | |||||||
You can bypass the sec-fetch headers via service workers i think. A better approach here would be to just serve svg with Content-security-policy: script-src 'none'; sandbox | ||||||||
| ||||||||