diff --git a/data/quests.json b/data/quests.json index 53c388e..844489e 100644 --- a/data/quests.json +++ b/data/quests.json @@ -995,6 +995,31 @@ ], "difficulty": "Hard", "status": "live" + }, + { + "id": "xss-defender", + "name": "XSS Defender", + "shortDescription": "Interactive web security quest game teaching Cross-Site Scripting (XSS) prevention, HTML sanitization, and Content Security Policy (CSP) headers.", + "longDescription": "## XSS Defender\n\nAn interactive web security quest game that teaches Cross-Site Scripting (XSS) prevention, HTML sanitizer policies (DOMPurify / HTML Sanitizer API), and Content Security Policy (CSP) directive configurations.\n\n### Features\n\n- Interactive XSS Attack Simulator: Live rendering of attack payloads in an isolated preview sandbox\n- Progressive Security Levels: Level-based scenarios covering Reflected XSS entity encoding, DOM sanitization policies, CSP headers, and event handler attribute injections\n- Real-Time Vulnerability Analyzer: Live feedback indicating whether script execution was blocked or succeeded\n- Web Audio Synthesizer SFX: Audio feedback for firewall alerts, sanitization shield activations, and level completion fanfares\n- Built-In Web Security Manual: Cheatsheet covering XSS prevention guidelines and CSP directive syntax", + "category": "js-fundamentals", + "tags": [ + "csp", + "dompurify", + "game", + "quest", + "sanitizer", + "security", + "web-security", + "xss" + ], + "techStack": [ + "CSS3", + "HTML5", + "Vanilla JS", + "Web Audio API" + ], + "difficulty": "Medium", + "status": "live" } ] } diff --git a/quests/xss-defender.html b/quests/xss-defender.html new file mode 100644 index 0000000..69089f4 --- /dev/null +++ b/quests/xss-defender.html @@ -0,0 +1,539 @@ + + + + + + + XSS Defender — One File Tools Quest + + + + + + + +
+
+ +
+

XSS Defender Studio

+
+
+
+ + + + + +
+
+ +
+ +
+
+ FIREWALL SHIELD + 🛡️ 100% SECURE +
+
+ SECURITY THREAT + ⚠️ Reflected XSS Vector +
+
+ CURRENT LEVEL + LEVEL 1 / 4 +
+
+ + +
+ +
+

Level 1: Reflected XSS & Entity Encoding

+
User URL search query is directly rendered into innerHTML without encoding!
+ +
MALICIOUS ATTACK PAYLOAD
+
<script>alert('XSS Stolen Cookie: ' + document.cookie)</script>
+ + Select Sanitizer Code Patch: +
+ +
+ + +
+
+
+ + +
+

Payload Sandbox Inspector

+ +
+ UNSANITIZED RENDER (VULNERABLE) +
<script>alert('XSS')</script>
+ + SANITIZED OUTPUT (SECURED) +
&lt;script&gt;alert('XSS')&lt;/script&gt;
+
+
+
+
+ + + + + + + diff --git a/quests/xss-defender.png b/quests/xss-defender.png new file mode 100644 index 0000000..ae15f59 Binary files /dev/null and b/quests/xss-defender.png differ