Studio: restrict artifact frame embedding to same-origin
This commit is contained in:
parent
9b4d6256d3
commit
388128ef45
1 changed files with 5 additions and 0 deletions
|
|
@ -250,6 +250,7 @@ _ARTIFACT_PREVIEW_FRAME_CSP = (
|
|||
"object-src 'none'; "
|
||||
"base-uri 'none'; "
|
||||
"form-action 'none'; "
|
||||
"frame-ancestors 'self'; "
|
||||
"sandbox allow-scripts"
|
||||
)
|
||||
_ARTIFACT_PREVIEW_FRAME_HTML = """<!doctype html>
|
||||
|
|
@ -286,6 +287,10 @@ async def artifact_preview_frame():
|
|||
"Content-Security-Policy": _ARTIFACT_PREVIEW_FRAME_CSP,
|
||||
"Referrer-Policy": "no-referrer",
|
||||
"X-Content-Type-Options": "nosniff",
|
||||
# SAMEORIGIN for browsers that ignore frame-ancestors; the
|
||||
# SecurityHeadersMiddleware uses setdefault so this takes
|
||||
# precedence over the global DENY.
|
||||
"X-Frame-Options": "SAMEORIGIN",
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue