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

shell: Add iframe sandbox to restrict frame Origin #6260

Closed
wants to merge 5 commits into from

Conversation

stefwalter
Copy link
Contributor

@stefwalter stefwalter commented Apr 2, 2017

This prevents one frame from accessing stuff in another frame.
Models the security model that we're going for better, where stuff
loaded from one server should not access stuff in another server.

@stefwalter stefwalter added blocked Don't land until something else happens first (see task list) release-blocker Targetted for next release question Further information is requested labels Apr 2, 2017
@stefwalter
Copy link
Contributor Author

@petervo Do you think we should leave this sandbox off for frames on the localhost?

@petervo
Copy link
Contributor

petervo commented Apr 3, 2017

Doesn't this block the parent cookie from being sent along with the http requests from the iframe? The cookie is needed there for the html/js files to load.

@stefwalter
Copy link
Contributor Author

Doesn't this block the parent cookie from being sent along with the http requests from the iframe? The cookie is needed there for the html/js files to load.

I don't think so. It prevents the javascript from accessing the cookies, but not use in the request. At least that's what I understood, and saw in practice here.

…igin

In order to use <iframe> sandbox attribute and split various frames into
their own origin, we have to specify very cleary that these frames are
allowed to access the main origin server side.

This involves two things:

 * Further clarifying all the Content-Security-Policy headers
   to include our own Origin in addition to 'self'
 * Adding Access-Control-Allow-Origin headers with our own Origin

Closes cockpit-project#6258

Signed-off-by: Peter Volpe <[email protected]>
 * Respect and forward incoming headers
When running in an <iframe> sandbox the window.localStorage can have
its access denied, so handle this case.
This prevents one frame from accessing stuff in another frame.
Models the security model that we're going for better, where stuff
loaded from one server should not access stuff in another server.
If we're navigating to another URL in a window, or are closing the
window, make sure to send an explicit hint to the parent.
@martinpitt martinpitt removed the release-blocker Targetted for next release label Apr 6, 2017
@stefwalter stefwalter added needswork and removed question Further information is requested labels Apr 7, 2017
@martinpitt martinpitt changed the title shell: Add <iframe> sandbox to restrict frame Origin shell: Add iframe sandbox to restrict frame Origin Apr 10, 2017
@marusak
Copy link
Member

marusak commented Jul 23, 2019

Needs to rebase to master since #12367 changed tests names

@martinpitt
Copy link
Member

Closing for now, to clean up our stale PR list. This would be a great feature to have, but in the next months we have more urgent issues to address. It will take someone else quite some time to get up to speed with this code, so this will be quite a large project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Don't land until something else happens first (see task list) needs-rebase needswork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants