ecshop一处验证码绕过逻辑漏洞

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

### 简要描述: 一处逻辑漏洞导致绕过 ### 详细说明: 虽然验证码进行了加密,但是逻辑上还有点问题 问题出在 ..\includes\cls_captcha.php 通过验证函数可以看到直接返回,并没有对验证失败进行处理 ``` function check_word($word) { $recorded = isset($_SESSION[$this->session_word]) ? base64_decode($_SESSION[$this->session_word]) : ''; $given = $this->encrypts_word(strtoupper($word)); //MD5加密处理 return (preg_match("/$given/", $recorded)); //验证规则 } ``` 也就是说如果登陆失败的时候没有对验证码SESSION置空的话,就可以在这次请求中反复尝试进行破解。 下面代码可以看到并没有对验证错误的时候进行处理 ..\ecshop\admin\privilege.php ``` if (intval($_CFG['captcha']) & CAPTCHA_ADMIN) { include_once(ROOT_PATH . 'includes/cls_captcha.php'); /* 检查验证码是否正确 */ $validator = new captcha(); if (!empty($_POST['captcha']) && !$validator->check_word($_POST['captcha'])) { sys_msg($_LANG['captcha_error'], 1); } } $_POST['username'] = isset($_POST['username']) ? trim($_POST['username']) : ''; $_POST['password'] = isset($_POST['password']) ? trim($_POST['password']) : ''; $sql="SELECT `ec_salt` FROM ". $ecs->table('admin_user') ."WHERE user_name = '" ....

0%
暂无可用Exp或PoC
当前有0条受影响产品信息