dedecms v5.1 WriteBookText() code injection vul注入漏洞


\include\inc_bookfunctions.php 
--------------------------------------------------- 
…… 
复制代码 代码如下:

function WriteBookText($cid,$body)  
{  
global $cfg_cmspath,$cfg_basedir;  
$ipath = $cfg_cmspath."/data/textdata";  
$tpath = ceil($cid/5000);  
if(!is_dir($cfg_basedir.$ipath)) MkdirAll($cfg_basedir.$ipath,$GLOBALS['cfg_dir_purview']);  
if(!is_dir($cfg_basedir.$ipath.'/'.$tpath)) MkdirAll($cfg_basedir.$ipath.'/'.$tpath,$GLOBALS['cfg_dir_purview']);  
$bookfile = $cfg_basedir.$ipath."/{$tpath}/bk{$cid}.php";  
$body = "<"."?php\r\n".$body."\r\n?".">";  
@$fp = fopen($bookfile,'w');  
@flock($fp);  
@fwrite($fp,$body);  
@fclose($fp);  
}  

  
…… 

―――――――――――――――――

\member\story_add_content_action.php
―――――――――――――――――

…… 
复制代码 代码如下:

WriteBookText($arcID,addslashes($body));  
…… 

―――――――――――――――――

找了个好看的站测试了一下

你可能感兴趣的:(dedecms v5.1 WriteBookText() code injection vul注入漏洞)