Miggo Logo

CVE-2025-46337:
SQL injection in ADOdb PostgreSQL driver pg_insert_id() method

10

CVSS Score
3.1

Basic Information

EPSS Score
0.22395%
Published
5/1/2025
Updated
5/5/2025
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
adodb/adodb-phpcomposer<= 5.22.85.22.9

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The analysis is based on the provided commit 11107d6d6e5160b62e05dff8a3a2678cf0e3a426. This commit modifies the pg_insert_id function within the drivers/adodb-postgres64.inc.php file. The patch clearly shows that the original code directly concatenated user-supplied $tablename and $fieldname into a SQL query string to fetch last_value from a sequence. This lack of sanitization is a classic SQL injection vulnerability. The fix introduces the use of pg_escape_identifier to sanitize the constructed sequence name before it's used in the query. The function is identified as ADODB_postgres64::pg_insert_id, assuming the common ADOdb naming convention where the class name matches the driver file name (adodb-postgres64.inc.php). The vulnerability description mentions that other PostgreSQL drivers (postgres7, postgres8, postgres9) are also affected, implying the same pg_insert_id method with similar vulnerable code likely exists in their respective driver files (e.g., ADODB_postgres7::pg_insert_id). However, as per the instruction to focus on the provided patch, only the function from adodb-postgres64.inc.php is listed with high confidence based on the direct evidence from the commit patch.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

Improp*r *s**pin* o* * qu*ry p*r*m*t*r m*y *llow *n *tt**k*r to *x**ut* *r*itr*ry SQL st*t*m*nts w**n t** *o** usin* **O** *onn**ts to * Post*r*SQL **t***s* *n* **lls p*_ins*rt_i*() wit* us*r-suppli** **t*. Not* t**t t** in*i**t** S*v*rity *orr*spon

Reasoning

T** *n*lysis is **s** on t** provi*** *ommit `****************************************`. T*is *ommit mo*i*i*s t** `p*_ins*rt_i*` *un*tion wit*in t** `*riv*rs/**o**-post*r*s**.in*.p*p` *il*. T** p*t** *l**rly s*ows t**t t** ori*in*l *o** *ir**tly *on*