Skip to content
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

Sanitize ipfs links? #177

Closed
melMass opened this issue Aug 22, 2022 · 3 comments
Closed

Sanitize ipfs links? #177

melMass opened this issue Aug 22, 2022 · 3 comments
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@melMass
Copy link

melMass commented Aug 22, 2022

Hi,

Issue

When generative tokens (html CAR packages) are viewed from the gateway. Direct links to ipfs (i.e ipfs://<CID>) are not sanitized:

DOES NOT WORK -> https://bafybeifsiea24k46cgebr6pcleqmqe6kyqzh4pw4rexep4xdr337625oyi.ipfs.nftstorage.link/
WORKS -> https://ipfs.io/ipfs/bafybeifsiea24k46cgebr6pcleqmqe6kyqzh4pw4rexep4xdr337625oyi/

Though looking at the source code I'm not such of the artist's logic there.

@melMass melMass added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Aug 22, 2022
@melMass
Copy link
Author

melMass commented Aug 22, 2022

So it seems like the reason the token actually ends up working is by providing a fallback to "popular" gateways, hence given the current CSP policy it's failing on NFT.storage.
I'm not sure how feasable or if there is any standard on that end, but resolving ipfs:// requests to the gateway makes sense IMO

@dchoi27
Copy link
Contributor

dchoi27 commented Aug 23, 2022

Oh, interesting thought. @Gozala does this fit with how you're thinking about the ideal state of how browsers / gateways handle external content?

@vasco-santos
Copy link
Member

Closing this issue. More information on how to proceed with goodbits at https://blog.nft.storage/posts/badbits-and-goodbits-csp-in-nftstorage-link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

3 participants