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

check_origin doesn't consider 'null' origin? #1466

Open
dfguerrerom opened this issue Oct 28, 2024 · 3 comments
Open

check_origin doesn't consider 'null' origin? #1466

dfguerrerom opened this issue Oct 28, 2024 · 3 comments
Labels

Comments

@dfguerrerom
Copy link

Description

In my custom application, I’m encountering a problem with browser request headers. Specifically, when I use Firefox, the Origin header in my request gets set to null, whereas in Chrome, the Origin is set correctly. This discrepancy is causing issues in my application’s behavior.

Reproduce

I'm not sure why Mozilla sets it as 'null' so I don't know how to reproduce.

I noticed that every time I closed a voila application, my kernels remained there and were not disposed, even though the /shutdown/ call was done, the request it was blocked with the following warning:

[W 2024-10-28 15:03:46.454 ServerApp] Blocking Cross Origin API request for /api/sandbox/jupyter/voila/api/shutdown/0369031f-c2eb-4d57-b651-f0ee765c5858.  Origin: null, Host: myhost.io

I’m unsure if this is a bug or intended behavior, but I noticed that the check_origin function in the JupyterHandler doesn't account for cases where Origin is null. I would expect the Origin header to behave consistently across both browsers.

  • Operating System and version: Ubuntu
  • Browser and version:
    Fails: User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
    Works: User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
  • Jupyter Server version: 2.14.2
@vidartf
Copy link
Member

vidartf commented Nov 1, 2024

This sounds like it would be related to this? https://www.mozilla.org/en-US/security/advisories/mfsa2015-03/

@vidartf
Copy link
Member

vidartf commented Nov 1, 2024

@vidartf
Copy link
Member

vidartf commented Nov 1, 2024

PS: While I recognize that the issue I linked is an older one (and supposedly fixed), it explicitly lists not including the origin header as an issue of the browser that is not per spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants