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

Prevent leaking the secret to cross origins #722

Merged
merged 1 commit into from
Nov 27, 2020
Merged

Conversation

gregod
Copy link
Contributor

@gregod gregod commented Nov 27, 2020

Currently the secret is exposed to third parties (CDN , Google) through the referrer sent for the linked asset requests. "Referrer : http://pluto-server:1234/?secret=XXXX"

This is a quick-fix proposal to set a Referrer-Policy on each http request. The header instructs browsers to send only the origin part of the url as referrer on cross origin requests.

For a better fix (and better offline support #241 ) i would suggest removing the external dependencies altogether. This could either be done via "vendorizing" them by keeping a local copy (lowest initial maintenance impact) or switching to a build script for the front end (requires build step). Let me know if you want me to contribute something.

This prevents leaking the secrets stored in the url query parameter to third party servers. The header instructs browsers to send only the origin part of the url as referrer on cross origin requests.
@fonsp
Copy link
Owner

fonsp commented Nov 27, 2020

Thanks! Let us know if you find anything else :)

We will probably solve 241 by 'scraping' for asset URLs and bundling those into a Julia artifact. The frontend service worker will then use the Pluto backend as a cache (I think).

@fonsp fonsp merged commit 4061586 into fonsp:master Nov 27, 2020
@fonsp
Copy link
Owner

fonsp commented Feb 23, 2022

I changed this to same-origin (which is more restrictive) in e6b55d1

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

Successfully merging this pull request may close these issues.

None yet

2 participants