- thinkphp 3.2.0
- email: [email protected]
一个基于thinkphp3.2开发的cms系统,功能比较全面。
Hello,
I would like to report for XSS vulnerability.
In file https://github.com/jorycn/thinkphp-zcms/blob/master/ThinkPHP/Mode/Api/Controller.class.php line 69
$handler = isset($_GET[C('VAR_JSONP_HANDLER')]) ? $_GET[C('VAR_JSONP_HANDLER')] : C('DEFAULT_JSONP_HANDLER');
exit($handler.'('.json_encode($data).');');
exit function will terminate the script and print a message which has $_GET[C('VAR_JSONP_HANDLER')]. Then there is XSS vulnerability.
Vulnerability file:\Application\Home\Controller\MessageController.class.php
You can see that the xss vulnerability is not filtered here
Vulnerability to reproduce:
1、Visit url: http://www.xxx.com/index.php?m=home&c=message&a=add ,use the post method to pass in parameter values,the specific operation screenshots are as follows:
2、Access background address: http://www.xxx.com/Admin/Message/index/menuId/132 ,you can see the success popup
Or you can log in to the background, click Extension Tools, and then click Message Management,a popup will appear next
Repair suggestion:
Use php built-in functions such as htmlspecialchars to filter xss vulnerabilities
Vulnerability file:\Application\Home\Controller\HomeController.class.php
The vulnerability code is as follows:
You can see that the incoming file is directly included here, and the file is not filtered
Vulnerability to reproduce:
1、First create a 1.txt file in the root directory of the website,of course, this can be any file in the root directory of the website
2、The code in the 1.txt file is as follows:
3、Visit url: http://www.xxx.com/index.php?m=home&c=home&a=sp_set_config ,use the post method to pass in $file and $config_array
4、You can see that shell.php is successfully generated in the root directory of the website
5、Use backdoor tool to connect shell.php
Repair suggestion:
1、Restrict incoming files to php suffix
2、Specifies the incoming filename
3、Detect and filter the content of incoming files
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.