fix(boardwalk): add form-action and frame-src to the admin CSP
- form-action 'self': injected markup cannot post a native form off-origin - frame-src 'none': no framed content; a sandboxed srcdoc preview is not fetched and still renders - header tests, README and admin-spa docs name the directives
This commit is contained in:
@@ -310,7 +310,7 @@ func TestSecurityHeadersOnEveryResponse(t *testing.T) {
|
||||
"X-Content-Type-Options": "nosniff",
|
||||
"Referrer-Policy": "same-origin",
|
||||
"X-Frame-Options": "DENY",
|
||||
"Content-Security-Policy": "frame-ancestors 'none'; base-uri 'none'; object-src 'none'; script-src 'self'",
|
||||
"Content-Security-Policy": "frame-ancestors 'none'; base-uri 'none'; object-src 'none'; script-src 'self'; form-action 'self'; frame-src 'none'",
|
||||
"X-Robots-Tag": "noindex, nofollow",
|
||||
} {
|
||||
if got := rec.Header().Get(header); got != want {
|
||||
@@ -482,7 +482,7 @@ func TestPhase101BoardwalkExports(t *testing.T) {
|
||||
"X-Content-Type-Options": "nosniff",
|
||||
"Referrer-Policy": "same-origin",
|
||||
"X-Frame-Options": "DENY",
|
||||
"Content-Security-Policy": "frame-ancestors 'none'; base-uri 'none'; object-src 'none'; script-src 'self'",
|
||||
"Content-Security-Policy": "frame-ancestors 'none'; base-uri 'none'; object-src 'none'; script-src 'self'; form-action 'self'; frame-src 'none'",
|
||||
"X-Robots-Tag": "noindex, nofollow",
|
||||
}
|
||||
if len(h) != len(want) {
|
||||
|
||||
Reference in New Issue
Block a user