SURMS - PHP (by: oretnom23 ) v1.0 SQL-Injection-Bypass-Authentication and PWNED PHPSESSID Hijacking

2021-09-07T00:00:00
ID AKB:D3BCCEE1-AE82-4A8F-B215-08715B42A3AC
Type attackerkb
Reporter AttackerKB
Modified 2021-09-07T00:00:00

Description

The SURMS – PHP (by: oretnom23 ) v1.0 is vulnerable from remote SQL-Injection-Bypass-Authentication for the admin account and PWNED PHPSESSID Hijacking in app /storage/classes/Login.php. remote SQL-Injection-Bypass-Authentication: <https://portswigger.net/support/using-sql-injection-to-bypass-authentication>. The parameter (username) from the login form is not protected correctly and there is no security and escaping from malicious payloads. When the user will sending a malicious query or malicious payload to the MySQL server for those three accounts, he can bypass the login credentials and take control of these accounts. And the second time he can access the admin account by using the PHPSESSID Hijacking technique.

Recent assessments:

nu11secur1ty at September 07, 2021 10:58am UTC reported:

CVE-nu11-08-09072021

VENDOR

Vulnerability Description:

The SURMS – PHP (by: oretnom23 ) v1.0 is vulnerable from remote SQL-Injection-Bypass-Authentication for the admin account in app: /storage/classes/Login.php and XSS PWNED PHPSESSID Hijacking in app “tenants”.
Remote SQL-Injection-Bypass-Authentication: <https://portswigger.net/support/using-sql-injection-to-bypass-authentication>.
The parameter (username) from the login form is not protected correctly and there is no security and escaping from malicious payloads.
When the user will sending a malicious query or malicious payload to the MySQL server for those three accounts, he can bypass the login credentials and take control of these accounts.
And the second time he can access the admin account by using the PHPSESSID Hijacking technique.

Vulnerable PHP code:

    public function login(){
        extract($_POST);

        $qry = $this-&gt;conn-&gt;query("SELECT * from users where username = '$username' and password = md5('$password') ");
        if($qry-&gt;num_rows &gt; 0){
            foreach($qry-&gt;fetch_array() as $k =&gt; $v){
                if(!is_numeric($k) && $k != 'password'){
                    $this-&gt;settings-&gt;set_userdata($k,$v);
                }

            }
            $this-&gt;settings-&gt;set_userdata('login_type',1);
        return json_encode(array('status'=&gt;'success'));
        }else{
        return json_encode(array('status'=&gt;'incorrect','last_qry'=&gt;"SELECT * from users where username = '$username' and password = md5('$password') "));
        }
    }

Proof:

href

Assessed Attacker Value: 5
Assessed Attacker Value: 5Assessed Attacker Value: 5