{% extends "base.html" %} {% block title %}Lab Tasks - CVE-2026-5026 Lab{% endblock %} {% block content %}
CVE-2026-5026 - Stored XSS via Malicious SVG Upload
Progress
Task 1 - Basic XSS Alert
Upload an SVG that triggers alert("Task 1 complete with success!!") when rendered.
Task 2 - Cookie Exfiltration
Send session cookie to attacker-controlled listener
Task 3 - Authenticated Action
POST on behalf of victim, capture the flag
Why SVGs are dangerous
Unlike JPEG or PNG, SVG files are XML documents parsed and executed by the browser.
Any <script> tag or event handler
(e.g. onload=) inside an SVG runs
in the context of the hosting page — with full access to document.cookie,
the DOM, and the user's authenticated session.
When the server stores and serves these files inline without sanitization, any user who views the file executes the attacker's code — this is Stored XSS.
Mitigations
1. SVG Sanitization (DOMPurify)
2. Content Security Policy
3. Serve SVGs as attachment (not inline)
4. Server-side MIME validation
5. HttpOnly cookies + CSRF tokens