Skip to content
CSRF Disclosed report Beginner

Создание ссылки от имени чужой страницы vk.cc

The vk.cc link-shortening service accepted requests to add a link to another user's page without verifying that the request came from that user. An attacker could therefore create a short link that appears to belong to someone else's page.

pisarenko Follow

Originally disclosed on HackerOne

Bounty$200 Medium View original
  • Paid in 14 days
  • Disclosed after 6 months

Summary by the program

CSRF на добавление ссылки в vk.cc на чужой странице.

Summary by the researcher

Обнаружена CSRF которая дает возможность добавить любому пользователю свою ссылку на vk.com/cc

i die

███████████████████████████ ███████▀▀▀░░░░░░░▀▀▀███████ ████▀░░░░░░░░░░░░░░░░░▀████ ███│░░░░░░░░░░░░░░░░░░░│███ ██▌│░░░░░░░░░░░░░░░░░░░│▐██ ██░└┐░░░░░░░░░░░░░░░░░┌┘░██ ██░░└┐░░░░░░░░░░░░░░░┌┘░░██ ██░░┌┘▄▄▄▄▄░░░░░▄▄▄▄▄└┐░░██ ██▌░│██████▌░░░▐██████│░▐██ ███░│▐███▀▀░░▄░░▀▀███▌│░███ ██▀─┘░░░░░░░▐█▌░░░░░░░└─▀██ ██▄░░░▄▄▄▓░░▀█▀░░▓▄▄▄░░░▄██ ████▄─┘██▌░░░░░░░▐██└─▄████ █████░░▐█─┬┬┬┬┬┬┬─█▌░░█████ ████▌░░░▀┬┼┼┼┼┼┼┼┬▀░░░▐████ █████▄░░░└┴┴┴┴┴┴┴┘░░░▄█████ ███████▄░░░░░░░░░░░▄███████ ██████████▄▄▄▄▄▄▄██████████ ███████████████████████████

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The target is VK.com, and the feature in question is the link shortener at vk.cc. The program's own summary describes the issue as a CSRF on adding a link to vk.cc on someone else's page.

The researcher's summary states that a CSRF vulnerability was found which allows adding a link to vk.com/cc on behalf of any user. In other words, a CSRF flaw lets a link be added to vk.com/cc on behalf of any user.

The report itself is very short. It contains no request, no payload, no parameter names and no reproduction steps beyond the two summaries above. The only other content is a line of text and an ASCII-art figure. There is therefore nothing to copy into a request block: the report does not include the HTTP traffic that triggers the bug.

The outcome recorded by the platform is a medium severity rating, a bounty of 200.00 USD, and disclosure on 2017-09-20. The report does not describe the fix that was applied.

Root cause

The report points to a state-changing action, creating a short link, that could be triggered from a third-party page in the context of an authenticated victim. The report does not describe the root cause. The report does not identify which of these applied.

Impact

The impact described is that a link can be added to vk.cc on behalf of any user. Those consequences are not claimed here and should not be assumed from this report.

How this kind of bug works

CSRF abuses the fact that browsers attach a user's credentials (cookies, and in some setups HTTP authentication or client certificates) to requests automatically, regardless of which site caused the request. If a server performs a sensitive action based only on the presence of a valid session, any page on the internet can cause that action by making the victim's browser send the request.

Two properties make an endpoint reachable this way. First, the request must be expressible as a "simple" cross-origin request: a form submission, an image or script load, or a fetch with a content type such as application/x-www-form-urlencoded, multipart/form-data or text/plain. These are sent without a CORS preflight, so the attacker does not need the target to grant cross-origin read access. Second, the server must not require anything the attacker cannot know or set, such as a per-session random token, a re-authentication step, or a header that only same-origin script can add.

Defences work by making the request unforgeable or by refusing to act on cross-site requests. Synchroniser tokens bind each state-changing request to a value stored in the user's session. Double-submit cookies compare a cookie value with a request parameter. SameSite cookie attributes stop the browser from sending the session cookie on cross-site requests. Checking the Origin or Referer header rejects requests that did not come from the expected site. Requiring a custom header or a JSON content type forces a preflight that a plain cross-site form cannot satisfy.

How to test for it

  1. Identify state-changing endpoints: anything that creates, modifies or deletes data tied to the account, such as creating a resource, changing settings, or adding a link. Watch the traffic while using the feature normally.
  2. Capture the request and note its method, content type, and every parameter, especially any token-like field.
  3. Replay the request in a fresh session with the token removed, blanked, or replaced with a value from a different session. If the action still succeeds, the token is not being enforced.
  4. Rebuild the request as a cross-site form post or a simple GET from a page on a different origin, and load that page while authenticated as the victim. A positive result is that the action completes and the effect is visible in the victim's account.
  5. Check whether the endpoint accepts alternative methods or content types that bypass a token check applied only to the expected format.

Common false positives: the action succeeding when replayed with the victim's own token in the same browser (that is not CSRF); endpoints that are idempotent or harmless; requests that require a value the attacker cannot predict; and cases where the session cookie is SameSite-restricted so the browser never sends it cross-site. Confirm the effect from a genuinely separate origin and a separate attacker-controlled page before reporting.

How it is fixed

Require a per-session anti-CSRF token on every state-changing request and validate it server-side. Set session cookies with an appropriate SameSite value. Verify the Origin header, or the Referer as a fallback, against an allowlist of expected origins. Reject state changes on GET and require a content type or custom header that cannot be produced by a simple cross-site form. For sensitive actions, consider re-authentication.

Hunting notes

CSRF tends to hide in older or secondary features: settings pages, integrations, shorteners, sharing and import functions, and endpoints that were added before a framework-wide token policy existed. Recon signals include endpoints that accept form-encoded bodies, actions triggered by GET links, and features whose requests carry no token parameter while neighbouring features do. To make a report convincing, show the exact request, the attacker page that triggers it, and the observable effect in the victim's account, and state clearly what the victim would have to do (visit a page, click a link). Programs accept reports far more readily when the impact is concrete and demonstrated end to end.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

VK.com runs a link shortener at vk.cc. A shortener takes a long web address and gives you a short one that redirects to it, a bit like a cloakroom ticket: the ticket is small, but it points to the coat you left behind.

The program's summary describes the bug as a CSRF on adding a link to vk.cc on someone else's page. The researcher's summary says a CSRF vulnerability was found that allows adding a link to vk.com/cc on behalf of any user. In plain terms: a CSRF flaw lets a link be added to vk.com/cc on behalf of any user.

That is the whole of the technical content. The report contains no request, no payload, no parameter names and no reproduction steps beyond those two summaries. The remaining lines are a short line of text and an ASCII-art figure. So there is no HTTP traffic to show here: the report does not include the request that triggers the bug.

The platform recorded a medium severity rating, a bounty of 200.00 USD, and disclosure on 2017-09-20. The report does not describe the fix that was applied.

Why it matters

The impact described is narrow and specific: a link can be added to vk.cc on behalf of any user. The report does not say what further harm follows, such as damage to the victim's reputation, misleading short links attributed to them, or use of the shortener as an open redirect. Those consequences are not claimed here and should not be assumed from this report.

In general, how this kind of bug works

CSRF stands for Cross-Site Request Forgery. To understand it, start with two everyday ideas.

A cookie is a small piece of data a website asks your browser to store and send back with every request to that site. After you log in, the site puts a session cookie in your browser, and that cookie is what tells the server "this is the same person who logged in earlier". You never see it; the browser attaches it automatically.

A request is what your browser sends to a server when you do something: open a page, submit a form, click a button. It contains a method (such as GET or POST), a URL, and often some data.

The problem is that the browser attaches your cookies to requests regardless of which site caused the request. If you are logged in to VK in one tab and open a completely unrelated page in another, that unrelated page can make your browser send a request to VK, and your VK cookie goes along with it. The server sees a valid session and cannot tell that you never intended the action. CSRF abuses exactly this: the attacker's page borrows your logged-in identity to perform an action you did not choose.

Two properties make an endpoint reachable this way:

  1. The request must be expressible as a "simple" cross-origin request: a form submission, an image or script load, or a fetch with a content type such as application/x-www-form-urlencoded, multipart/form-data or text/plain. These are sent without a CORS preflight, so the attacker does not need the target to grant cross-origin read access.
  2. The server must not require anything the attacker cannot know or set, such as a per-session random token, a re-authentication step, or a header that only same-origin script can add.

A token here means a random value the server gives your session and expects back with sensitive requests. Because the attacker's page cannot read it, it cannot include it, and the forged request fails.

Defences work by making the request unforgeable or by refusing to act on cross-site requests. Synchroniser tokens bind each state-changing request to a value stored in the user's session. Double-submit cookies compare a cookie value with a request parameter. SameSite cookie attributes stop the browser from sending the session cookie on cross-site requests. Checking the Origin or Referer header rejects requests that did not come from the expected site. Requiring a custom header or a JSON content type forces a preflight that a plain cross-site form cannot satisfy.

In general, how to test for it

  1. Identify state-changing endpoints: anything that creates, modifies or deletes data tied to the account, such as creating a resource, changing settings, or adding a link. Watch the traffic while using the feature normally.
  2. Capture the request and note its method, content type, and every parameter, especially any token-like field.
  3. Replay the request in a fresh session with the token removed, blanked, or replaced with a value from a different session. If the action still succeeds, the token is not being enforced.
  4. Rebuild the request as a cross-site form post or a simple GET from a page on a different origin, and load that page while authenticated as the victim. A positive result is that the action completes and the effect is visible in the victim's account.
  5. Check whether the endpoint accepts alternative methods or content types that bypass a token check applied only to the expected format.

Common false positives: the action succeeding when replayed with the victim's own token in the same browser (that is not CSRF); endpoints that are idempotent or harmless; requests that require a value the attacker cannot predict; and cases where the session cookie is SameSite-restricted so the browser never sends it cross-site. Confirm the effect from a genuinely separate origin and a separate attacker-controlled page before reporting.

In general, how it is fixed

Require a per-session anti-CSRF token on every state-changing request and validate it server-side. Set session cookies with an appropriate SameSite value. Verify the Origin header, or the Referer as a fallback, against an allowlist of expected origins. Reject state changes on GET and require a content type or custom header that cannot be produced by a simple cross-site form. For sensitive actions, consider re-authentication.

In general, where to look

CSRF tends to hide in older or secondary features: settings pages, integrations, shorteners, sharing and import functions, and endpoints that were added before a framework-wide token policy existed. Recon signals include endpoints that accept form-encoded bodies, actions triggered by GET links, and features whose requests carry no token parameter while neighbouring features do. To make a report convincing, show the exact request, the attacker page that triggers it, and the observable effect in the victim's account, and state clearly what the victim would have to do (visit a page, click a link). Programs accept reports far more readily when the impact is concrete and demonstrated end to end.

Glossary

  • CSRF (Cross-Site Request Forgery): an attack where a page controlled by an attacker makes a victim's browser send a request to another site, using the victim's existing login.
  • Cookie: a small piece of data stored by the browser for a site and sent back with requests to it; session cookies identify a logged-in user.
  • Session: the server-side record of a logged-in user, linked to the browser by a session cookie.
  • Request: the message a browser sends to a server, with a method, a URL and often data.
  • GET / POST: HTTP methods; GET is normally used to fetch a page, POST to submit data.
  • Endpoint: a specific URL on a server that performs a particular action.
  • State-changing action: anything that creates, modifies or deletes data, as opposed to just reading it.
  • Token (anti-CSRF token): a random value tied to a session that a server requires with sensitive requests so that other sites cannot forge them.
  • Synchroniser token: a defence where the token is stored in the user's session and compared with the value sent in the request.
  • Double-submit cookie: a defence that compares a value in a cookie with the same value in a request parameter.
  • SameSite: a cookie attribute that limits whether the browser sends the cookie on requests started by other sites.
  • Origin / Referer: request headers that say which site a request came from; servers can check them against an allowlist.
  • CORS preflight: an automatic check the browser performs before certain cross-origin requests, which simple form posts avoid.
  • Content type: the label on request data saying what format it is in, such as application/x-www-form-urlencoded.
  • Open redirect: a link on a trusted site that sends visitors to an arbitrary external address.
  • Idempotent: an action that gives the same result whether performed once or many times.
  • False positive: a finding that looks like a bug but is not actually exploitable.
  • Recon: the exploratory phase of looking for weaknesses in a target.
  • Bounty: a payment a program gives a researcher for a valid report.

More by pisarenko

View all

29 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 request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.