Описание
SQL injection in ADOdb PostgreSQL driver pg_insert_id() method
Improper escaping of a query parameter may allow an attacker to execute arbitrary SQL statements when the code using ADOdb connects to a PostgreSQL database and calls pg_insert_id() with user-supplied data.
Note that the indicated Severity corresponds to a worst-case usage scenario.
Impact
PostgreSQL drivers (postgres64, postgres7, postgres8, postgres9).
Patches
Vulnerability is fixed in ADOdb 5.22.9 (11107d6d6e5160b62e05dff8a3a2678cf0e3a426).
Workarounds
Only pass controlled data to pg_insert_id() method's $fieldname parameter, or escape it with pg_escape_identifier() first.
References
- Issue https://github.com/ADOdb/ADOdb/issues/1070
- Blog post by Marco Nappi
Credits
Thanks to Marco Nappi (@mrcnpp) for reporting this vulnerability.
Ссылки
- https://github.com/ADOdb/ADOdb/security/advisories/GHSA-8x27-jwjr-8545
- https://nvd.nist.gov/vuln/detail/CVE-2025-46337
- https://github.com/ADOdb/ADOdb/issues/1070
- https://github.com/ADOdb/ADOdb/commit/11107d6d6e5160b62e05dff8a3a2678cf0e3a426
- https://lists.debian.org/debian-lts-announce/2025/05/msg00029.html
- https://xaliom.blogspot.com/2025/05/from-sast-to-cve-2025-46337.html
Пакеты
adodb/adodb-php
<= 5.22.8
5.22.9
Связанные уязвимости
ADOdb is a PHP database class library that provides abstractions for performing queries and managing databases. Prior to version 5.22.9, improper escaping of a query parameter may allow an attacker to execute arbitrary SQL statements when the code using ADOdb connects to a PostgreSQL database and calls pg_insert_id() with user-supplied data. This issue has been patched in version 5.22.9.
ADOdb is a PHP database class library that provides abstractions for performing queries and managing databases. Prior to version 5.22.9, improper escaping of a query parameter may allow an attacker to execute arbitrary SQL statements when the code using ADOdb connects to a PostgreSQL database and calls pg_insert_id() with user-supplied data. This issue has been patched in version 5.22.9.
ADOdb is a PHP database class library that provides abstractions for p ...
Уязвимость библиотеки adodb, связанная с непринятием мер по защите структуры запроса SQL, позволяющая нарушителю выполнить произвольный код