-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block cross-origin GET,HEAD requests with mismatched Referer
- /files/ downloads must come from a local page (no direct visits or external links) - same for /api/ requests - disabling xsrf checks
- Loading branch information
Showing
1 changed file
with
57 additions
and
1 deletion.
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
7f7bfee
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.
This commit breaks IE file downloads since it sends no referrer!!! Test please!
7f7bfee
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.
@minrk This commit breaks the Download Files (On Chrome and Firefox) - when running jupyter notebook behind a reverse proxy. Behind reverse proxy I have CORS settings as NotebookApp.allow_origin = "*",
Since in this scenario the origin of GET /files/ request (Download) will not be the same as host (on which jupyter notebook is running). Origin: https://test.example.com and host: 10.0.0.108:8000 .
Also NotebookApp.allow_origin = "*" also has no effect on check_referer() method, since it checks
**self.allow_origin == origin**
Is it possible to add another check in
check_referer()
method for the above use case - as there is a same kind of check incheck_origin()
method - the following check.The issue is officially reported at #4541
7f7bfee
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.
This commit has been mentioned on Jupyter Community Forum. There might be relevant details there:
https://discourse.jupyter.org/t/feature-idea-jupyter-books-as-a-landing-page-for-hub-log-ins/7831/13