chore(api): add extra XSS protections to SVG icon endpoint (#2433)

This commit is contained in:
James Ward
2026-08-23 09:57:37 -06:00
committed by GitHub
parent 5c535d85eb
commit f8c45da98a
@@ -49,6 +49,8 @@ public class IconController {
public ResponseEntity<String> getSvgIconContent(@Parameter(description = "SVG icon name") @PathVariable String svgName) {
String svgContent = iconService.getSvgIcon(svgName);
return ResponseEntity.ok()
.header("Content-Security-Policy", "default-src 'none'; frame-ancestors 'none'; style-src 'self' 'unsafe-inline'")
.header("X-Content-Type-Options", "nosniff")
.header("Content-Type", "image/svg+xml")
.body(svgContent);
}