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

Fully prevent the use of path-based IPFS gateways #7698

Open
rekmarks opened this issue Dec 12, 2019 · 0 comments
Open

Fully prevent the use of path-based IPFS gateways #7698

rekmarks opened this issue Dec 12, 2019 · 0 comments

Comments

@rekmarks
Copy link
Member

rekmarks commented Dec 12, 2019

Currently, we allow users to set whatever IPFS gateway they want except gateway.ipfs.io. We should prevent all path-based gateways by implementing the fix suggested below.

Original comment by @lidel:

To make this more bullet proof, you could add a quick validation, to ensure provided hostname is a real subdomain gateway, and refuse to save invalid ones.

Try fetching a small, well-known hash (for example: string hello is bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am) and see if returned value matches expectations:

https://bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am.ipfs.dweb.link
https://bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am.ipfs.cf-ipfs.com
This would also protect you from users setting path-based gateways (which do not provide Origin-based isolation.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants