National Cyber Warfare Foundation (NCWF)login

svg-sanitizer for stripping XSS payloads out of untrusted SVG uploads


0 user ratings
2026-10-28 19:28:07
milo
Red Team (CNA)
"svg-sanitizer

svg-sanitizer is a PHP library that filters untrusted SVG/XML content against strict whitelists, neutralizing XSS vectors in user-supplied files within authorized applications and defensive research.








Tooldarylldoyle/svg-sanitizer — PHP SVG/XML sanitizer filtering tags, attributes, and remote references
CategoryPHP security library / input sanitization
Primary UseCleaning user-uploaded or embedded SVG files before rendering, preventing script injection and XSS in web applications
Safe UseIntended for developers and authorized security teams hardening their own applications, upload pipelines, and CMS deployments such as WordPress, Drupal, and TYPO3
Telemetry NotePure server-side library; leaves no attacker-visible footprint. getXmlIssues() returns structured parse/sanitize errors useful for defensive logging and upload-audit trails

svg-sanitizer from darylldoyle/svg-sanitizer is a PHP library built around one narrow, well-defined problem: user-supplied SVG files are executable attack surface, not images. Because SVG is XML that browsers parse as live documents, an uploaded avatar or logo can carry

 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.