Skip to content

SQL injection in ADOdb PostgreSQL driver pg_insert_id() method

Critical severity GitHub Reviewed Published May 1, 2025 in ADOdb/ADOdb • Updated May 5, 2025

Package

composer adodb/adodb-php (Composer)

Affected versions

<= 5.22.8

Patched versions

5.22.9

Description

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

Credits

Thanks to Marco Nappi (@mrcnpp) for reporting this vulnerability.

References

@dregad dregad published to ADOdb/ADOdb May 1, 2025
Published to the GitHub Advisory Database May 1, 2025
Reviewed May 1, 2025
Published by the National Vulnerability Database May 1, 2025
Last updated May 5, 2025

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(19th percentile)

Weaknesses

CVE ID

CVE-2025-46337

GHSA ID

GHSA-8x27-jwjr-8545

Source code

Credits

This advisory has been edited. See History.
See something to contribute? Suggest improvements for this vulnerability.