Interactive Laboratory

CSP DEFENDER

Configure security directives to block hacker payloads. Keep your website functional without breaking user features!

MISSION BRIEFING: Level 1: The Inline Menace

Your application runs an inline initialization script `<script nonce="secure-123">initApp()</script>` to configure the theme layout. A hacker is attempting to inject a malicious inline script block containing a credential logger.

✔ APP REQUIREMENT:Allow your app’s inline initialization script (which uses nonce "secure-123") to run.
✖ HACKER THREAT:Block standard inline scripts injected by hackers (which do not have a nonce).
CHOOSE CSP DIRECTIVES

Select which source blocks to load inside your Sandbox policy segment.

sandbox terminal
sandbox policy code:default-src 'self'
Website Health
N/A
Shield Integrity
N/A
Interactive sandbox output logs
🏆 Sentinel Badge Level

Defeat all 4 level exploits to earn the S-Tier sentinel badge. Share your progress to unlock pink mode!

Cleared0 / 4 Levels

How CSP Shields Web Apps

Content Security Policy (CSP) is an HTTP header that lets you instruct the browser to restrict resource origins. Even if a script is successfully injected into the HTML (XSS), the browser will refuse to compile or execute it unless it explicitly conforms to your CSP constraints.