mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-12 11:13:11 +08:00
fix: remove unsafe-inline from script-src in CSP example
'unsafe-inline' for script-src negates XSS protection from CSP. Removed it from the security headers example in quarkus-security and all locale copies. Kept 'unsafe-inline' for style-src only (commonly needed by CSS frameworks) with a comment recommending nonces where possible.
This commit is contained in:
@@ -380,9 +380,10 @@ public class SecurityHeadersFilter implements ContainerResponseFilter {
|
||||
// HSTS
|
||||
headers.putSingle("Strict-Transport-Security", "max-age=31536000; includeSubDomains");
|
||||
|
||||
// CSP
|
||||
// CSP — script-src için 'unsafe-inline' kullanmayın, XSS korumasını etkisiz kılar;
|
||||
// bunun yerine nonce veya hash kullanın
|
||||
headers.putSingle("Content-Security-Policy",
|
||||
"default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'");
|
||||
"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user