-
Notifications
You must be signed in to change notification settings - Fork 29
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
Gateways and Content-Security-Policy #196
Comments
@lidel we have identified some of problems with bunch of content that links to stuff outside of ipfs realm as those links get blocked by CSPs. While it is a sticky problem I feel like it is a good idea to recognize and communicate with ecosystem what linking out from IPFS to HTTP(S) may entail:
I realize that simply cutting off all the HTTP(S) links today may be impractical & can prevent IPFS from getting wider adoption. I do think there is a middleground however where we encourage use of only IPFS links by default, but provide way to opt-out which would incur some security prompts warnings to the end user. I described this idea in the context of nft.storage here nftstorage/nft.storage#2143 (comment) but I think it can be generalized across all gateways. Providing copy of that message below for convenience:
As side note we don't necessarily need to go into html parsing business on gateways, instead we could just define a custom block format for content with CSP overrides, that way regular content will load with default CSPs, but same content could be wrapped with the custom block to define different CSPs allowing gateways to intercept those without having to do any HTML parsing. |
Personally, I've been wanting to make IPFS more privileged than other protocols and give it the ability to bypass CSP so that p2p web apps can talk to HTTP servers without needing to be on the same origin. e.g. to enable aggressive interoperability. 🤷 It would be nice if somebody could create a p2p frontend for something like discord or soundcloud without needing to turn it into a separate native app. |
@RangerMauve to be clear I'm not opposed to granting more privileges, but I think those need to be deliberate hatches that user agent can intercept to actually provide agency to the user. That is if specific application needs access to everything everywhere it could set CSPs to
I don't think what I've described would prevent any of this, but it would allow user to choose to grant said apps to communicate with with |
Let's discuss if it makes sense to improve Gateway specs (path, subdomain) to include a default Content Security Policy (CSP),
and if so, what would be a sane default. Please comment below.
About CSP
IPFS use
@Gozala suggested Csetting SP to limit the utility of a gateway in phishing campaigns:
Prior art
nftstorage.link
Value set by nftstorage.link team (nftstorage/nftstorage.link#172 (comment), cc @vasco-santos) :
The text was updated successfully, but these errors were encountered: