Skip to content
CSRF Disclosed report Beginner

Login CSRF vulnerability on hackerone.com

The login form on the site accepted submissions without a valid authenticity token, so the CSRF protection was not actually enforced. An attacker could make a victim's browser log into an account the attacker controls, after which the victim might add payment details or other data to that account.

what_web Follow

Originally disclosed on HackerOne

Bounty$500 Low 3.8 View original
  • Triaged in 4 days
  • Fixed in 2 months
  • Paid in 46 days
  • Disclosed after 2 months

###Summary Hi. We found a CSRF token bypass on the Hacker One login page. So, this report describes Hacker One login CSRF Token Bypass.

###Exploitation process Hacker One uses the authenticity_token token during login to prevent CSRF. However, the authenticity_token token is not properly verified, so an attacker can log in via CSRF without the authenticity_token token. In other words, Hacker One thinks that it implemented CSRF token through authenticity_token token, but it is not.

###Steps To Reproduce

  1. Go to https://hackerone.com/users/sign_in
  2. While logging into your account, grab packets through the buff suit.
  3. Take the HTML code format from burp suite -> Engagement Tools -> Generate CSRF POC.
  4. Delete the authenticity token.
  5. Forward the request and CSRF exploited successfully and the modified data changed successfully :)

###PoC

JavaScript
<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="https://hackerone.com/users/sign_in" method="POST">
      <input type="hidden" name="user[email]" value="youremail" />
      <input type="hidden" name="user[password]" value="yourpassword" />
      <input type="hidden" name="user[remember_me]" value="1" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

Impact

The victim may add sensitive payment information to the attacker's new account

TESTCSRF22.PNG
TESTCSRF22.PNG From the original on HackerOne

the victim's IP may be recorded in the attacker's account, resulting in brute force and identity theft. █████

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

HackerOne's sign-in page at https://hackerone.com/users/sign_in is a standard Rails-style login form. The report states that the platform uses an authenticity_token parameter during login to prevent cross-site request forgery, the usual Rails mechanism for tying a form submission to the user's session. The researcher's claim is that this token is present but not properly verified, so the login endpoint accepts a POST that carries no token at all.

The weakness class recorded for the report is Cross-Site Request Forgery (CSRF), with low severity and a CVSS score of 3.8. The affected asset is hackerone.com and the bounty was 500.00 USD. The report was disclosed on 2020-06-12.

Setup

No special accounts or roles are described beyond a normal user account on HackerOne. The only tool named is Burp Suite: the researcher captures the login request with it (referred to in the report as "buff suit") and uses Burp's built-in CSRF PoC generator under Engagement Tools.

Finding it

The researcher noticed that the login form includes an authenticity_token, which suggests CSRF protection is in place, but that the server does not actually enforce it. The framing in the report is that HackerOne believes it has implemented CSRF protection through the authenticity_token, but it has not: the token is not properly verified, so a login request without it is still processed.

Exploitation

Step 1: Open the sign-in page

Navigate to the login form:

Text
https://hackerone.com/users/sign_in

This is the page whose form normally carries the authenticity_token.

Step 2: Capture the login request

While logging into the account, intercept the traffic with Burp Suite. The captured request is the POST to the sign-in endpoint containing the email, password, remember-me flag and the authenticity token.

Step 3: Generate a CSRF PoC

In Burp Suite, use Engagement Tools, then Generate CSRF POC, to turn the captured request into an HTML form. This produces an HTML page that reproduces the login POST.

Step 4: Remove the authenticity token

Delete the authenticity_token field from the generated form. The resulting PoC contains only the credential fields and the remember-me flag:

JavaScript
<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="https://hackerone.com/users/sign_in" method="POST">
      <input type="hidden" name="user[email]" value="youremail" />
      <input type="hidden" name="user[password]" value="yourpassword" />
      <input type="hidden" name="user[remember_me" value="1" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

The form posts to the real sign-in endpoint with the attacker's email and password, and sets user[remember_me] to 1. The authenticity_token input is absent, which is the whole point of the test.

Step 5: Submit and observe

Forward the request. According to the report, the CSRF is exploited successfully: the login succeeds without the token, and the modified data changes successfully. In other words, the victim's browser is logged into the attacker's account.

TESTCSRF22.PNG
TESTCSRF22.PNG From the original on HackerOne

Root cause

The login endpoint accepts a POST without a valid authenticity_token. The token is rendered into the form, so it looks like protection exists, but the server-side check does not reject requests that omit it. In Rails terms this is the difference between including the token in the view and actually verifying it on the controller action; the report only states the observable behaviour, so the exact reason the check is missing is not documented. The existing defence therefore did not stop the attack because it was never enforced on this endpoint.

Impact

The report describes a login CSRF: the victim is silently authenticated as the attacker. The stated consequences are that the victim may add sensitive payment information to the attacker's new account, and that the victim's IP may be recorded in the attacker's account, which the researcher links to brute force and identity theft. These outcomes depend on the victim subsequently using the attacker-controlled account as if it were their own, for example by entering payment details or performing actions that get logged against that account.

Fix

The report does not describe a fix or a verification step after remediation. The change implied by the finding is to enforce verification of the authenticity_token on the sign-in action so that a POST without a valid token is rejected, rather than merely rendering the token into the form.

Variants to test

  1. Remove the token from other state-changing forms (password change, email change, MFA setup) and replay the request. A positive result is the server processing the change without a valid token.
  2. Send an empty or malformed authenticity_token value rather than omitting the parameter. A positive result is the same successful action, showing the check is absent rather than merely optional.
  3. Reuse a token from a different session or after logout. A positive result is acceptance of a token that should no longer be valid.
  4. Test the login endpoint with a cross-origin form submission from a separate domain, as in the PoC, and confirm the session cookie is set for the target. A positive result is the victim's browser ending up authenticated as the attacker.
  5. Check whether the same endpoint accepts GET parameters for credentials, which would widen the attack surface beyond a form POST.

Hunting notes

Login and authentication endpoints are a common place for this pattern: the form visibly contains a CSRF token, so the protection appears present during a quick review, but the server-side verification is missing or conditional. During recon, capture every state-changing request and try removing the token parameter entirely, then try an invalid value; a response that still performs the action is the signal. The researcher demonstrated impact by showing the full attack chain, from the captured request through the generated PoC to a successful login without the token.

One line at the end of the report is redacted and is not reproduced here.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

HackerOne is a website where security researchers report bugs to companies and get paid for them. Like most websites, it has a login page where you type your email and password. This report is about a weakness in that login page.

Websites need a way to stop other websites from quietly submitting forms on your behalf. The usual trick is a hidden field called a token: a long random value that the site puts into the login form and checks when the form comes back. If the value is missing or wrong, the site should refuse the login. The researcher found that HackerOne's login page showed the token in the form, so it looked protected, but the server did not actually check it. A login request with the token deleted still worked.

That matters because of a type of attack called Cross-Site Request Forgery, or CSRF. Imagine someone hands you a form to sign and you sign it without reading it carefully; the signature is real, but the document is not what you thought. In CSRF, a malicious page makes your browser send a request to another site, and your browser attaches your existing login automatically. Here the trick is slightly different: the attacker does not steal your account, they log you into their account without asking. You then use that account thinking it is yours, and anything you type into it, such as payment details, ends up with the attacker.

The report was rated low severity with a CVSS score of 3.8, the affected asset was hackerone.com, the bounty was 500.00 USD, and it was disclosed on 2020-06-12.

Background you need first

A few ideas come up again and again below, so here they are from zero.

A form and a POST request. When you fill in a login box and press the button, your browser sends the contents to the server. The usual method for sending data that changes something is called POST. The data travels as pairs of a name and a value, for example a field named user[email] with your address as its value.

A token. A token is a short piece of text, usually random, that a server gives to a browser and expects to see again later. It works like a cloakroom ticket: you hand in your coat, you get a ticket, and you need that ticket to get the coat back. A CSRF token (HackerOne calls it authenticity_token) is a ticket the server puts into a form so it can tell that the form really came from its own pages and not from somewhere else.

A session and a cookie. After you log in, the server needs to remember you on your next click. It gives your browser a small file called a cookie, and the browser sends it back with every request to that site. The cookie is like a wristband at an event: show it at the door and you get in without showing your ID again.

Cross-Site Request Forgery (CSRF). A malicious website contains a form that points at a different website, and it submits that form in your browser. Your browser happily sends your cookies along, so the other site thinks the request came from you. The defence is the CSRF token: the attacker's page cannot know the random value that the real site put in its form.

Login CSRF. The special case in this report. Instead of performing an action in your account, the forged request logs you into an account the attacker controls. You do not notice, because you appear to be logged in normally.

Burp Suite. A tool used by security testers that sits between your browser and the website and lets you look at, pause and edit the requests going back and forth. The report calls it "buff suit", which is a typo for Burp Suite.

A proof of concept (PoC). A small, working demonstration that shows a bug is real, rather than just describing it.

Setting up

The report does not describe any special accounts or roles: a normal user account on HackerOne is enough. The only tool named is Burp Suite. The researcher uses it to capture the login request and then uses a built-in feature, under Engagement Tools, called Generate CSRF POC, which turns a captured request into a ready-made web page.

Finding it

The researcher noticed that the login form contains an authenticity_token. That suggests CSRF protection is in place, because the token is the standard mechanism. But when the token was removed, the server still processed the login. In the report's words, HackerOne believes it has implemented CSRF protection through the authenticity_token, but it has not: the token is not properly verified.

Exploitation

Step 1: Open the sign-in page

Go to the login form:

Text
https://hackerone.com/users/sign_in

This is the page whose form normally carries the authenticity_token. Opening it first gives you a real form to work from, so the captured request later looks exactly like a genuine login.

Step 2: Capture the login request

While logging into the account, intercept the traffic with Burp Suite. The captured request is the POST to the sign-in endpoint containing the email, password, remember-me flag and the authenticity token. Capturing it means you have a faithful copy of what a browser really sends, which you can then modify and replay.

Step 3: Generate a CSRF PoC

In Burp Suite, use Engagement Tools, then Generate CSRF POC, to turn the captured request into an HTML form. This produces an HTML page that reproduces the login POST. In plain terms, Burp writes a small web page for you that, when opened, sends the same login request from wherever that page is hosted, not from HackerOne.

Step 4: Remove the authenticity token

Delete the authenticity_token field from the generated form. This is the actual test: if the server still accepts the login, the token was never being checked. The resulting PoC contains only the credential fields and the remember-me flag:

JavaScript
<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="https://hackerone.com/users/sign_in" method="POST">
      <input type="hidden" name="user[email]" value="youremail" />
      <input type="hidden" name="user[password]" value="yourpassword" />
      <input type="hidden" name="user[remember_me]" value="1" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

Line by line:

  • <html> and <body> open a normal web page and its visible area. Nothing here is visible to the victim except a button.
  • <!-- CSRF PoC - generated by Burp Suite Professional --> is a comment, ignored by the browser; it records that Burp generated the page.
  • <form action="https://hackerone.com/users/sign_in" method="POST"> starts a form whose destination is the real HackerOne sign-in address, sent as a POST. This is the forged request.
  • <input type="hidden" name="user[email]" value="youremail" /> is a field the victim never sees, carrying the attacker's email address. In a real attack the placeholder is replaced with the attacker's actual address.
  • <input type="hidden" name="user[password]" value="yourpassword" /> does the same for the attacker's password.
  • <input type="hidden" name="user[remember_me]" value="1" /> sets the remember-me flag to 1.
  • <input type="submit" value="Submit request" /> is the only visible element: a button labelled Submit request. The victim has to click it, or the page has to submit the form some other way, for the request to be sent.
  • The closing tags end the form, the body and the page.

The authenticity_token input is absent, which is the whole point of the test.

Step 5: Submit and observe

Forward the request. According to the report, the CSRF is exploited successfully: the login succeeds without the token, and the modified data changes successfully. In other words, the victim's browser is logged into the attacker's account.

TESTCSRF22.PNG
TESTCSRF22.PNG From the original on HackerOne

Why it worked

The login endpoint accepts a POST without a valid authenticity_token. The token is rendered into the form, so it looks like protection exists, but the server-side check does not reject requests that omit it. In the framework HackerOne uses (Rails), there is a difference between putting the token into the page and actually verifying it when the request arrives; the report only states the observable behaviour, so the exact reason the check is missing is not documented. The existing defence therefore did not stop the attack because it was never enforced on this endpoint.

Impact

The report describes a login CSRF: the victim is silently authenticated as the attacker. The stated consequences are that the victim may add sensitive payment information to the attacker's new account, and that the victim's IP may be recorded in the attacker's account, which the researcher links to brute force and identity theft. These outcomes depend on the victim subsequently using the attacker-controlled account as if it were their own, for example by entering payment details or performing actions that get logged against that account.

Fix

The report does not describe a fix or a verification step after remediation. The change implied by the finding is to enforce verification of the authenticity_token on the sign-in action so that a POST without a valid token is rejected, rather than merely rendering the token into the form.

Variants to test

  1. Remove the token from other state-changing forms (password change, email change, MFA setup) and replay the request. A positive result is the server processing the change without a valid token.
  2. Send an empty or malformed authenticity_token value rather than omitting the parameter. A positive result is the same successful action, showing the check is absent rather than merely optional.
  3. Reuse a token from a different session or after logout. A positive result is acceptance of a token that should no longer be valid.
  4. Test the login endpoint with a cross-origin form submission from a separate domain, as in the PoC, and confirm the session cookie is set for the target. A positive result is the victim's browser ending up authenticated as the attacker.
  5. Check whether the same endpoint accepts GET parameters for credentials, which would widen the attack surface beyond a form POST.

Hunting notes

Login and authentication endpoints are a common place for this pattern: the form visibly contains a CSRF token, so the protection appears present during a quick review, but the server-side verification is missing or conditional. During recon, capture every state-changing request and try removing the token parameter entirely, then try an invalid value; a response that still performs the action is the signal. The researcher demonstrated impact by showing the full attack chain, from the captured request through the generated PoC to a successful login without the token.

One line at the end of the report is redacted and is not reproduced here.

Glossary

  • API: a way for one piece of software to talk to another, like a waiter taking your order to the kitchen and bringing back the result.
  • authenticity_token: the hidden random value HackerOne puts into its login form so the server can check the form came from its own pages.
  • Burp Suite: a tool that sits between your browser and a website so you can inspect, pause and edit requests.
  • Cookie: a small file a site stores in your browser and gets back on later requests, used to remember who you are.
  • Cross-Site Request Forgery (CSRF): an attack where a malicious page makes your browser send a request to another site, using your existing login.
  • CSRF token: a random value placed in a form to prove the form came from the real site; the defence against CSRF.
  • CVSS: a standard scoring system for how serious a vulnerability is; 3.8 is on the low end.
  • Endpoint: a specific address on a server that accepts a particular kind of request, such as the sign-in address.
  • Engagement Tools / Generate CSRF POC: a Burp Suite feature that turns a captured request into a ready-made HTML page that reproduces it.
  • GET / POST: two ways a browser sends data to a server; POST is normally used for data that changes something, such as a login.
  • history.pushState: a browser function that changes the address bar without loading a new page.
  • HTML form: the part of a web page that collects values and sends them to a server when submitted.
  • Login CSRF: a CSRF attack that logs the victim into an account the attacker controls, rather than acting on the victim's own account.
  • MFA: multi-factor authentication, a second proof of identity beyond a password, such as a code from a phone.
  • Origin: the combination of scheme, host and port that identifies where a page came from; a page from one origin is not supposed to read data from another.
  • Proof of concept (PoC): a small working demonstration that a bug is real.
  • Rails: a popular framework for building websites, which provides the authenticity_token mechanism.
  • Recon: the information-gathering phase of security testing, before trying any attack.
  • Remember-me flag: a setting in a login form that keeps you signed in for longer.
  • Session: the period during which a site remembers you as logged in, usually tied to a cookie.
  • Severity: a label for how damaging a bug is, here low.
  • Token: a short piece of text, usually random, used to identify or verify something.

More by what_web

View all

12 more disclosed reports, best first.

More from HackerOne

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.