New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iCMS V7.0.13 unzip vulnerability GET SHELL[CVE-2019-7160] #50

dbappxuji opened this Issue Jan 29, 2019 · 1 comment


None yet
2 participants
Copy link

dbappxuji commented Jan 29, 2019

in files.admincp.php
public function do_IO(){ files::$watermark_enable = $_GET['watermark']; $udir = iSecurity::escapeStr($_GET['udir']); $name = iSecurity::escapeStr($_GET['name']); $ext = iSecurity::escapeStr($_GET['ext']); iFS::check_ext($ext,0) OR iUI::json(array('state'=>'ERROR','msg'=>'不允许的文件类型')); iFS::$ERROR_TYPE = true; $F = iFS::IO($name,$udir,$ext); $F ===false && iUI::json(iFS::$ERROR); iUI::json(array( "value" => $F["path"], "url" => iFS::fp($F['path'],'+http'), "fid" => $F["fid"], "fileType" => $F["ext"], "image" => in_array($F["ext"],files::$IMG_EXT)?1:0, "original" => $F["oname"], "state" => ($F['code']?'SUCCESS':$F['state']) )); }
and see the iFS.class.php
`public static function IO($FileName = '', $udir = '', $FileExt = 'jpg',$type='3',$filedata=null) {
$filedata===null && $filedata = file_get_contents('php://input');
if (empty($filedata)) {
return false;

	$fileMd5 = md5($filedata);
	$FileName OR $FileName = $fileMd5;
	$FileSize = strlen($filedata);
	$FileExt = self::valid_ext($FileName . "." . $FileExt); //判断文件类型
	if ($FileExt === false) {
		return false;

	list($RootPath, $FileDir) = self::mk_udir($udir,$fileMd5,$FileExt); // 文件保存目录方式
	$FilePath = $FileDir . $FileName . "." . $FileExt;
	$FileRootPath = $RootPath . $FileName . "." . $FileExt;
	self::write($FileRootPath, $filedata);
	$fid = self::insert_filedata(array($FileName,'',$FileDir,'',$FileExt,$FileSize), $type);
	$value = array(
	return self::_data($value);

so we can use ../ to write a package file to anyother folder in the server。
fitst use this request to write a package file with a php file in it
see apps.admincp.php
` public function do_local_app(){

  $zipfile = trim($_POST['zipfile']);
  if(preg_match("/^iCMS\.APP\.(\w+)\-v\d+\.\d+\.\d+\.zip$/", $zipfile,$match)){
    apps_store::$zip_file = iPATH.$zipfile;
    apps_store::$msg_mode = 'alert';
    iUI::alert('What the fuck!!');

and than use this request to unzip this package
so we upload a php file

author by


This comment has been minimized.

Copy link

idreamsoft commented Jan 29, 2019

Thank you, we will fix it as soon as possible

@dbappxuji dbappxuji changed the title iCMS V7.0.13 unzip vulnerability GET SHELL iCMS V7.0.13 unzip vulnerability GET SHELL[CVE-2019-7160] Jan 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment