-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support SVG and HTML inscriptions #1035
Conversation
Have you tried putting XSS into an html inscription? |
Good question! The answer is yes, but I think it's okay. (Famous last words.) This PR serves all content with the following header:
This allows HTML inscriptions to include and execute arbitrary JS. However, It does load from the same origin as other content from ordinals.com, but having the same origin as ordinals.com is not exploitable, because it isn't a sensitive browsing context. It doesn't have any cookies, or access to any special permissions. If ordinals.com ever becomes a sensitive browsing context, e.g. we have cookies, we'll need to start serving inscription content from a different origin, so that it doesn't have access to those cookies. We eventually want to relax the sandboxing, so that that inscriptions can request other inscriptions, so eventually we'll want to:
The goal is to allow HTML inscriptions that can build and remix other inscriptions. We might also want to serve other stuff from |
@rot13maxi Definitely let me know if the above makes sense or not, and if I'm missing anything. |
This was easier than I thought. This serves all content with a CSP header value of
default-src 'none'
. When content is loaded in an iframe with this CSP, all outgoing requests from the iframe are disallowed. We can then serve SVG and HTML content in frames, and they can't make outgoing requests, lessening security concerns and avoiding breakage and references to off-chain content.