Stored XSS via SVG File Upload
Red social donde se pueden subir archivos SVG como avatares. Los SVGs se renderizan con etiquetas <object> que permiten la ejecucion de JavaScript embebido.
Learn to find this bug
This bug paid $750 on HackerOne.
Create your account and practice real bugs that got paid. Download the environment, find it and learn the exact technique — your path to your first bounty.
- hunters training
- 650
- labs from real reports
- 50
- completions
- 380
- in bounties practiced
- $200,000
hunters training
labs from real reports
completions
in bounties practiced
Access to all labs · no commitment · cancel anytime
Hunters who solved it· 8
Objectives
Achievement you'll earn
Solve this lab to unlock this shareable achievement
Stored XSS via SVG File Upload
Community writeups
Despliegue
# Opcion 1: autodeploy
./autodeploy.sh
# Opcion 2: manual
docker compose up --build
# Acceder
http://localhost:1000
Compatible con macOS, Linux y Windows (Docker Desktop / WSL).
Para parar:
./autodeploy.sh destroy
# o: docker compose down -v
Contenido del Lab
La aplicacion
Chirp con subida de avatares SVG renderizados con .
La vulnerabilidad
Los SVGs subidos se renderizan con <object> que ejecuta JavaScript embebido en el SVG (a diferencia de <img> que es seguro). Un SVG con <script>alert(1)</script> o onload=alert(1) se ejecuta.
Cadena de ataque
1. Crear SVG: <svg xmlns=...><script>alert(1)</script></svg>
2. Subir como avatar
3. Cualquier usuario que vea el perfil → XSS ejecutado
Solucion interactiva
Accede a /writeup dentro de la aplicacion para una guia paso a paso con botones interactivos.
Flag
(XSS ejecutado via SVG)
Remediacion
- Renderizar SVGs con
en vez de
- Sanitizar SVGs (eliminar scripts y event handlers)
- CSP que bloquee inline scripts
- Servir SVGs con Content-Disposition: attachment