-
Notifications
You must be signed in to change notification settings - Fork 104
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
allowInsecure: false
should respect Secure Contexts
#564
Comments
According to https://www.w3.org/TR/secure-contexts/#is-origin-trustworthy is seems that
|
For anyone interested in taking this task on (e.g. Luca from 2024-08-01 Helia WG): We will want to modify https://github.com/ipfs/helia/blob/74ccc92793a6d0bb4bee714d9fe4fa4183aa4ee8/packages/block-brokers/src/trustless-gateway/utils.ts#L10C17-L31 in the following ways:
|
* Fix issue #564: Modify filtering logic and update related tests * chore: fix linting issues * Update packages/block-brokers/src/trustless-gateway/utils.ts Co-authored-by: Russell Dempsey <[email protected]> * refactor: simplify conditional logic in filterNonHTTPMultiaddrs --------- Co-authored-by: Russell Dempsey <[email protected]>
Problem
Setting
allowInsecure: false
should not be blindly blockinghttp://
, it should not block requests tohttp://localhost
andhttp://*.localhost
because these are valid Secure Contexts.This bug blocks users from using their own local gateway (ipfs desktop, kubo, rainbow).
Solution
Correctly recognize
http://localhost[:port]
andhttp://*.localhost[:port]
as secure contexts.Important
Only
localhost
label is marked as Secure Context, URLs with loopback127.0.0.1
IPs are not.Ref.
helia/packages/block-brokers/src/trustless-gateway/utils.ts
Line 12 in 74ccc92
The text was updated successfully, but these errors were encountered: