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

Possible SQL injection vulnerability #4

Open
enferas opened this issue Nov 11, 2021 · 1 comment
Open

Possible SQL injection vulnerability #4

enferas opened this issue Nov 11, 2021 · 1 comment

Comments

@enferas
Copy link

enferas commented Nov 11, 2021

Hello,

I would like to report for SQLI vulnerability.

Vulnerability path

File shopex\ecshop\upload\api\client\api.php

dispatch($_POST);

File shopex\ecshop\upload\api\client\includes\lib_api.php

function dispatch($post)
    {
        
        $func_arr = array('GetDomain', 'UserLogin', 'AddCategory', 'AddBrand', 'AddGoods', 'GetCategory', 'GetBrand', 'GetGoods', 'DeleteBrand', 'DeleteCategory', 'DeleteGoods', 'EditBrand', 'EditCategory', 'EditGoods');
        if(in_array($post['Action'], $func_arr) && function_exists('API_'.$post['Action']))
        {
            call_user_func('API_'.$post['Action'], $post);

File shopex\ecshop\upload\api\client\includes\lib_api.php

function API_UserLogin($post)
    {
        $post['username'] = isset($post['UserId']) ? trim($post['UserId']) : '';
        $post['password'] = isset($post['Password']) ? strtolower(trim($post['Password'])) : '';

        
        $sql = "SELECT user_id, user_name, password, action_list, last_login".
        " FROM " . $GLOBALS['ecs']->table('admin_user') .
        " WHERE user_name = '" . $post['username']. "'";

        $row = $GLOBALS['db']->getRow($sql);

File shopex\ecshop\upload\includes\cls_mysql.php

function getRow($sql, $limited = false)
    {
        $res = $this->query($sql);
@Lengso
Copy link

Lengso commented Dec 5, 2021

Hello,

I would like to report for SQLI vulnerability.

Vulnerability path

File shopex\ecshop\upload\api\client\api.php

dispatch($_POST);

File shopex\ecshop\upload\api\client\includes\lib_api.php

function dispatch($post)
    {
        
        $func_arr = array('GetDomain', 'UserLogin', 'AddCategory', 'AddBrand', 'AddGoods', 'GetCategory', 'GetBrand', 'GetGoods', 'DeleteBrand', 'DeleteCategory', 'DeleteGoods', 'EditBrand', 'EditCategory', 'EditGoods');
        if(in_array($post['Action'], $func_arr) && function_exists('API_'.$post['Action']))
        {
            call_user_func('API_'.$post['Action'], $post);

File shopex\ecshop\upload\api\client\includes\lib_api.php

function API_UserLogin($post)
    {
        $post['username'] = isset($post['UserId']) ? trim($post['UserId']) : '';
        $post['password'] = isset($post['Password']) ? strtolower(trim($post['Password'])) : '';

        
        $sql = "SELECT user_id, user_name, password, action_list, last_login".
        " FROM " . $GLOBALS['ecs']->table('admin_user') .
        " WHERE user_name = '" . $post['username']. "'";

        $row = $GLOBALS['db']->getRow($sql);

File shopex\ecshop\upload\includes\cls_mysql.php

function getRow($sql, $limited = false)
    {
        $res = $this->query($sql);

Hello,The program exits when it runs to this point, and it will not cause sql injection

api/client/includes/init.php:101

if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) && ($_POST['Action'] != 'UserLogin'))
{
    client_show_message(110);
}

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

2 participants