Origin set to extension when username/password provided in API URL. #919
Labels
effort/hours
Estimated to take one or several hours
exp/intermediate
Prior experience is likely helpful
kind/bug
A bug in existing code (including security flaws)
need/analysis
Needs further analysis before proceeding
P2
Medium: Good to have, but can wait until someone steps up
status/ready
Ready to be worked
Milestone
Describe the bug
When trying to use the new ipfs/ipfs-webui#836 Protected APIs feature, the requests sent by the extension appear to have the Origin set to
Origin: moz-extension://2a708cae-2cdd-45f2-83ff-2d7e331e4a6f
. When I remove the username/password from the URL, the origin is not set. This results in the request with the origin failing with a 403, while the request without the origin succeeds with a 200. All other headers appear to be the same between the requests (including Authorization and Host headers).To Reproduce
Steps to reproduce the behavior:
https://user:pass@domain
format.https://domain
format.Expected behavior
Adding a username/password doesn't result in a new Origin header being added to the request.
Desktop (please complete the following information):
Additional context
I have not been able to figure out why the request returns a 403 when the Origin header is present, it could be CloudFlare, it could be my reverse proxy, or it could be IPFS server. I strongly suspect it is a CORS thing though. I'm hoping that extensions have the ability to override the automatic origin header addition. If not, I'll probably have to dig a bit and figure out how to prevent CORS from blocking requests with an origin of
moz-extension://...
.The text was updated successfully, but these errors were encountered: