Sign up CSRF
The registration form had no CSRF protection, so a third-party site could submit it on a victim's behalf.
- Triaged in 35 hours
- Fixed in 4 days
- Paid in 4 days
- Disclosed after 34 days
Again sir,
There is no mitigation against CSRF attacks on the regsitration, I believe when not fixed you will be flooded with reports by researchers regarding this.
<form action="" method="post" class="signupForm" novalidate> <p>Sign up for a free account / <b><a href="/pricing" target="_blank">Pricing</a></b></p> <div class="userError"></div> <div id="signupOrgInfo" class="userInfo">You’re signing up to join the <b id="signupOrgName"></b> team.</div> <p class="form"><input class="input" name="realname" placeholder="Name"></p> <p class="form"><input class="input" name="email" type="email" placeholder="Email"></p> <p class="form"><input class="input" name="password" type="password" placeholder="Password"></p> <input type="hidden" name="invite"> <input type="hidden" name="org_invite"> <p class="form"><button type="submit" class="signup"><span>Sign up</span></button></p> <p><small>By signing up, you agree to our <a href="/terms">Terms of Service</a></small></p> </form>Kindly let me know if you needed more information.
Clifford
Context
IRCCloud is a hosted IRC client, and the report concerns its account registration feature. The sign-up form creates a free account from three user-supplied fields, a name, an email address and a password, plus two hidden fields used for invitations, invite and org_invite. The form posts to the current URL with method="post".
The report is a Cross-Site Request Forgery (CSRF) finding on that registration endpoint. The researcher's claim is narrow: there is no mitigation against CSRF attacks on registration.
Setup
No accounts, roles, tools or versions are described in the report. The researcher presents the finding by quoting the sign-up form markup from the page, which is the only artefact given. The precondition implied by the finding is simply that the registration endpoint accepts a cross-site POST and creates an account from it.
Finding it
The researcher inspected the registration form and saw nothing in it that would tie a submission to the user's own browser session or to a page the attacker cannot read. The form as quoted contains no anti-CSRF token field:
<form action="" method="post" class="signupForm" novalidate>
<p>Sign up for a free account / <b><a href="/pricing" target="_blank">Pricing</a></b></p>
<div class="userError"></div>
<div id="signupOrgInfo" class="userInfo">You’re signing up to join the <b id="signupOrgName"></b> team.</div>
<p class="form"><input class="input" name="realname" placeholder="Name"></p>
<p class="form"><input class="input" name="email" type="email" placeholder="Email"></p>
<p class="form"><input class="input" name="password" type="password" placeholder="Password"></p>
<input type="hidden" name="invite">
<input type="hidden" name="org_invite">
<p class="form"><button type="submit" class="signup"><span>Sign up</span></button></p>
<p><small>By signing up, you agree to our <a href="/terms">Terms of Service</a></small></p>
</form>
The fields that carry data are realname, email and password, with invite and org_invite as hidden inputs. The action attribute is empty, so the browser submits to the URL of the page itself. The novalidate attribute disables the browser's own constraint validation on submit.
What is missing is the point of the report: there is no hidden field holding a per-session or per-request token, and nothing else in the markup that a server could use to distinguish a submission the user made from one an attacker caused.
Exploitation
The report does not include a proof-of-concept page, a captured request or a response. It states the absence of CSRF mitigation and stops there. The mechanics of the attack follow from the form itself.
Step 1: Identify the submission
The form posts to its own URL, the registration page, with method="post" and the fields realname, email, password, invite and org_invite. Because the action is empty, the target is whatever URL the registration page is served from.
Step 2: Build a cross-site form
An attacker hosts a page containing a form with the same action and method and the same field names, pre-filled with values the attacker chooses, and submits it automatically when a victim loads the page. The victim's browser sends the POST to the registration endpoint. No token is present in the quoted markup for the server to check, so nothing in the request distinguishes it from a genuine sign-up.
Step 3: Observe the effect
A successful submission creates an account with the attacker's chosen name, email address and password. The report does not show the response or describe what the victim sees afterwards.
Root cause
The registration endpoint accepts a state-changing POST without any anti-CSRF token, as the quoted form shows. The report does not describe any server-side check such as origin validation, a custom header requirement or a token comparison, so the likely root cause is that the endpoint relies on nothing beyond the request itself.
Impact
The researcher's stated concern is that, with the issue unfixed, the program would be flooded with reports from other researchers about the same thing. The report states only that there is no CSRF mitigation on registration and does not describe the resulting effect.
Fix
The measure it calls for is a CSRF mitigation on registration, which in practice means a per-session or per-request token embedded in the form and verified server-side on submission, optionally combined with checking the Origin or Referer header.
Variants to test
- Registration and invitation endpoints. Submit the sign-up form from another origin with attacker-chosen values. A positive result is an account created without the victim's interaction beyond loading the page.
- Hidden invitation fields. The form carries
inviteandorg_invite. Try forging a submission that sets them, and check whether an invitation is consumed or an organisation membership is created. A positive result is a change in invitation or organisation state that the victim did not request. - Forms with
novalidate. Where client-side validation is disabled, send values the UI would normally reject, such as a malformed email, and see whether the server accepts them. A positive result is a stored account with data the form would have blocked. - Empty
actionattributes. When a form posts to its own URL, confirm which endpoint actually receives the request and test that endpoint directly from a cross-site page.
Hunting notes
This kind of bug hides in endpoints that create or modify state for a user who is not yet authenticated or who has just arrived: registration, invitation acceptance, password reset and email change. During recon, a form with no hidden token field, an empty action, or novalidate on a state-changing form is a signal worth following. The researcher's report is short and rests on the form markup alone, with no proof-of-concept and no captured traffic.
What happened, in plain words
IRCCloud is a service that runs an IRC client for you in the browser, so you can chat on IRC networks without installing anything. To use it you create an account on its website. The report is about that sign-up page.
When you fill in a sign-up form and press the button, your browser sends the details to the server. A server is the computer that runs the website and stores the accounts. The problem the researcher found is that the sign-up form has nothing in it that proves the request really came from the person who filled it in. That missing proof is what security people call a Cross-Site Request Forgery, or CSRF.
To understand CSRF, imagine a signed form at a bank counter. The clerk checks your signature before doing anything. Now imagine the bank accepts any piece of paper with the right words on it, no signature needed. Anyone could write one and hand it in. On the web, the "signature" is a secret value that only the real page can produce, and the sign-up form here has none.
The researcher's claim is narrow and specific: there is no protection against CSRF on registration. The report does not include a proof-of-concept page or captured traffic. It quotes the form and points at what is missing.
Context
IRCCloud's registration feature creates a free account. The form collects three things from the user: a name, an email address and a password. It also carries two hidden fields, invite and org_invite.
A hidden field is an input that the page fills in for you and that you do not see. It travels with the form when you submit it, just like the fields you typed into.
The form posts to the current URL with method="post". "Post" is one of the ways a browser can send data to a server: the data goes in the body of the request rather than in the address bar. "Posts to the current URL" means the form does not name a destination, so the browser sends the data back to the same page it is on.
Setup
The report describes no accounts, roles, tools or versions. The only artefact it gives is the sign-up form markup, copied from the page. Markup is the HTML code that describes what a page contains: its text boxes, buttons and links.
The precondition the finding implies is simple: the registration endpoint accepts a form submission that comes from another website and creates an account from it. An endpoint is a specific address on the server that does one job, here "create an account".
Finding it
The researcher looked at the registration form and saw nothing in it that would tie a submission to the visitor's own browser session, or to a page that an attacker cannot read. A session is the server's way of remembering that a series of requests come from the same visitor, usually by giving the browser a cookie, a small piece of data the browser stores and sends back with each request. A secret tied to that session, placed in the form and checked by the server, is the usual defence against CSRF.
The form as quoted contains no anti-CSRF token field:
<form action="" method="post" class="signupForm" novalidate>
<p>Sign up for a free account / <b><a href="/pricing" target="_blank">Pricing</a></b></p>
<div class="userError"></div>
<div id="signupOrgInfo" class="userInfo">You’re signing up to join the <b id="signupOrgName"></b> team.</div>
<p class="form"><input class="input" name="realname" placeholder="Name"></p>
<p class="form"><input class="input" name="email" type="email" placeholder="Email"></p>
<p class="form"><input class="input" name="password" type="password" placeholder="Password"></p>
<input type="hidden" name="invite">
<input type="hidden" name="org_invite">
<p class="form"><button type="submit" class="signup"><span>Sign up</span></button></p>
<p><small>By signing up, you agree to our <a href="/terms">Terms of Service</a></small></p>
</form>
Line by line, in plain words:
<form action="" method="post" class="signupForm" novalidate>opens the form.action=""is empty, so the browser sends the data to the page's own address.method="post"sends the data in the request body.class="signupForm"is a label used for styling, not for security.novalidateswitches off the browser's built-in checks before submitting.- The first
<p>shows the heading "Sign up for a free account" and a link to the pricing page.target="_blank"makes the link open in a new tab. <div class="userError"></div>is an empty box where the page can show an error message.<div id="signupOrgInfo" class="userInfo">is a message shown when someone is signing up to join a team; the team name would be filled into<b id="signupOrgName">.- The next three
<p>elements hold the visible inputs:realnamefor the name,emailwithtype="email"for the address, andpasswordwithtype="password"so the characters are hidden as you type.placeholderis the grey hint text inside the box. <input type="hidden" name="invite">and<input type="hidden" name="org_invite">are the two hidden fields for invitations. They are not visible on the page but are sent with the form.- The
<button type="submit" class="signup">is the Sign up button that sends the form. - The last
<p>holds the small print and a link to the terms of service.
The fields that carry data are realname, email and password, with invite and org_invite as hidden inputs. Because action is empty, the browser submits to the URL of the page itself. The novalidate attribute disables the browser's own checks on submit.
What is missing is the point of the report: there is no hidden field holding a per-session or per-request token, and nothing else in the markup that a server could use to tell a submission the user made from one an attacker caused. A token here means a random value the server generates and remembers, puts into the form, and checks when the form comes back. An attacker's page cannot read that value, so it cannot include it.
Exploitation
The report does not include a proof-of-concept page, a captured request or a response. It states the absence of CSRF mitigation and stops there. The mechanics of the attack follow from the form itself.
Step 1: Identify the submission
The form posts to its own URL, the registration page, with method="post" and the fields realname, email, password, invite and org_invite. Because the action is empty, the target is whatever URL the registration page is served from. Knowing the exact address and field names is the first step, because an attacker has to reproduce them exactly for the server to accept the request.
Step 2: Build a cross-site form
An attacker hosts a page containing a form with the same action and method and the same field names, pre-filled with values the attacker chooses, and submits it automatically when a victim loads the page. The victim's browser sends the POST to the registration endpoint. No token is present in the quoted markup for the server to check, so nothing in the request distinguishes it from a genuine sign-up.
Why does the victim's browser send it? Because a browser does not know which page a form "belongs" to. If a page tells it to send a request to another site, it does so. That is the heart of CSRF: the browser is trusted to send the request, and the server has no way to see who wrote the page that asked for it.
Step 3: Observe the effect
A successful submission creates an account with the attacker's chosen name, email address and password. The report does not show the response or describe what the victim sees afterwards.
Root cause
The registration endpoint accepts a state-changing POST without any anti-CSRF token, as the quoted form shows. "State-changing" means the request alters something stored on the server, here by adding a new account. The novalidate attribute removes the browser's client-side validation as an obstacle to a forged submission, and client-side validation would not be a CSRF defence in any case: anything the browser checks can be skipped by whoever writes the page.
The report does not describe any server-side check such as origin validation, a custom header requirement or a token comparison. Origin validation means looking at the Origin header, which tells the server which site the request came from, and refusing requests from unexpected sites. A custom header requirement means demanding a header that a cross-site form cannot set. The likely root cause is that the endpoint relies on nothing beyond the request itself.
Impact
The researcher's stated concern is that, with the issue unfixed, the program would be flooded with reports from other researchers about the same thing. The report states only that there is no CSRF mitigation on registration and does not describe the resulting effect.
Fix
The measure it calls for is a CSRF mitigation on registration, which in practice means a per-session or per-request token embedded in the form and verified server-side on submission, optionally combined with checking the Origin or Referer header. The Referer header tells the server the address of the page that made the request.
Variants to test
- Registration and invitation endpoints. Submit the sign-up form from another origin with attacker-chosen values. A positive result is an account created without the victim's interaction beyond loading the page.
- Hidden invitation fields. The form carries
inviteandorg_invite. Try forging a submission that sets them, and check whether an invitation is consumed or an organisation membership is created. A positive result is a change in invitation or organisation state that the victim did not request. - Forms with
novalidate. Where client-side validation is disabled, send values the UI would normally reject, such as a malformed email, and see whether the server accepts them. A positive result is a stored account with data the form would have blocked. - Empty
actionattributes. When a form posts to its own URL, confirm which endpoint actually receives the request and test that endpoint directly from a cross-site page.
Hunting notes
This kind of bug hides in endpoints that create or modify state for a user who is not yet authenticated or who has just arrived: registration, invitation acceptance, password reset and email change. During recon, a form with no hidden token field, an empty action, or novalidate on a state-changing form is a signal worth following. Recon means the early stage of looking around a target to map what it does.
The researcher's report is short and rests on the form markup alone, with no proof-of-concept and no captured traffic.
Glossary
- CSRF (Cross-Site Request Forgery): an attack where another website makes a visitor's browser send a request the visitor did not intend, and the server cannot tell it apart from a genuine one.
- Server: the computer that runs a website and stores its data.
- Endpoint: a specific address on a server that performs one job, such as creating an account.
- Registration: the feature that creates a new user account.
- Form: the part of a web page with text boxes and a button that sends data to a server.
- Markup (HTML): the code that describes what a page contains.
- Hidden field: an input that is not visible on the page but is sent with the form.
- POST: a way for a browser to send data to a server in the body of the request rather than in the address bar.
actionattribute: the destination a form sends its data to; when empty, the page's own address.novalidate: an attribute that switches off the browser's built-in checks before a form is submitted.- Client-side validation: checks the browser performs before sending data; they can be skipped and are not a security defence.
- Session: the server's way of remembering that a series of requests come from the same visitor.
- Cookie: a small piece of data the browser stores and sends back with requests, often used to identify a session.
- Token (anti-CSRF token): a random value the server generates, puts into a form and checks on return, which an attacker's page cannot read or guess.
- State-changing request: a request that alters something stored on the server, such as creating an account.
- Origin validation: checking the
Originheader to see which site a request came from and refusing unexpected ones. Originheader: a request header that states which site the request originated from.Refererheader: a request header that states the address of the page that made the request.- Custom header requirement: demanding a header that a cross-site form cannot set, as a CSRF defence.
- Proof-of-concept (PoC): a working demonstration that an attack succeeds.
- Recon: the early stage of exploring a target to map what it does.
- Bounty: a payment a program makes for a valid security report.
- Disclosed: made public, usually after the issue has been fixed.