Security
SVG Security Risks & Safe Browser-Based Sanitization Explained
Because SVG is an XML dialect supported directly by browsers, an unsanitized .svg file can contain <script> blocks, onload event handlers, javascript: links, or <foreignObject> HTML payloads.
How SVGtoWebP.online Processes Files Safely
- We never inject SVG source into
innerHTMLor execute it as a document. - Every upload or pasted snippet is parsed with
DOMParser(..., 'image/svg+xml'), rejecting malformed XML and stripping<!DOCTYPE>/<!ENTITY>declarations. - An explicit tag and attribute allowlist removes scripts,
on*handlers, and unsafe URLs while preserving valid gradients, masks, clipPaths, and filters. - Rasterization runs inside an isolated
<img>Blob URL drawn onto Canvas 2D, and temporary object URLs are revoked immediately afterward.
Read the full technical specification in our Processing Methodology.