GHSL-2021-104: Cross-Site Scripting in countly-server - CVE-2021-32852
A cross-site scripting vulnerability exists in the reset.html template of countly-server because the backslash character is not escaped when inserting query parameters into a JavaScript string. An attacker could craft a malicious link that, when visited by a victim, executes arbitrary JavaScript in the victim's browser.
Originally disclosed on GitHub Security Lab
Cross-site scripting in https://github.com/Countly/countly-server
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The template engine escapes HTML characters but does not escape backslashes, allowing a backslash to break out of a JavaScript string literal.
Impact
An attacker could execute arbitrary JavaScript in the victim's browser, but the victim must click a malicious link and the attacker must have an account; it is unclear if the enterprise version is affected.
What the attacker needed
Attacker has an account; victim clicks a malicious link
The fix
The vulnerability was fixed in version 21.11.
How it was found
- Set the 'message' query parameter to a single backslash character.
- Set the 'password_min' query parameter to the string ', alert(1)); //'.
- Send the crafted link to a victim, who must click it or be redirected to it.
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 report has not been written yet. The Original tab links to the source.
This is a cross-site scripting (XSS) bug. The website takes text from the URL and puts it directly into a script without properly escaping special characters like backslashes. An attacker can make a link that, when clicked, runs their own code in the victim's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.