Уязвимость Создание фотографий без ведома пользователей
- Triaged in 46 days
- Fixed in 3 months
- Paid in 3 months
- Disclosed after 20 months
## Summary by the program
CSRF, позволяющий загрузить фотографию на сайт от имени атакуемого, без публикации.
## Summary by the researcher
При пере�
оде на специально сгенерированную ссылку VK.COM
(или на сайт с вредоносным кодом) на ID пользователя автоматически добавлялась фотография (моя)
i die
███████████████████████████
███████▀▀▀░░░░░░░▀▀▀███████
████▀░░░░░░░░░░░░░░░░░▀████
███│░░░░░░░░░░░░░░░░░░░│███
██▌│░░░░░░░░░░░░░░░░░░░│▐██
██░└┐░░░░░░░░░░░░░░░░░┌┘░██
██░░└┐░░░░░░░░░░░░░░░┌┘░░██
██░░┌┘▄▄▄▄▄░░░░░▄▄▄▄▄└┐░░██
██▌░│██████▌░░░▐██████│░▐██
███░│▐███▀▀░░▄░░▀▀███▌│░███
██▀─┘░░░░░░░▐█▌░░░░░░░└─▀██
██▄░░░▄▄▄▓░░▀█▀░░▓▄▄▄░░░▄██
████▄─┘██▌░░░░░░░▐██└─▄████
█████░░▐█─┬┬┬┬┬┬┬─█▌░░█████
████▌░░░▀┬┼┼┼┼┼┼┼┬▀░░░▐████
█████▄░░░└┴┴┴┴┴┴┴┘░░░▄█████
███████▄░░░░░░░░░░░▄███████
██████████▄▄▄▄▄▄▄██████████
███████████████████████████What the report shows
The target is VK.com, and the feature involved is photo upload. The program's own summary describes the issue as a CSRF that lets an attacker upload a photograph to the site on behalf of the victim, without publishing it.
The researcher's summary is equally short. When a user followed a specially generated link to VK.COM, or visited a site containing malicious code, a photograph (the researcher's own) was automatically added to that user's ID. In other words, the victim did not choose to upload anything; the upload happened as a side effect of loading attacker-controlled content while the victim was logged in.
The report contains no HTTP request, no parameter list, no proof-of-concept page and no response excerpt, so the exact endpoint and form fields used for the upload are not shown. What we have is the behaviour: a crafted link or a page with malicious code triggers a photo upload tied to the victim's account.
The report was disclosed on 9 February 2017, carries a bounty of 300.00 USD, and is classified as Cross-Site Request Forgery (CSRF). No severity rating or CVSS score is given, and the report does not describe the fix.
Root cause
The report does not identify the root cause. A CSRF would imply the upload request was accepted without a reliable check that it came from VK's own pages, but the specific missing control is not stated. If the upload request is authenticated purely by the victim's session cookie, then any page the victim visits can cause the browser to send that request, and the server will treat it as a legitimate upload. The report does not identify the specific missing control, so whether the gap was a missing anti-CSRF token, a missing origin check, or a token that could be predicted or reused is not stated.
Impact
The impact described is limited but real: an attacker can attach a photograph of their choosing to a victim's account without the victim's knowledge. The program explicitly notes that the photo is not published, which keeps the impact below anything like content injection into a public profile. Still, unauthorised content appearing in a user's photo albums is an integrity problem. The report does not claim any further consequence, and none should be assumed.
How this kind of bug works
CSRF abuses the fact that browsers attach credentials (cookies, and in some setups HTTP authentication) to requests automatically, regardless of which site initiated them. If a server performs an action based only on the presence of a valid session, an attacker who can make the victim's browser issue a request to that server can trigger the action. Classic vectors are a hidden auto-submitting form, an image tag pointing at a GET endpoint, or a script that fires a request cross-origin. Modern browsers restrict reading cross-origin responses, but they do not stop the request from being sent, which is enough when the side effect is what matters.
Uploads are a common place for this because they are often implemented as multipart form posts to a dedicated endpoint, sometimes with permissive content types, and developers focus on file validation rather than on request provenance. Defences are well understood: synchroniser tokens bound to the session, double-submit cookies with proper validation, checking the Origin and Referer headers, requiring re-authentication for sensitive actions, and using SameSite cookie attributes so that cross-site requests do not carry the session at all.
How to test for it
A general method for hunting this class:
- Identify state-changing endpoints: uploads, profile edits, message sends, friend requests, settings changes. Watch the traffic while performing the action normally and note the method, URL, content type and every parameter.
- Check whether the request carries an unpredictable token tied to the session. If there is no token, or the token is identical across sessions, or it is accepted when removed, the endpoint is a candidate.
- Reproduce the request from a different origin. Build a page on a separate host that submits the same request, log in as a test user, load the page, and observe whether the action occurs. For multipart uploads, a plain HTML form with the right enctype is usually enough.
- Try variations: remove the token, swap it for a token from another session, change the request method, and test whether the server checks Origin or Referer at all.
- A positive result is a side effect on the victim's account that the victim never initiated, observed from a page on a different origin.
Common false positives: the action requires a token that the attacker cannot obtain; the endpoint checks Origin or Referer and rejects foreign values; the cookie is SameSite=Strict or Lax and the request is cross-site; the action is a GET that only reads data; or the browser blocks the request because of mixed content or CORS preflight. Confirm the effect with a clean session and a second account before reporting.
How it is fixed
The standard fixes are: require a per-session, unpredictable anti-CSRF token on every state-changing request and validate it server-side; verify the Origin header (and Referer as a fallback) against an allowlist; set session cookies with SameSite=Lax or Strict where compatible with the product; and, for high-impact actions, require the user to re-enter credentials or confirm explicitly. Upload endpoints should also validate file type and size server-side, though that is a separate concern from CSRF.
Hunting notes
CSRF tends to hide in older or less-exercised parts of an application: upload forms, settings pages, admin panels, and endpoints that were built before a framework-wide token was introduced. Recon signals include endpoints that accept multipart form data, actions that return a simple success page rather than JSON, and any request where the token parameter is absent or looks static across accounts. When you find a candidate, demonstrate impact with a minimal proof of concept: a page that performs the action, a description of the victim's state before and after, and a note on what the attacker gains. Programs accept CSRF reports far more readily when the action is clearly unauthorised and the proof shows the side effect on a real account.
What happened, in plain words
VK.com is a large social network. One of its features lets a logged-in user upload photographs to their own account. The report describes a way for someone else to make that upload happen on a victim's account without the victim doing anything.
The program's summary calls it a CSRF that lets an attacker upload a photograph to the site on behalf of the victim, without publishing it. CSRF stands for Cross-Site Request Forgery: a trick where one website causes your browser to send a request to another website, using the login you already have there.
The researcher's summary is just as short. When a user followed a specially generated link to VK.COM, or visited a site containing malicious code, a photograph (the researcher's own) was automatically added to that user's ID. The victim never chose to upload anything. The upload happened as a side effect of loading content the attacker controlled, while the victim was logged in.
The report contains no HTTP request, no parameter list, no proof-of-concept page and no response excerpt. The exact endpoint and form fields used for the upload are not shown. What we have is the behaviour: a crafted link, or a page with malicious code, triggers a photo upload tied to the victim's account.
The report was disclosed on 9 February 2017, carries a bounty of 300.00 USD, and is classified as Cross-Site Request Forgery (CSRF). No severity rating or CVSS score is given, and the report does not describe the fix.
Why this matters
The impact is limited but real. An attacker can attach a photograph of their choosing to a victim's account without the victim's knowledge. The program explicitly notes that the photo is not published, which keeps the impact below anything like content injection into a public profile. Still, unauthorised content appearing in a user's photo albums is an integrity problem. The report does not claim any further consequence, and none should be assumed.
In general, how this kind of bug works
To understand CSRF, start with two everyday ideas.
A cookie is a small piece of data a website stores in your browser after you log in. On every later request to that site, your browser attaches the cookie automatically, like a membership card you show at the door without thinking about it. That is how the site knows it is still you.
A request is the message your browser sends to a server when you click a link, submit a form or load a page. It contains a method (such as GET or POST), a URL, and often a body with data.
CSRF abuses the fact that browsers attach credentials (cookies, and in some setups HTTP authentication) to requests automatically, regardless of which site initiated them. If a server performs an action based only on the presence of a valid session, an attacker who can make the victim's browser issue a request to that server can trigger the action. Classic vectors are a hidden auto-submitting form, an image tag pointing at a GET endpoint, or a script that fires a request cross-origin. Modern browsers restrict reading cross-origin responses, but they do not stop the request from being sent, which is enough when the side effect is what matters.
Uploads are a common place for this because they are often implemented as multipart form posts to a dedicated endpoint, sometimes with permissive content types, and developers focus on file validation rather than on request provenance. Defences are well understood: synchroniser tokens bound to the session, double-submit cookies with proper validation, checking the Origin and Referer headers, requiring re-authentication for sensitive actions, and using SameSite cookie attributes so that cross-site requests do not carry the session at all.
In general, how to test for it
A general method for hunting this class:
- Identify state-changing endpoints: uploads, profile edits, message sends, friend requests, settings changes. Watch the traffic while performing the action normally and note the method, URL, content type and every parameter.
- Check whether the request carries an unpredictable token tied to the session. If there is no token, or the token is identical across sessions, or it is accepted when removed, the endpoint is a candidate.
- Reproduce the request from a different origin. Build a page on a separate host that submits the same request, log in as a test user, load the page, and observe whether the action occurs. For multipart uploads, a plain HTML form with the right enctype is usually enough.
- Try variations: remove the token, swap it for a token from another session, change the request method, and test whether the server checks Origin or Referer at all.
- A positive result is a side effect on the victim's account that the victim never initiated, observed from a page on a different origin.
Common false positives: the action requires a token that the attacker cannot obtain; the endpoint checks Origin or Referer and rejects foreign values; the cookie is SameSite=Strict or Lax and the request is cross-site; the action is a GET that only reads data; or the browser blocks the request because of mixed content or CORS preflight. Confirm the effect with a clean session and a second account before reporting.
In general, how it is fixed
The standard fixes are: require a per-session, unpredictable anti-CSRF token on every state-changing request and validate it server-side; verify the Origin header (and Referer as a fallback) against an allowlist; set session cookies with SameSite=Lax or Strict where compatible with the product; and, for high-impact actions, require the user to re-enter credentials or confirm explicitly. Upload endpoints should also validate file type and size server-side, though that is a separate concern from CSRF.
In general, where to look
CSRF tends to hide in older or less-exercised parts of an application: upload forms, settings pages, admin panels, and endpoints that were built before a framework-wide token was introduced. Recon signals include endpoints that accept multipart form data, actions that return a simple success page rather than JSON, and any request where the token parameter is absent or looks static across accounts. When you find a candidate, demonstrate impact with a minimal proof of concept: a page that performs the action, a description of the victim's state before and after, and a note on what the attacker gains. Programs accept CSRF reports far more readily when the action is clearly unauthorised and the proof shows the side effect on a real account.
Glossary
- CSRF (Cross-Site Request Forgery): a trick where one website makes your browser send a request to another website using your existing login there.
- Cookie: a small piece of data a site stores in your browser, sent back automatically with later requests, often used to keep you logged in.
- Session: the period during which a site recognises you as logged in, usually tracked by a cookie.
- Request: the message a browser sends to a server, with a method, a URL and sometimes a body of data.
- GET / POST: two request methods; GET is typically used to fetch a page, POST to submit data such as a form.
- Endpoint: a specific URL on a server that performs a particular action.
- Multipart form post: a way of sending a form, including files, as one request body split into parts.
- Origin: the combination of scheme, host and port that identifies where a request came from.
- Referer: a header telling the server which page the request came from.
- Anti-CSRF token: an unpredictable value tied to your session that a request must include, so a foreign site cannot forge it.
- SameSite: a cookie setting that controls whether the cookie is sent on requests started by other sites.
- CORS: browser rules that limit how one site can read responses from another.
- CVSS: a scoring system for the severity of a vulnerability.
- Bounty: a payment a program gives a researcher for a valid report.
- Proof of concept: a minimal demonstration that the bug works.
- False positive: a suspected bug that turns out not to be exploitable.