Login CSRF
The login form had no anti-CSRF protection, so a page on another site could submit the form on a victim's behalf, potentially logging them into an attacker-controlled account.
- Triaged in 35 hours
- Fixed in 4 days
- Paid in 4 days
- Disclosed after 11 days
Hi sir,
There is no mitigation of XCSRF in your login form.
Kindly check the source code of login:
<form class="signin" action="" method="post" novalidate> <p class="form"> <input class="input" name="email" type="email" placeholder="Email"> <input class="input" name="password" type="password" placeholder="Password"> <input type="hidden" name="org_invite"> <button type="submit"><span>Login</span></button> <a class="forgotten" href="#?/password-reset">Forgotten your password?</a> </p> <div class="userError"></div> </form>kindly let me know if you needed more information.
Clifford
What the report shows
The target is the IRCCloud login form. The researcher reported that the form has no mitigation against cross-site request forgery (the report calls it XCSRF), and supported the claim by quoting the markup of the login form as it appears in the page source:
<form class="signin" action="" method="post" novalidate>
<p class="form">
<input class="input" name="email" type="email" placeholder="Email">
<input class="input" name="password" type="password" placeholder="Password">
<input type="hidden" name="org_invite">
<button type="submit"><span>Login</span></button>
<a class="forgotten" href="#?/password-reset">Forgotten your password?</a>
</p>
<div class="userError"></div>
</form>
The steps in the report are short:
- Open the login form and inspect its source.
- The form posts with
method="post"to an emptyaction, so it submits to the current URL. - The only fields are
email,passwordand a hiddenorg_invite, and no anti-CSRF token field is present.
The report does not include a proof-of-concept page, a captured request, or a demonstration of a successful cross-site login. It ends by offering to provide more information if needed. The platform records a bounty of 100.00 USD and a weakness of Cross-Site Request Forgery (CSRF); no severity or CVSS score is given, and the report does not describe a fix.
Root cause
The report points to a missing anti-CSRF token in the login form. The form carries only the credentials and the org_invite field, so a page on another origin can submit the same fields to the login endpoint without needing to read anything from the target. The report points to a missing anti-CSRF token in the login form; it does not show how the server handles the submission.
Impact
Login CSRF lets an attacker log a victim into an account the attacker controls. The victim then uses the site while their activity is recorded in the attacker's account: anything they enter after logging in, such as messages or other content, lands in the attacker's account, and the attacker can read it later. The report itself does not spell out this scenario; it only states that the login form lacks CSRF mitigation. Whether the login endpoint here would actually accept a cross-site submission is not shown in the report.
How this kind of bug works
Browsers attach cookies to requests based on the destination origin, not on which page made the request. A form on attacker.example can therefore POST to victim.example and the browser will send any cookies the victim holds for victim.example. The attacker cannot read the response because of the same-origin policy, but for many actions reading the response is unnecessary: the side effect is the goal.
Login CSRF is the variant where the side effect is a change of session. The attacker submits their own credentials to the victim's browser, the server sets a session cookie for the attacker's account, and the victim continues browsing as the attacker. Defences work by making the request unforgeable or by refusing cross-origin submissions: a per-session token that the server checks, a SameSite cookie attribute so the session cookie is not sent on cross-site POSTs, and origin checks such as validating the Origin or Referer header. Login forms are sometimes skipped when these defences are rolled out, on the assumption that a login request is harmless, which is exactly the assumption login CSRF breaks.
How to test for it
- Identify the login endpoint and the exact field names it expects, by submitting the form normally and observing the request.
- Check whether the form contains a hidden token field, and whether the server rejects a submission where that field is missing or wrong. Removing the token and replaying the request is the quickest check.
- Build a page on a different origin that auto-submits a form with the same field names and the attacker's credentials, then load it in a browser that already has a session with the target. A positive result is that the browser ends up authenticated as the attacker's account.
- Confirm the session actually changed: reload the target in the same browser and check which account is shown.
Common false positives: a token that is present but not validated (test by tampering with it), a server that rejects the request because of SameSite cookies or an origin check even though no token exists, and a login that appears to succeed cross-site but only because the browser was not logged in beforehand, which is not a session change. Also separate a genuine login CSRF from a plain missing token on a form whose action has no security consequence.
How it is fixed
The standard fixes are: issue a per-session anti-CSRF token, include it as a hidden field in the login form, and reject any login POST whose token is missing or does not match; set the session cookie with SameSite=Lax or SameSite=Strict so it is not sent on cross-site POSTs; and validate the Origin (or, as a fallback, Referer) header on state-changing requests, rejecting requests from unexpected origins. Rotating the session identifier on login also limits the value of a forged session.
Hunting notes
Login, registration, password reset and account-linking forms are the usual hiding places, because they are often built separately from the rest of the application and miss the token framework applied elsewhere. Recon signals include a login form with no hidden token field, a session cookie set without a SameSite attribute, and endpoints that accept POSTs without checking Origin. To make the report land, show the full sequence: the forged page, the request it produces, and the resulting authenticated session in the victim's browser, with the account identity visible before and after. A source snippet alone, as in this report, states the weakness but leaves the exploit unproven.
What happened, in plain words
IRCCloud has a sign-in page where you enter an email address and a password. The researcher reported that the login form has no mitigation against cross-site request forgery (the report calls it XCSRF), quoting the form markup.
To understand the claim, you need two ideas.
A request is what your browser sends to a website when you do something: open a page, press a button, submit a form. A cookie is a small piece of data a website stores in your browser so it can recognise you on the next request. After you log in, the site gives your browser a cookie that acts like a wristband at an event: show it and you are let in without proving who you are again.
Cross-site request forgery (CSRF) is when a page on one website makes your browser send a request to another website, using the cookie your browser already holds for that other site. Your browser attaches cookies based on where the request is going, not on which page started it. So a page you visit can quietly cause an action on a site where you are logged in. The everyday comparison: someone hands you a signed form and you drop it in the post without reading it, and the recipient treats it as your decision because your signature is on it.
What the researcher reported is a specific variant, login CSRF. Normally CSRF is used to make you do something inside your own account. Login CSRF is stranger: the attacker makes your browser log in to the attacker's account. You think you are in your own account, but everything you type afterwards is recorded in the attacker's account, where the attacker can read it.
The evidence in the report is the markup of the login form, copied from the page source:
<form class="signin" action="" method="post" novalidate>
<p class="form">
<input class="input" name="email" type="email" placeholder="Email">
<input class="input" name="password" type="password" placeholder="Password">
<input type="hidden" name="org_invite">
<button type="submit"><span>Login</span></button>
<a class="forgotten" href="#?/password-reset">Forgotten your password?</a>
</p>
<div class="userError"></div>
</form>
Line by line:
<form class="signin" action="" method="post" novalidate>opens the form.action=""means the form is submitted to the same URL the page was loaded from.method="post"means the data travels in the body of the request rather than in the address bar.novalidatetells the browser to skip its built-in field checks.<input class="input" name="email" type="email" placeholder="Email">is the email box. Thenameis what the server receives as the field label.<input class="input" name="password" type="password" placeholder="Password">is the password box;type="password"only hides the characters on screen.<input type="hidden" name="org_invite">is a field the user never sees. It is a field the user never sees, namedorg_invite.<button type="submit">is the Login button, and the link below it goes to the password reset page.
The point the researcher makes is what is missing: there is no hidden field holding an anti-CSRF token. A token is a random value the server generates for your session and expects back with the form; a page on another site cannot guess it, so it cannot forge a valid submission. Here the only fields are email, password and org_invite, and no anti-CSRF token field is present.
The report stops at that observation. It contains no proof-of-concept page, no captured request and no demonstration that a cross-site login actually succeeds. It ends by offering more information if needed. The platform records a bounty of 100.00 USD and classifies the weakness as Cross-Site Request Forgery (CSRF); no severity or CVSS score is given, and the report does not describe a fix.
In general, how this kind of bug works
A browser sends cookies to a site based on the destination, not on who started the request. A form on attacker.example can therefore POST to victim.example, and the browser will attach whatever cookies the victim holds for victim.example. The attacker cannot read the response, because the same-origin policy stops one site from reading another site's data. But reading is often unnecessary: the side effect is the goal.
In login CSRF the side effect is a change of session. The attacker submits their own email and password to the victim's browser, the server sets a session cookie for the attacker's account, and the victim keeps browsing as the attacker. Defences make the request unforgeable or refuse cross-origin submissions:
- a per-session token that the server checks on every submission;
- a
SameSiteattribute on the session cookie, so the browser does not send it on cross-site POSTs; - an origin check, validating the
OriginorRefererheader on state-changing requests.
Login forms are sometimes left out when these defences are rolled out, on the assumption that logging in is harmless. Login CSRF is exactly the case where that assumption fails.
How to test for it
- Submit the login form normally and watch the request, so you know the endpoint and the exact field names.
- Look for a hidden token field, then remove it and replay the request. If the server still accepts it, the token is not being checked.
- Build a page on a different origin that auto-submits a form with the same field names and the attacker's credentials, and load it in a browser that already has a session with the target. A positive result is ending up logged in as the attacker's account.
- Reload the target in the same browser and confirm which account is shown, so you know the session really changed.
Common false positives: a token that exists but is never validated (test by tampering with it), a server that rejects the request because of SameSite cookies or an origin check even without a token, and a login that seems to work cross-site only because the browser was not logged in beforehand, which is not a session change. Also separate a real login CSRF from a missing token on a form with no security consequence.
How it is fixed
The standard fixes are: issue a per-session anti-CSRF token, put it in a hidden field in the login form, and reject any login POST whose token is missing or wrong; set the session cookie with SameSite=Lax or SameSite=Strict; and validate the Origin (or, as a fallback, Referer) header on state-changing requests. Rotating the session identifier on login also limits the value of a forged session.
Where to look
Login, registration, password reset and account-linking forms are the usual hiding places, because they are often built separately from the rest of the application and miss the token framework used elsewhere. Signals worth checking: a login form with no hidden token field, a session cookie set without a SameSite attribute, and endpoints that accept POSTs without checking Origin. To make a report land, show the full sequence: the forged page, the request it produces, and the resulting authenticated session in the victim's browser, with the account identity visible before and after. A source snippet alone, as in this report, states the weakness but leaves the exploit unproven.
Glossary
- Request: a message your browser sends to a website, for example when you open a page or submit a form.
- Cookie: a small piece of data a site stores in your browser so it can recognise you on later requests.
- Session: the period during which a site treats your browser as a logged-in user, usually tracked by a session cookie.
- Session cookie: the cookie that identifies your logged-in session.
- CSRF (cross-site request forgery): an attack where a page on one site makes your browser send a request to another site, using the cookies you already hold there.
- XCSRF: the abbreviation the report uses for cross-site request forgery.
- Login CSRF: a CSRF variant that logs the victim into an account controlled by the attacker.
- Anti-CSRF token: a random value tied to your session that the server expects back with a form, so another site cannot forge a valid submission.
- Form: the part of a web page that collects input and sends it to the server when you press a button.
- Markup / source: the HTML text that describes a web page, visible through the browser's view-source or developer tools.
action: the form attribute naming the URL the form submits to; empty means the current URL.method: the form attribute choosing how data is sent;postputs it in the request body.- Hidden field: an input the user cannot see but that is still submitted with the form.
- Same-origin policy: the browser rule that stops one site from reading data belonging to another site.
SameSite: a cookie attribute that controls whether the cookie is sent on requests started by other sites.Origin/Refererheader: request headers that tell the server where the request came from, used for origin checks.- Proof of concept (PoC): a working demonstration that an attack succeeds.
- False positive: a finding that looks like a vulnerability but is not one.
- CVSS: a scoring system for rating the severity of a vulnerability.