[Bug bounty | mail.ru] Access to the admin panel of the partner site and data disclosure of 2 million users
A blind XSS vulnerability in a shop's order fields allowed the attacker to execute a script in the admin panel of a partner site, gaining access to the personal data of over 2 million users and the ability to log into their accounts without a password. Additionally, an autologin link in the shop's authentication could be brute-forced or indexed to access accounts.
{{media:0}}
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.
Context
This write-up covers work done against the mail.ru bug bounty program on HackerOne. The author moved from testing random sites to bug bounty programs, and chose mail.ru to build reputation on HackerOne. Over roughly three months of part-time work, 3,000 subdomains were sorted and checked one by one, and 45 valid vulnerabilities were submitted (40 fixed at the time of writing, 5 in "triaged" status).
The main target described here is redacted_shop.mail.ru, an online store of branded products. The site supports two login methods: OAuth through o2.mail.ru, or entering an email address. In the second method the user enters an email, the web app sends a code, the user submits it through a form and is logged in. The store also has a personal account area with forms for changing personal data and delivery addresses, and a checkout flow with an order comment field.
Setup
The researcher worked against the mail.ru program on HackerOne. The tools mentioned are dirb with a custom dictionary for directory discovery, and Burp Intruder for parsing user records. A server under the researcher's control was used to receive blind XSS callbacks (the "sniffer"). No account roles, versions or other preconditions are described beyond a normal customer account on the shop.
Finding it
Testing started from the personal account functionality. While examining the email-code login flow, the author noticed that the message sent to the user contains not only the code but also a link of the form redacted_shop.mail.ru/?login=hV8oUH. Visiting that link logs the user straight into the account. This is an "autologin" link, a pattern that used to exist on old WAP sites and is now almost never used because of its insecurity. This was the first vulnerability, classified as Improper Authentication.
After that, directories were searched with dirb, and the forms for changing personal data and delivery addresses were tested. CSRF tokens were present in the forms and attempts to bypass that protection failed. Fuzzing found no XSS and no hints of other issues in those forms.
Exploitation
Step 1: Autologin link analysis
The login link sent alongside the code is:
redacted_shop.mail.ru/?login=hV8oUH
The login parameter carries a short identifier that authenticates the visitor automatically. The author lists two consequences:
- An attacker can brute-force the identifiers, learn many autologin values and enter other people's accounts.
- The login links can be indexed by search engines and appear in Google results, where an attacker can parse them. Even when a search robot is disallowed in
robots.txt, URLs can still be indexed without content.
A PoC URL of the same form, redacted_shop.mail.ru/?login=hV8oUH, worked while the report was being written. Later an analyst said the bug could not be reproduced, apparently because the autologin functionality had been disabled by the developers, so neither password recovery nor login through the link was possible. A couple of months later the functionality was found to be enabled again; the developers were told, and it was finally fixed a few days before the article.
Step 2: Blind XSS through stored fields
The researcher changed his own data and delivery address to JavaScript payloads, then placed a test order and entered another JavaScript payload in the comment field. The exact payloads are not reproduced in the report.
At 00:10 the blind XSS script executed in the admin panel at admin.undefined.com/index, a site the researcher did not know, and logs arrived on his server. The expectation at that point was that cookies would be protected by the HttpOnly flag, so access to the admin panel did not seem likely.

The cookie was not protected by the HttpOnly flag, and the researcher successfully entered the admin area. The panel looked like a CMS from around 2000 to 2006: very old design, poor performance with long page loads, and many PHP and SQL errors. The main page made clear that the panel belonged to mail.ru and that orders from redacted_shop.mail.ru were managed through this third-party site. The team later said the panel belonged to a partner and that redacted_shop.mail.ru was not developed by mail.ru. This confirmed the second vulnerability, Blind XSS.
Step 3: What the admin panel exposed
Inside the panel it was possible to view, edit and delete orders of all users from 10 online stores, some of them large, and to view personal data of 2,017,271 users, including email addresses, telephone numbers and home addresses. Each user page also carried an autologin link, which would have allowed entering that user's account without a password.
A one-click database download existed, but the download functionality itself threw a PHP error, so the practical path was searching users by id in the panel and parsing the results with Burp Intruder.
Step 4: Reporting and shutdown
A report with details was sent on HackerOne at 00:20. At about 00:43 Sergey Belov, head of application security at mail.ru, replied and asked the researcher to stop post-exploitation of the blind XSS and leave the admin panel immediately, which he did.
The next morning the bug was checked again: no logs arrived at the server, so it could be assumed fixed. Access to the admin panel was also closed, apparently restricted by IP address only.
Because redacted_shop.mail.ru was not in scope for the mail.ru program, the vulnerability could not be rewarded there. The researcher contacted the developers of the admin panel itself and was paid a reward by them.
Step 5: The autologin report
The Improper Authentication issue was also submitted to the program, with the full expectation that it was hard to exploit and would earn reputation points only. The PoC was the autologin URL redacted_shop.mail.ru/?login=hV8oUH, which worked at the time of writing. The analyst later reported that it could not be reproduced, apparently because the developers had disabled autologin.
Root cause
Two separate design mistakes are described.
First, the login flow issued a bearer-style autologin URL next to the one-time code. Anyone holding the URL is authenticated, so the secret travels in a place that can leak through brute force, search engine indexing, referrers or logs.
Second, user-controlled fields (profile data, delivery address, order comment) were rendered in the partner admin panel without output encoding, so a stored script executed in the administrator's browser. The session cookie for that panel lacked the HttpOnly flag, so the script could read it and the researcher could replay it. The panel also ran outdated software and produced PHP and SQL errors, which widened the attack surface.
Impact
With the autologin link, an attacker could enter other users' accounts, either by brute-forcing identifiers or by harvesting indexed links. With the blind XSS, an attacker could take over an administrator session and from there view, edit and delete orders across 10 online stores and read personal data of 2,017,271 users, including email addresses, telephone numbers and home addresses. The autologin link attached to each user page in the panel would additionally allow entering any of those accounts without a password. The one-click database export was broken by a PHP error, so bulk extraction depended on enumerating users by id.
Fix
The next morning no callbacks arrived, so the blind XSS could be assumed fixed, and access to the admin panel was closed, apparently by IP restriction. The analyst could not reproduce the autologin bug, apparently because the developers had disabled it; a couple of months later it was found enabled again, the developers were told, and it was finally fixed a few days before the article.
The report's own recommendations:
- Never use autologins in authorisation.
- Close access to the admin panel with a 403 via
.htaccesson Apache, restrict access by IP address and require authentication, so that stolen cookies or other data cannot be used. - Do not use outdated software in the admin panel.
- Always filter the forbidden characters
["<> '/]in information that reaches the admin area, to avoid XSS.
Variants to test
- Autologin parameters on other shops. Look for parameters such as
?login=in emails, SMS and password-reset messages. A positive result is a URL that authenticates a fresh browser session without any other credential. - Search engine exposure of login links. Query the site with common search operators for URLs containing the autologin parameter. A positive result is indexed links that still authenticate.
- Blind XSS in profile and address fields. Set name, address and similar fields to a callback payload, then place an order. A positive result is a callback from an admin panel or internal tool, as happened here at 00:10.
- Blind XSS in order comments and complaint forms. Submit a payload in the comment field, in a complaint about a page or user, and in site evaluation forms. A positive result is a callback from an admin panel or internal tool.
- User-Agent and log injection. Replace the user agent with a script, since logs shown in an admin panel may not be filtered. A positive result is execution inside the panel's log view.
- Filter bypass with alternative tags. When
<script>is filtered, trymetaandimgpayloads, and close surrounding tags so they do not break execution. A positive result is a callback from any of these. - Cookie flag check. When a callback returns a session cookie, inspect whether
HttpOnlyis set. A positive result is a cookie value that can be replayed to reach the panel. - Rate limiting on OTP login. On sites that log in with an OTP sent to a phone number, test whether the code can be enumerated without restriction, as was found on
am.ru. A positive result is many attempts accepted without lockout. - Email disclosure through image endpoints. Test parameters such as
cp-filin.mail.ru/[email protected]on article pages. A positive result is a page that reveals the viewer's email address in the HTML source or local storage.
What happened, in plain words
A security researcher spent about three months, part time, looking for bugs in websites that belong to mail.ru, a large Russian internet company. Companies like this run a "bug bounty" programme: they publicly invite people to try to break their systems, and they pay or thank the people who report real problems. The researcher chose mail.ru partly because the programme runs on HackerOne, a well-known platform where such reports are filed and tracked, and doing well there builds a reputation.
Over that period he sorted through 3,000 subdomains (separate sites under the mail.ru name, like shop.mail.ru or pets.mail.ru) and checked them one by one. He submitted 45 valid vulnerabilities; 40 were fixed by the time he wrote the article and 5 were still being processed ("triaged", meaning the company had looked at them and accepted them for handling).
This article is about one of those sites, an online shop of branded products at redacted_shop.mail.ru. Two things went wrong there. First, the shop's email login sent users, alongside the code, a link that logged them in automatically. Second, text the researcher typed into his own profile, delivery address and order comment was later displayed, unfiltered, inside an administration panel used by the shop's staff. That let a small script he planted run inside the staff member's browser and hand him the staff session, which opened the door to the panel. From there he could see orders from 10 online stores and personal data of 2,017,271 users.
He reported it within minutes, was asked to stop and leave, and did so. The shop's own domain was not covered by the mail.ru bounty programme, so the reward for the panel access came from the company that made the panel. The login-link bug was reported to the programme and eventually fixed.
Background: the programme and the target
The mail.ru programme lives on HackerOne. A "programme" here is simply a set of rules: which of the company's systems you are allowed to test (the "scope"), what kinds of findings are wanted, and what happens after you report. Anything outside the scope is off limits, and findings there usually earn nothing, even if they are serious. Keep that in mind, because it matters later.
The target, redacted_shop.mail.ru, is an online store of branded products. It has two ways to log in:
- OAuth through
o2.mail.ru. OAuth is a way for one website to let another website confirm who you are, without the second site ever seeing your password. Think of a cloakroom ticket: you show it, you get your coat, and the attendant never needs your house key. - Email address plus a code. You type your email, the site sends you a message containing a code, you type the code into a form, and you are in. This is called a one-time code because it is meant to be used once and then be worthless.
The store also has a personal account area with forms for changing your personal data and your delivery address, and a checkout flow with a field for a comment on the order. Those three places are where the researcher later planted his test scripts.
The tools and the setup
No special access was needed: a normal customer account on the shop was enough. The report mentions three tools:
dirb, run with a custom dictionary.dirbis a program that tries a long list of common folder and file names against a website and tells you which ones exist. A "dictionary" is just that list of names. It is like walking down a corridor trying every door handle instead of guessing which doors are real.- Burp Intruder, part of the Burp Suite toolkit. It takes a request and repeats it many times with one part changed each time (for example, a user id counting up from 1), which is how you collect many records quickly.
- A server under the researcher's control, used as a "sniffer". A sniffer here is simply a machine that waits for incoming connections and writes down what arrives. When a planted script runs somewhere else, it can be told to contact this server, so the researcher learns that it ran and what it saw.
Finding it
Testing started, as it often does, with the personal account area. While going through the email-code login, the researcher noticed something extra in the message the shop sends: besides the code to type into the form, the message also contains a link of this shape:
redacted_shop.mail.ru/?login=hV8oUH
Visiting that link logs you straight into the account. No code, no password. This pattern is called an "autologin" link, and it used to be common on old WAP sites (WAP was the stripped-down web that early mobile phones could display). It is almost never used today because of exactly this weakness. The researcher classified it as Improper Authentication: the site is checking that you hold a secret, but the secret is a link that travels in email, can be guessed, and can end up in places you do not control.
After that, he ran dirb to look for directories, then tested the forms for changing personal data and delivery addresses. Those forms contained CSRF tokens. CSRF (Cross-Site Request Forgery) is an attack where a different website quietly makes your browser submit a form on a site you are logged into; a CSRF token is a random value embedded in the form that the other site cannot know, so the submission is rejected. The tokens were present and attempts to get around them failed. Fuzzing (feeding the forms lots of odd input to see if anything breaks) found no XSS and no hints of other problems there.
Exploitation
Step 1: The autologin link
The link sent alongside the code is:
redacted_shop.mail.ru/?login=hV8oUH
Line by line, there is only one line, but it has parts worth naming:
redacted_shop.mail.ruis the site being visited.?starts the query string, the part of a URL that carries data to the site.login=hV8oUHis one parameter namedloginwith the valuehV8oUH. That short value is the identifier that authenticates the visitor automatically.
Why this matters, in the researcher's own two points:
- Guessing. If the identifiers are short and there is no limit on attempts, an attacker can try many values (a brute-force attack) and find working ones, then enter other people's accounts.
- Search engines. Links can be indexed by search engines and show up in Google results, where an attacker can collect them. Even when a search robot is disallowed in
robots.txt(a file that asks crawlers not to visit certain paths), URLs can still be indexed without their content.
A proof of concept (PoC) is a small demonstration that a bug is real. The PoC here was the same URL, redacted_shop.mail.ru/?login=hV8oUH, and it worked while the report was being written. Later an analyst said the bug could not be reproduced, apparently because the developers had switched the autologin feature off, so neither password recovery nor login through the link worked any more. A couple of months later the feature was found to be switched on again; the researcher told the developers, and it was finally fixed a few days before the article was published.
Step 2: Blind XSS through stored fields
Next, the researcher changed his own profile data and delivery address to JavaScript payloads, then placed a test order and put another JavaScript payload in the comment field. A payload here is just the piece of text you submit, designed to be interpreted as code later. The exact payloads are not reproduced in the report.
XSS (Cross-Site Scripting) is a bug where text you supply is later shown to someone else as if it were part of the page, so the browser runs it as code. It is "blind" when you cannot see the result yourself: the text is displayed somewhere you have no access to, such as a staff tool, and you only find out it ran when it contacts your server.
At 00:10 the script executed in an admin panel at admin.undefined.com/index, a site the researcher did not know, and logs arrived on his server. At that point he did not expect to get into the panel, because session cookies are usually protected by the HttpOnly flag. A cookie is a small piece of data a site stores in your browser so it can recognise you on the next request; a session cookie is the one that says "this browser is logged in as this user". HttpOnly is a setting that stops JavaScript from reading that cookie, so even a successful XSS cannot steal it.

The cookie was not protected by the HttpOnly flag, and the researcher successfully entered the admin area. The panel looked like a content management system (CMS, software for running a site's pages and content) from around 2000 to 2006: a very old design, slow page loads, and plenty of PHP and SQL errors on screen. PHP is a programming language commonly used for websites; SQL is the language used to talk to databases. Error messages like these are useful to an attacker because they reveal how the system is built. The panel's main page made clear that it belonged to mail.ru and that orders from redacted_shop.mail.ru were managed through this third-party site. The team later said the panel belonged to a partner and that redacted_shop.mail.ru was not developed by mail.ru. This confirmed the second vulnerability, Blind XSS.
Step 3: What the admin panel exposed
Inside the panel it was possible to view, edit and delete orders of all users from 10 online stores, some of them large, and to view personal data of 2,017,271 users, including email addresses, telephone numbers and home addresses. Each user page also carried an autologin link, which would have allowed entering that user's account without a password.
There was a one-click database download, but the download feature itself threw a PHP error, so the practical route was to search users by id in the panel and collect the results with Burp Intruder, one id after another.
Step 4: Reporting and shutdown
A report with details was sent on HackerOne at 00:20. At about 00:43 Sergey Belov, head of application security at mail.ru, replied and asked the researcher to stop post-exploitation of the blind XSS and leave the admin panel immediately, which he did. "Post-exploitation" means everything you do after you have got in: looking around, reading data, taking screenshots. Stopping on request is part of the deal in a bounty programme.
The next morning the bug was checked again: no logs arrived at the server, so it could be assumed fixed. Access to the admin panel was also closed, apparently restricted by IP address only. An IP address is the number that identifies a connection on the internet; restricting by IP means only certain addresses may connect.
Because redacted_shop.mail.ru was not in scope for the mail.ru programme, the vulnerability could not be rewarded there. The researcher contacted the developers of the admin panel itself and was paid a reward by them.
Step 5: The autologin report
The Improper Authentication issue was also submitted to the programme, with the full expectation that it was hard to exploit and would earn reputation points only. The PoC was the autologin URL redacted_shop.mail.ru/?login=hV8oUH, which worked at the time of writing. The analyst later reported that it could not be reproduced, apparently because the developers had disabled autologin.
Root cause
Two separate design mistakes are described.
First, the login flow issued a bearer-style autologin URL next to the one-time code. "Bearer" means the thing itself is the proof: whoever holds the URL is treated as the user, like a cinema ticket that anyone can use. So the secret travels in a place that can leak through brute force, search engine indexing, referrers (the address of the previous page that a browser sends along) or logs.
Second, user-controlled fields (profile data, delivery address, order comment) were rendered in the partner admin panel without output encoding, so a stored script executed in the administrator's browser. Output encoding means converting characters like < and > into harmless text so the browser shows them instead of running them. The session cookie for that panel lacked the HttpOnly flag, so the script could read it and the researcher could replay it, that is, send the same cookie from his own machine and be treated as the logged-in administrator. The panel also ran outdated software and produced PHP and SQL errors, which widened the attack surface.
Impact
With the autologin link, an attacker could enter other users' accounts, either by brute-forcing identifiers or by harvesting indexed links. With the blind XSS, an attacker could take over an administrator session and from there view, edit and delete orders across 10 online stores and read personal data of 2,017,271 users, including email addresses, telephone numbers and home addresses. The autologin link attached to each user page in the panel would additionally allow entering any of those accounts without a password. The one-click database export was broken by a PHP error, so bulk extraction depended on enumerating users by id.
Fix
The next morning no callbacks arrived, so the blind XSS could be assumed fixed, and access to the admin panel was closed, apparently by IP restriction. The analyst could not reproduce the autologin bug, apparently because the developers had disabled it; a couple of months later it was found enabled again, the developers were told, and it was finally fixed a few days before the article.
The report's own recommendations:
- Never use autologins in authorisation.
- Close access to the admin panel with a 403 via
.htaccesson Apache, restrict access by IP address and require authentication, so that stolen cookies or other data cannot be used. A 403 is the HTTP status code for "forbidden";.htaccessis a per-folder configuration file used by the Apache web server. - Do not use outdated software in the admin panel.
- Always filter the forbidden characters
["<> '/]in information that reaches the admin area, to avoid XSS.
Variants to test
- Autologin parameters on other shops. Look for parameters such as
?login=in emails, SMS and password-reset messages. A positive result is a URL that authenticates a fresh browser session without any other credential. - Search engine exposure of login links. Query the site with common search operators for URLs containing the autologin parameter. A positive result is indexed links that still authenticate.
- Blind XSS in profile and address fields. Set name, address and similar fields to a callback payload, then place an order. A positive result is a callback from an admin panel or internal tool, as happened here at 00:10.
- Blind XSS in order comments and complaint forms. Submit a payload in the comment field, in a complaint about a page or user, and in site evaluation forms. A positive result is a callback from an admin panel or internal tool.
- User-Agent and log injection. Replace the user agent (the text your browser sends to identify itself) with a script, since logs shown in an admin panel may not be filtered. A positive result is execution inside the panel's log view.
- Filter bypass with alternative tags. When
<script>is filtered, trymetaandimgpayloads, and close surrounding tags so they do not break execution. A positive result is a callback from any of these. - Cookie flag check. When a callback returns a session cookie, inspect whether
HttpOnlyis set. A positive result is a cookie value that can be replayed to reach the panel. - Rate limiting on OTP login. On sites that log in with an OTP (one-time password) sent to a phone number, test whether the code can be enumerated without restriction, as was found on
am.ru. A positive result is many attempts accepted without lockout. - Email disclosure through image endpoints. Test parameters such as
cp-filin.mail.ru/[email protected]on article pages. A positive result is a page that reveals the viewer's email address in the HTML source or local storage. HTML source is the page's underlying text; local storage is a small store of data a site keeps in your browser.
Glossary
- Admin panel: a private website used by staff to manage orders, users and content.
- Autologin: a link that logs you in just by visiting it, with no password or code.
- Blind XSS: cross-site scripting where the injected script runs somewhere you cannot see, such as a staff tool, and reports back to you.
- Brute force: trying many possible values until one works.
- Bug bounty programme: a public offer by a company to reward people who report real security bugs in its systems.
- Burp Intruder: a tool that repeats a request many times with one part changed each time.
- Callback: a connection a planted script makes back to a server you control, proving it ran.
- CMS: content management system, software for running a website's pages and content.
- Cookie: a small piece of data a site stores in your browser to recognise you later.
- CSRF: cross-site request forgery, an attack where another site makes your browser submit a form on a site you are logged into.
- CSRF token: a random value in a form that another site cannot know, used to block CSRF.
- dirb: a program that tries a list of common folder and file names against a website.
- Fuzzing: feeding a system lots of odd input to see whether anything breaks.
- HackerOne: a platform where bug bounty programmes are run and reports are filed.
- HTML source: the underlying text of a web page.
- HTTP status code: a number a server returns to say what happened, such as 403 for forbidden.
- HttpOnly: a cookie setting that stops JavaScript from reading the cookie.
- Identifier: a value that identifies something, here the short code in the autologin link.
- Improper Authentication: a flaw in how a site checks who you are.
- IP address: the number that identifies a connection on the internet.
- Local storage: a small store of data a website keeps in your browser.
- OAuth: a way for one site to confirm who you are through another site, without sharing your password.
- One-time code / OTP: a code meant to be used once, often sent by email or SMS.
- Output encoding: turning characters like
<and>into harmless text so a browser displays them instead of running them. - Parameter: a named value in a URL, such as
login=hV8oUH. - Payload: the text you submit, designed to be interpreted as code later.
- PHP: a programming language commonly used for websites.
- PoC (proof of concept): a small demonstration that a bug is real.
- Post-exploitation: everything done after getting in, such as reading data or taking screenshots.
- Query string: the part of a URL after
?that carries data to the site. - Rate limiting: a cap on how many attempts are allowed in a period.
- Referrer: the address of the previous page, sent by the browser with a request.
- Replay: sending a stolen cookie from your own machine to be treated as the logged-in user.
- robots.txt: a file that asks search engine crawlers not to visit certain paths.
- Scope: the set of systems a bounty programme allows you to test.
- Session cookie: the cookie that says which user a browser is logged in as.
- Sniffer: here, a server that waits for incoming connections and records what arrives.
- SQL: the language used to talk to databases.
- Subdomain: a separate site under a main name, such as shop.mail.ru under mail.ru.
- Triaged: a report that has been reviewed and accepted for handling by the programme.
- User agent: the text a browser sends to identify itself.
- WAP: the stripped-down web that early mobile phones could display.