CVE-2025-46337: SQL Injection Vulnerability in ADOdb PostgreSQL Driver

adodb/adodb-php Updated 02 Oct 2025

Summary

01/05/2025
Yes i
Critical
10.0

CVE-2025-46337: SQL injection in ADOdb PostgreSQL driver pg_insert_id() method. Affects adodb/adodb-php versions < 5.22.9. Fixed in 5.22.9. How to fix ↓

Also tracked for

The same CVE-2025-46337 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

ADOdb is a database abstraction library for PHP that provides a consistent interface for various database systems. It simplifies database interactions by allowing developers to write code that can work with multiple database types without needing to change the underlying SQL syntax. The library supports various databases, including PostgreSQL, MySQL, and SQLite, making it a popular choice for PHP developers. However, a critical vulnerability has been identified in the PostgreSQL driver, specifically in the pg_insert_id() method, which can lead to SQL injection attacks if not properly handled.

Vulnerability Detail

The vulnerability arises from improper escaping of a query parameter in the pg_insert_id() method of the ADOdb PostgreSQL driver. When user-supplied data is passed to this method without adequate validation or escaping, it allows an attacker to execute arbitrary SQL statements. This can lead to unauthorized data access, data manipulation, or even complete database compromise. The severity of this vulnerability is classified as critical, with a CVSS score of 10.0, indicating a high risk to applications using affected versions of ADOdb.

How To Fix

Minimum fixed version

5.22.9

This is the first release that contains the fix.

composer require adodb/adodb-php:5.22.9

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, ensure that only controlled data is passed to the pg_insert_id() method's $fieldname parameter. Alternatively, you can escape the parameter using the pg_escape_identifier() function before passing it to pg_insert_id(). Here is an example of how to implement this workaround:

$fieldname = pg_escape_identifier($user_input);
$insert_id = $adodb->pg_insert_id($fieldname);

Conclusion

The SQL injection vulnerability in the ADOdb PostgreSQL driver poses a significant risk to applications using affected versions. It is crucial to update to the latest version to mitigate this risk. Implementing the recommended workarounds can provide temporary relief, but a full update is the best long-term solution.

See every vulnerability recorded for adodb/adodb-php →

Share this vulnerability

FAQ

The vulnerability is an SQL injection flaw in the pg_insert_id() method of the ADOdb PostgreSQL driver, allowing attackers to execute arbitrary SQL commands.

Versions of ADOdb prior to 5.22.9 are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If an immediate update is not possible, implement the recommended workaround by ensuring controlled data is passed to the pg_insert_id() method or by escaping the input.

Exploitation of this vulnerability can lead to unauthorized access to sensitive data, data corruption, or complete control over the database.

Related vulnerabilities

Recent vulnerabilities recorded for adodb/adodb-php.

How To Fix

Minimum fixed version

5.22.9

This is the first release that contains the fix.

composer require adodb/adodb-php:5.22.9

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback