Sanatize SVG files, even when they try to hide themselves with a different extension

This commit is contained in:
Jan Böhmer 2026-06-17 22:38:41 +02:00
parent 98df91d785
commit 02726fdf69

View file

@ -543,8 +543,10 @@ class AttachmentSubmitHandler
return $attachment;
}
$guessed_mime_type = $this->mimeTypes->guessMimeType($path);
//Check if the file is an SVG
if ($attachment->getExtension() === "svg") {
if ($guessed_mime_type === "image/svg+xml" || $attachment->getExtension() === "svg") {
$this->SVGSanitizer->sanitizeFile($path);
}