Upload image or SVG for security audit
Scans for embedded web shells (PHP/ASP), SVG XSS scripts, and polyglot signatures
Application Security: Hardening Image Upload Endpoints
SVG is an XML-based vector format. Browsers naturally execute embedded JavaScript when an SVG is visited directly. Always serve user SVGs with Content-Disposition: attachment or sanitize them using DOMPurify.
The gold standard for avatar security: never serve raw user-uploaded bytes. Decode the image into memory and re-encode it as WebP or JPEG using a library like Sharp. This destroys any trailing web shells or polyglot payloads.
Host user uploads on a separate, cookie-less subdomain (e.g. media.example.com) with a strict CSP header: script-src 'none'.