Arbitrary ECSHOP Front-End User Login

Source: Internet
Author: User

Arbitrary ECSHOP Front-End User Login
Arbitrary user logon to the website due to code design defects. File: flow. php starts at line 1

Elseif ($ _ REQUEST ['step'] = 'login') {include_once ('AGES /'. $ _ CFG ['lang ']. '/user. php ');/** User Login registration */if ($ _ SERVER ['request _ method'] = 'get ')..... else {include_once ('includes/lib_passport.php '); if (! Empty ($ _ POST ['ac']) & $ _ POST ['ac'] = 'signin ') {$ captcha = intval ($ _ CFG ['captcha ']); if ($ captcha & CAPTCHA_LOGIN )&&(! ($ Captcha & CAPTCHA_LOGIN_FAIL) | ($ captcha & CAPTCHA_LOGIN_FAIL) & $ _ SESSION ['login _ fail ']> 2) & gd_version ()> 0) {if (empty ($ _ POST ['captcha ']) {show_message ($ _ LANG ['invalid _ captcha']);} /* Check the Verification Code */include_once ('regiondes/cls_captcha.php '); $ validator = new captcha (); $ validator-> session_word = 'captcha _ login'; if (! $ Validator-> check_word ($ _ POST ['captcha ']) {show_message ($ _ LANG ['invalid _ captcha']);} if ($ user-> login ($ _ POST ['username'], $ _ POST ['Password'], isset ($ _ POST ['remember']) {.....}

 

The above code performs the login operation $ user-> login ($ _ POST ['username'], $ _ POST ['Password'], the isset ($ _ POST ['member']) login method is as follows:
(Function login ($ username, $ password, $ remember = null) {if ($ this-> check_user ($ username, $ password)> 0) {if ($ this-> need_sync) {$ this-> sync ($ username, $ password);} $ this-> set_session ($ username ); $ this-> set_cookie ($ username, $ remember); return true;} else {return false;} function check_user ($ username, $ password = null) {$ post_username = $ username;/* if no password is defined, check the username */if ($ password = null) {$ SQL = "SELECT ". $ this-> field_id. "FROM ". $ this-> table ($ this-> user_table ). "WHERE ". $ this-> field_name. "= '". $ post_username. "'"; return $ this-> db-> getOne ($ SQL);} else {$ SQL = "SELECT ". $ this-> field_id. "FROM ". $ this-> table ($ this-> user_table ). "WHERE ". $ this-> field_name. "= '". $ post_username. "'AND ". $ this-> field_pass. "= '". $ this-> compile_password (array ('Password' => $ password )). "'"; return $ this-> db-> getOne ($ SQL );}}

 

The check_user method is finally executed for the login operation. When the user password is null, only the user name is determined. In flow. php, the password is not determined or initialized. You can log on with an account only. Url:./flow. php? Step = login POST: act = signin & username = xxxx & captcha = yyyyy captcha is a verification code, and sometimes it is not required.

Solution:
Just initialize the password.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.