-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[IPFS] Don’t redirect ipfs subresources away from public gateways to the local gateway when the local gateway will get blocked #20357
Comments
cc @spylogsster and @lidel |
|
@spylogsster, no it doesn’t work in nightly (1.36.23 Chromium: 97.0.4692.71 (Official Build) nightly (64-bit), adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247}) either. I’ve updated the steps to reproduce to clarify that you need to restart Brave after changing the settings for them to apply. I also included a screenshot of my settings (local node, redirect to configured node.) |
@spylogsster there is a security / privacy concern here when the top level page is HTTP(S) and it's loading IPFS resources. For example a website could host a page and add a file onto the user's cache. We require that the top level be an IPFS resource. |
Redirecting subresources on The top level document requirement proposed by @bbondy is sensible here – at least it will make subresource redirect possible on DNSLink websites (loaded over |
Firefox and Chrome both assume http://localhost (and variations) to be secure origins. Safari doesn’t. I don’t see why this is considered a bigger issue for subresources loaded over localhost/IPFS than third-party resources hosted on HTTP(S).
Is cache-based fingerprinting the issue? Here are some possible privacy enhancements for the IPFS cache that could allow Brave to still use it (ordered by implementation complexity):
Just not redirecting to the local (or even the configured public) gateway is probably the best compromise here. Some gateways don’t serve videos, for example. Presumably, the fallback gateway specified on a page allows the resource it attempts to load. (E.g. DTube uses its own IPFS gateways that allow serving video.) This leaves ipfs:// and ipns:// subresourcs loading unhandled and broken, though. An HTTPS page that tries to load with these schemes will presumably also handle loading error events themselves.
That seems to work fine already, by the by. This is only an issue on HTTP(S) pages. |
i'll have to dig up the original IPFS security review for more details, but IIRC the two main concerns were cache probing (being able to check what IPFS pages a user has in their cache) and cache polluting (where a site puts objectionable/incriminating IPFS content in a user's cache by making third party requests). originally i wanted to restrict third-party CID loading but was told this would break too many IPFS sites, so we just applied these restrictions to non-IPFS/IPNS origins. |
The same threat exists with the HTTPS cache. Any site can put anything into your cache. Although, it's a bit different with the distributed nature of the IPFS cache. There's not really anyway to mitigate this completely, as it's fundamental to the technology. I have two possible proposals:
|
Right, the difference is that with IPFS your cache contents are potentially visible to anyone (law enforcement, etc.).
I think this would address the cache polluting issue nicely but sites could still see what is in your IPFS cache; and also as a side effect, this would mean that cache-probing attacks are non-destructive (the second time a user visits your site, you can query and get the same result as the first time, which makes it easier to fingerprint them). |
Verified
Steps:
|
Description
Steps to Reproduce
Actual result:
Brave redirects the subresource (e.g.
https://gateway.ipfs.io/ipfs/<cid>
) to the local gateway under localhost. The request is blocked as Brave doesn’t allow loading subresources fromlocalhost
on HTTPS pages (brave/brave-core/pull/7194 by @bbondy).Expected result:
The image should load from the public HTTPS gateway. Brave should not redirect the subresource request away from a public HTTPS gateway when it intends to block the resulting address.
Preferred results:
The image should load from the local gateway as that’s how I’ve configured Brave. It’s an opt-in feature, and it’s super-annoying that Brave’s policies blocks mixed-mode uses.
Reproduces how often:
Every time.
Brave version (brave://version info)
1.33.106 Chromium: 96.0.4664.110 (Official Build) unknown (64-bit)
The text was updated successfully, but these errors were encountered: