Skip to content

Commit

Permalink
Update default CSP directive
Browse files Browse the repository at this point in the history
Add form-action directive to default CSP header. Limit form target to
'self'.
  • Loading branch information
sbreker committed Jan 14, 2025
1 parent 9a278dd commit 6edb7f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ all:
directives: >
default-src 'self';
font-src 'self' https://fonts.gstatic.com;
form-action 'self';
img-src 'self' https://*.googleapis.com https://*.gstatic.com *.google.com *.googleusercontent.com data: https://www.gravatar.com/avatar/ https://*.google-analytics.com https://*.googletagmanager.com blob:;
script-src 'self' https://*.googletagmanager.com 'nonce' https://*.googleapis.com https://*.gstatic.com *.google.com https://*.ggpht.com *.googleusercontent.com blob:;
style-src 'self' 'nonce' https://fonts.googleapis.com;
Expand Down
2 changes: 1 addition & 1 deletion docker/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function get_host_and_port($value, $default_port)
htmlpurifier_enabled: false
csp:
response_header: Content-Security-Policy-Report-Only
directives: "default-src 'self'; font-src 'self'; img-src 'self' https://www.gravatar.com/avatar/ https://*.google-analytics.com https://*.googletagmanager.com blob:; script-src 'self' https://*.googletagmanager.com 'nonce'; style-src 'self' 'nonce'; worker-src 'self' blob:; connect-src https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com; frame-ancestors 'self';"
directives: "default-src 'self'; font-src 'self'; form-action 'self'; img-src 'self' https://www.gravatar.com/avatar/ https://*.google-analytics.com https://*.googletagmanager.com blob:; script-src 'self' https://*.googletagmanager.com 'nonce'; style-src 'self' 'nonce'; worker-src 'self' blob:; connect-src https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com; frame-ancestors 'self';"
EOT;

file_put_contents(_ATOM_DIR.'/apps/qubit/config/app.yml', $app_yml);
Expand Down

0 comments on commit 6edb7f7

Please sign in to comment.