The forgotten API and XSS filter bypass
An older version of a forum's group API (groupsV2) lacked the input sanitisation present in the current version (groupsV3), allowing an attacker to inject a script that executes when a post is viewed. The attacker bypassed a secondary filter that removed quotes and parentheses by using a template literal expression to call alert.
Published on bergee.it
On one site I found the forum section. There was an option to join some groups and then create posts in the group.
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
Impact
An attacker could execute arbitrary JavaScript in the browser of any user viewing the forum post, potentially stealing session data or performing actions on their behalf.
What the attacker needed
A free account; ability to join an open group; victim views the forum post
How it was found
- Create an account and join an open group.
- Create a forum post containing a script payload.
- Observe that the payload is sanitised and does not execute.
- Change the URL path from groupsV3 to groupsV2.
- Post a payload that avoids quotes and parentheses using a template literal expression.
- Observe the alert box pop up.
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 website had two versions of its forum software: an old one and a new one. The new one cleaned up dangerous code that users typed into posts, but the old one did not. By changing the web address to point at the old version, the attacker could post a small piece of code that runs in other users' browsers and shows a pop-up message.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.