Critical

Authentication Bypass in ADOdb/ADOdb

  • Disclosed: 27.01.2022
  • Updated: 11.10.2026 10:22

Impact

An attacker can inject values into a PostgreSQL connection string by providing a parameter surrounded by single quotes.

Depending on how the library is used in the client software, this may allow an attacker to bypass the login process, gain access to the server's IP address, etc.

Patches

The vulnerability is fixed in ADOdb versions 5.20.21 (952de6c4273d9b1e91c2b838044f8c2111150c29) and 5.21.4 or later (b4d5ce70034c5aac3a1d51d317d93c037a0938d2).

The simplest patch is to delete line 29 in drivers/adodb-postgres64.inc.php:

php
diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php
index d04b7f67..729d7141 100644
--- a/drivers/adodb-postgres64.inc.php
+++ b/drivers/adodb-postgres64.inc.php
@@ -26,7 +26,6 @@ function adodb_addslashes($s)
 {
    $len = strlen($s);
    if ($len == 0) return "''";
-   if (strncmp($s,"'",1) === 0 && substr($s,$len-1) == "'") return $s; // already quoted
 
    return "'".addslashes($s)."'";
 }

Workarounds

Ensure the parameters passed to ADOConnection::connect() or related functions (nConnect(), pConnect()) are not surrounded by single quotes.

Credits

Thanks to Emmet Leahy (@meme-lord) of Sorcery Ltd for reporting this vulnerability, and to the huntr team for their support.

References

For more information

If you have any questions or comments about this advisory:

  • Add a note in issue #793
  • Contact the maintainers on Gitter

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Composer package adodb/adodb-php < 5.20.21, >= 5.21.0, < 5.21.4 5.20.21, 5.21.4

References

CVSS score 9.1/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Weakness (CWE)
CWE-287, CWE-305
Platform
Composer
Package
adodb/adodb-php
Disclosed
27.01.2022
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-65mj-7c86-79jf - CC BY 4.0

Vulnerability history: adodb/adodb-php

All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
6
First → latest
01.2022 08.2025
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 5
  • Medium 1

Disclosures per year

  1. 2022: 3
  2. 2023: 0
  3. 2024: 1
  4. 2025: 2
  5. 2026: 0
  1. Critical · 10.0 CVE-2025-54119 < 5.22.10 5.22.10
  2. Critical · 10.0 CVE-2025-46337 < 5.22.9 5.22.9
  3. Critical ghsa-h63c-xvpf-264j < 5.20.11 5.20.11
  4. Medium · 6.1 CVE-2016-4855 < 5.20.6 5.20.6
  5. Critical · 9.8 CVE-2016-7405 >= 5.0, < 5.20.7 5.20.7
  6. Authentication Bypass in ADOdb/ADOdb this entry
    Critical · 9.1 CVE-2021-3850 < 5.20.21, >= 5.21.0, < 5.21.4 5.20.21, 5.21.4

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.