-
Notifications
You must be signed in to change notification settings - Fork 332
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
Send "null" Origin header on cross-origin .onion requests #1351
Draft
fmarier
wants to merge
1
commit into
whatwg:main
Choose a base branch
from
fmarier:onion-referrers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to "byte-serializing a request origin" we'll also end up with null if they are same origin but there's a cross-origin redirect in between. Ideally we'd test that, but I guess
.onion
will be hard to test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got these two no-cors manual test cases on my test page (you can also see it at http://fmarier.com/referrer/onion.html though it's meant to run from a
.onion
) :example.onion
--POST-->example.onion
--307-->example.com
example.onion
--POST-->example.com
--307-->example.onion
For the first one, both Brave and Tor Browser send a
null
origin (and omit the referrer for that matter).For the second one, however, Brave sends a
null
origin but the Tor browser sends the full Origin in that case.Is a
null
Origin the desired behavior in both cases or just in the first one?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the examples, what's the starting origin? As long as you are same-origin I would expect a referrer to be included, but once you've gone cross-origin once, it should no longer be possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The starting origin in all cases is
example.onion
. It issues two 307 redirects.In the first example, it goes from
example.onion
toexample.onion/anotherpage
before ending onexample.com
.In the second example, it goes from
example.onion
toexample.com
before ending onexample.onion/anotherpage
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the user navigates to the starting origin? I guess then the scenarios would work. (Typically with fetching there's a starting document with some kind of authority and that would do the fetching, which could then result in a redirect. The initial 307 threw me off.)
Assuming the user does the navigation I'd expect:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct. However, I just realized that I made a mistake in my description of the test cases, which probably threw you off.
What I meant was:
example.onion/index.html
.example.onion/another.html
.example.onion/another.html
is a 307 redirect toexample.com
.example.com
with anull
Origin
header.The second test case is:
example.onion/index.html
.example.com
.example.com
is a 307 redirect toexample.onion/another.html
.example.onion/another.html
with anull
Origin
header.I had the same expectations as you (regarding the
example.com
tainting due to the redirect) and that's what I implemented in Brave, but Tor Browser returns anOrigin
ofexample.onion
in the second case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like a pretty serious bug. @KershawChang @valenting ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've filed bug 1742784 for this.