How a Stray Quote Unleashed XSS on an Unofficial Telegram Site
A search parameter on an unofficial Telegram group aggregator reflected user input without sanitisation, allowing an attacker to inject script that executed in the page. The author demonstrated an alert popup and a full-page defacement.
medium.com
Published on medium.com
I’ll never forget the moment — I was digging into tg‑me.com, an unofficial third‑party site for browsing Telegram groups. I was searching for a “leak database” group, typing queries into its search bar, hoping for results.
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
Likely the search parameter was reflected into the page without proper output encoding or input validation.
Impact
An attacker could run arbitrary script in a victim's browser on the site's domain, enabling page defacement and potentially theft of session data, though the text only demonstrates an alert and a defacement.
What the attacker needed
Victim visits a crafted link; no account needed
The fix
The site should validate and encode all user-supplied input before reflecting it into pages, and should not display raw database errors.
How it was found
- Enter a single quote in the search bar and observe a raw MySQL error.
- Run SQLMap and Ghauri against the order=latest GET parameter, which flagged possible injection and XSS.
- Try several payloads without success, then use an event-handler payload in the telegram-group URL path.
- Observe an alert popup confirming script execution.
- Replace the page content with a defacement payload to show full control.
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.
Cross-site scripting (XSS) happens when a website puts user-supplied text into a page without cleaning it first, so a browser treats that text as code. Here, typing a special character into the search box caused the site to show raw database errors, and later a crafted search link made the browser run attacker-supplied script.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.