Sanitize SVG files #2212

Closed
opened 2026-10-05 01:09:57 +02:00 by adam · 1 comment
Owner

SVG files can contain embedded script or even SVG content + something else content and finfo_file will still consider the file as SVG. We need to sanitize the SVG file. @Renarde-dev has found this dedicated library https://github.com/darylldoyle/svg-sanitizer

SVG files can contain embedded script or even SVG content + something else content and `finfo_file` will still consider the file as SVG. We need to sanitize the SVG file. @Renarde-dev has found this dedicated library https://github.com/darylldoyle/svg-sanitizer <!-- github-sync-id:4330556443 -->
adam closed this issue 2026-10-05 01:09:57 +02:00
Author
Owner

I tested the library with a lot of valid and malicious SVGs, everything works.
SVG that contains MSL or href to local files are detected.

I tested the library with a lot of valid and malicious SVGs, everything works. SVG that contains MSL or `href` to local files are detected. <!-- github-comment-id:4335724761 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#2212