9.1critical
Authentication Bypass by Primary Weakness in adodb/adodb
- Severity
- 9.1critical CVSS:3.0 by @huntrdev
- Exploit likelihood
- 2.33% (higher than 84% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- @huntrdev
- Also known as
- GHSA-65mj-7c86-79jf
Description
Authentication Bypass by Primary Weakness in GitHub repository adodb/adodb prior to 5.20.21.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| adodb adodb/adodb | from unspecified before 5.20.21 | CVE List |
| adodb/adodb-php (Packagist) | before 5.20.21, from 5.21.0 before 5.21.4 | GitHub Advisory Database |
| adodb_project adodb | up to 5.20.21 | NVD |
| debian debian_linux | 9.0 | NVD |
All scores
| @huntrdev | 9.1critical CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| GitHub | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| NVD | 6.4medium CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:N |
Classification
What each source says
CVE List
Authentication Bypass by Primary Weakness in GitHub repository adodb/adodb prior to 5.20.21.
GitHub Advisory Database
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:
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
- Original issue report https://huntr.dev/bounties/bdf5f216-4499-4225-a737-b28bc6f5801c/
- ADOdb reference issue #793
For more information
If you have any questions or comments about this advisory:
- Add a note in issue #793
- Contact the maintainers on Gitter
NVD (es)
Una Omisión de Autenticación por Debilidad Primaria en el repositorio de GitHub adodb/adodb versiones anteriores a 5.20.21
References
| https://huntr.dev/bounties/bdf5f216-4499-4225-a737-b28bc6f5801c | exploit, issue-tracking, patch, third-party-advisory, web | |
| https://github.com/adodb/adodb/commit/952de6c4273d9b1e91c2b838044f8c2111150c29 | patch, third-party-advisory | |
| https://lists.debian.org/debian-lts-announce/2022/02/msg00006.html | mailing-list, third-party-advisory, web | |
| https://www.debian.org/security/2022/dsa-5101 | third-party-advisory, vendor-advisory, web | |
| https://github.com/ADOdb/ADOdb/security/advisories/GHSA-65mj-7c86-79jf | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-3850 | advisory | |
| https://github.com/ADOdb/ADOdb/issues/793 | web | |
| https://github.com/ADOdb/ADOdb/commit/952de6c4273d9b1e91c2b838044f8c2111150c29 | web | |
| https://github.com/ADOdb/ADOdb/commit/b4d5ce70034c5aac3a1d51d317d93c037a0938d2 | web | |
| https://github.com/ADOdb/ADOdb | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-3850 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-65mj-7c86-79jf changed 2023-11-08 | CC-BY-4.0 |
| NVD | CVE-2021-3850 changed 2026-06-17 | Public domain |