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

Origin header set to null causing 403 by IPFS API #955

Closed
benaryorg opened this issue Jan 1, 2021 · 4 comments · Fixed by #957
Closed

Origin header set to null causing 403 by IPFS API #955

benaryorg opened this issue Jan 1, 2021 · 4 comments · Fixed by #957
Assignees
Labels
area/firefox Issues related to Mozilla Firefox need/analysis Needs further analysis before proceeding P0 Critical: Tackled by core team ASAP

Comments

@benaryorg
Copy link

Describe the bug

There seems to be a regression akin to #622.
On my Windows box with Firefox 85.0b4 (not on the Linux one with 84.0.1 though) this has persisted for some time (a week or two?).
Checking the debugging tools the Windows box sends Origin: null (being rejected by IPFS with a 403, unless I add "null" as a CORS domain, my current workaround) while the Linux box still sends Origin: http://127.0.0.1:5001.

To Reproduce

  1. stock settings seem to suffice, but only on that box?

Expected behavior

I'd expect the origin to match the localhost-ish domain, thereby passing the validation.

Desktop

OS Windows 10
Browser Firefox 85.0b4
IPFS Companion Version 2.16.0
@benaryorg benaryorg added the need/triage Needs initial labeling and prioritization label Jan 1, 2021
@jessicaschilling
Copy link
Contributor

Thanks - we'll look in more detail in our next triage session.

@ipfs ipfs deleted a comment from welcome bot Jan 1, 2021
@lidel
Copy link
Member

lidel commented Jan 2, 2021

I'll look deeper into this in next two weeks, but can confirm something changed in Firefox 85
XHR request made to IPFS API is now sent with different set of headers: not only Origin, but also Sec- ones:

Firefox 84 (OK) Firefox 86.0a1 (403 Forbidden)
2021-01-02--02-11-20 2021-01-02--02-11-42

In 2018, we had similar issues related to the way browsers handle XHR HTTP requests sent from the background page of our browser extension (#622, #616), this could be Firefox trying to align with what Chromium does, or a bug (or both).

Additional research is needed, but I'm marking this as P0 because if breaks Companion in Firefox 85+

@lidel lidel added need/analysis Needs further analysis before proceeding P0 Critical: Tackled by core team ASAP labels Jan 2, 2021
@lidel lidel self-assigned this Jan 2, 2021
@lidel lidel pinned this issue Jan 2, 2021
@jessicaschilling jessicaschilling added area/firefox Issues related to Mozilla Firefox and removed need/triage Needs initial labeling and prioritization labels Jan 4, 2021
lidel added a commit that referenced this issue Jan 7, 2021
Closes #955 and refactors the way we detect requests coming from the
Companion extension to be independent from the brittle Origin HTTP
header. Instead, we now inspet request via lower level WebExtension API.

Added tests for both Firefox in Chromium.
@lidel lidel closed this as completed in #957 Jan 7, 2021
lidel added a commit that referenced this issue Jan 7, 2021
Closes #955 and refactors the way we detect requests coming from the
Companion extension to be independent of the brittle Origin HTTP
header. Instead, we now inspect request via lower level WebExtension API.
@lidel
Copy link
Member

lidel commented Jan 7, 2021

@benaryorg @fellowish

A fix for Firefox 85+ shipped to Beta channel: v2.16.0.990.
Let us know if you experience any issues. Thanks again for reporting this!

@lidel lidel unpinned this issue Jan 20, 2021
@rafalohaki
Copy link

have the same problem like #952

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/firefox Issues related to Mozilla Firefox need/analysis Needs further analysis before proceeding P0 Critical: Tackled by core team ASAP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants