Open mikewest opened 5 years ago
(This is a bit difficult to ship, as we have anecdotal evidence that stripping referrers entirely breaks some sites' anti-CSRF mechanisms. A safer alternative (in the less-data-flowing-over-non-secure-wires sense) could be to adopt Brave's model of spoofing the referer
header as the target's origin for non-secure resources.)
Brave's model of spoofing the referer header as the target's origin for non-secure resources
The exact model we converged on is:
The problem with spoofing navigation is that while it's making the CSRF checks pass, it's also effectively disabling that check entirely (it always passes), which is not great for security.
Stripping referrers from iframes leads to a lot of breakage in our experience.
@fmarier: Current versions of brave (e.g. 1.5.86 Chromium: 80.0.3987.87 (Official Build) dev (64-bit)) seem to do something slightly different:
Is that expected?
Test page: https://www.webdbg.com/test/refer/
@ericlaw1979 Indeed that's the correct behavior. You're right I forgot to mention that our "origin" checks are actually ETLD+1 checks.
I made a test page for this specific behavior and have updated our documentation.
It's good to have dreams.
Preview | Diff