Self-XSS to PII leak via Same Origin Method Execution to admin ATO via DQLi— SMS V2 CyCTF 2025 Quals
A self-XSS in the dashboard's username field was escalated using Same Origin Method Execution (SOME) to steal a developer's API key, which then allowed a DQL injection to extract the admin password reset token and take over the admin account.
بس� الله، والصلاة والسلا� على رسول الله الح� د لله الذي عَلَّ� َ بالقل� .. عَلَّ� َ الإنسانَ � ا ل� يَعْلَ� والصلاةُ والسلا� ُ على خيرِ � ُعَلِّ� ي الناسِ الخير � ح� د
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application used Twig's raw filter without escaping on the username field, creating a self-XSS, and also concatenated user input directly into a DQL query without sanitisation.
Impact
An attacker could steal a developer's API key and then extract the admin password reset token to take over the admin account.
What the attacker needed
Victim (developer) visits attacker-supplied link; attacker has a registered account; attacker can host a malicious page
How it was found
- The attacker registers an account with a username containing a script that sends the parent window's content to the attacker's server.
- The attacker reports a URL that opens a page which in turn opens a second page containing a form that logs the victim into the attacker's account.
- The first page redirects itself to the developer's API endpoint, so the second page (same origin) can access it via window.opener.
- The form auto-submits after a short delay, logging the developer into the attacker's account and triggering the stored self-XSS.
- The script in the username executes and sends the parent window's content (the API key) to the attacker.
- The attacker uses the stolen API key to access a feedback search endpoint and performs a boolean-based DQL injection to extract the admin's password reset token character by character.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A self-XSS is a cross-site scripting bug that only affects the person who enters the malicious code, so it is usually useless on its own. Here, the attackers used a browser feature called Same Origin Method Execution to make the victim's browser run that code in a different page on the same website, letting them steal a secret API key. They then used that key to access a search feature that was vulnerable to a database query injection, which let them read the admin's password reset token and take over the admin account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.