CSRF token validation is missing
The login form at portal.nextcloud.com does not validate a CSRF token, so an attacker could craft a cross-site request to submit login attempts. The researcher claims this enables brute-force attacks, though the text does not demonstrate a working exploit.
596a96cc7bf9108cd896f33c4 Follow
Originally disclosed on HackerOne
- Disclosed after 5 days
Summary by the researcher
@lukasreschke, Sorry my mistake and my foolish action., Anyway i'm a newbie.
I've found that even if there is a xsrf token on login form you can brute force the login form using Burp Intruder, with an extender extension to handle the CSRF token., that is why you said This is not really what a CSRF token would prevent… Thank you for correcting me on that.
But in fact that the CSRF token validation is missing on https://portal.nextcloud.com/login.php is my correct part. would you consider my report is valid? Thank you very much.
Cheers!, and God bless @lukasreschke
The report
Greetings,
Hello Security Team,
Summary
I know this is a medium risk issue but i want you guys to be aware of it that the CSRF token validation is missing at the time of login on https://portal.nextcloud.com/login.php login page.
PoC Code:
<form name="frmlogin" action="https://portal.nextcloud.com/login.php" method="post" onsubmit="return ValidateForm();">
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label">Email</label>
<input type="text" name="member_username" id="member_username" value="" class="form-control">
</div>
</div><!-- col-sm-12 -->
<div class="col-xs-12">
<div class="form-group">
<label class="control-label">Password</label>
<input type="password" name="member_password" class="form-control">
</div>
</div><!-- col-sm-12 -->
<div class="col-xs-12">
<div class="form-group text-center">
<button class="btn btn-search btn-primary col-xs-12 mb10" style="padding:10px;margin-top:10px;" type="submit" name="login" value="Login Now">Login Now</button>
<a href="https://support.nextcloud.com/#password_reset">Forgot Password?</a>
</div>
</div><!-- col-sm-12 -->
</div><!-- End Row -->
</form>
<script type="text/javascript">
var tabs = '';
//<![CDATA[
function ValidateForm()
{
var f = document.frmlogin;
if(f.member_username.value=='')
{
alert('Please enter the Username.');
f.member_username.focus(); return false;
}
if(f.member_password.value=='')
{
alert('Please specify the Password.');
f.member_password.focus(); return false;
}
}
//]]>
</script>
PoC Attached is the html code: (Attachment on the original report: csrf_token_is_missing.html)
Impact:
- An attacker can Brute force their password.
- Brute force Attack
Regards, j3
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the login form does not include or validate a CSRF token, allowing cross-site POST requests.
Impact
An attacker could brute-force passwords, though the text does not demonstrate a practical attack and the impact is limited to login attempts.
The fix
The login form should validate a CSRF token to prevent cross-site requests.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A CSRF token is a secret value added to a form to ensure the request comes from the real site, not an attacker's page. Here, the login form lacks this check, so an attacker could make a victim's browser send a login request without the victim's knowledge. The researcher says this could help brute-force passwords, but the report does not show a full attack.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.