Merge pull request #13927 from dashevchenko/svgCodeInjection

Malicious code injection into the SVG image vulnerability
This commit is contained in:
Viacheslav Klimov 2025-09-24 10:30:44 +03:00 committed by GitHub
commit 8e400fa2b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -300,6 +300,7 @@ public class ImageController extends BaseController {
tbImageService.putETag(cacheKey, descriptor.getEtag());
var result = ResponseEntity.ok()
.header("Content-Type", descriptor.getMediaType())
.header("Content-Security-Policy", "default-src 'none'")
.eTag(descriptor.getEtag());
if (!cacheKey.isPublic()) {
result