Move from X-Frame-Options to Content-Security-Policy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Confirmed
|
High
|
Unassigned |
Bug Description
Currently one cannot embed Mahara within an iframe on third party site
This is due to:
X-Frame-Options = SAMEORIGIN
(see: https:/
And we can't allow specific external sites to embed mahara in an iframe (well at least not for all major browsers)
But good news there is: Content-
(see: https:/
Where we can specify which domains are allowed to show which things
But bad news - to get it to work we'd need to do bad things in relation to inline javascript
(see: https:/
Also we'd need to detect that we are in an external iframe before the page loads so we can set the headers to allow the correct external site (via init.php)
Currently we set the headers after $session starts and before we enable the $USER object
So we'd need to add something to detect that we are in an iframe on an external site and that site is allowed to do this.
NOTE: some of our pages load in iframes themselves (via pieform submission)
Changed in mahara: | |
milestone: | none → 17.10.0 |
importance: | Undecided → High |
Changed in mahara: | |
status: | New → Confirmed |
Changed in mahara: | |
milestone: | 17.10.0 → 18.04.0 |
Changed in mahara: | |
milestone: | 18.04.0 → 18.10.0 |
Changed in mahara: | |
assignee: | nobody → Cecilia Vela Gurovic (ceciliavg) |
Changed in mahara: | |
assignee: | Cecilia Vela Gurovic (ceciliavg) → nobody |
We'll need to map out what we can do since we have user generated content. Mahara already has a site config option to disallow external content. This should probably be wrapped into the CSP.