SQL Injection Vulnerability in libphp-adodb: Improper Escaping of Query Parameters
Summary
DEBIAN-CVE-2025-54119: ADOdb is a PHP database class library that provides abstractions for performing queries and managing databases. Affects libphp-adodb versions < 5.22.10-0.1. Fixed in 5.22.10-0.1. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
libphp-adodb is a PHP database class library designed to provide abstractions for executing queries and managing various database systems. It supports multiple database types, including MySQL, PostgreSQL, and SQLite. The library is widely used in PHP applications for its ease of use and flexibility. However, certain versions of libphp-adodb have been found to be vulnerable to SQL injection attacks due to improper handling of query parameters when interacting with SQLite databases.
Vulnerability Detail
The vulnerability arises from improper escaping of a query parameter in versions 5.22.9 and below of libphp-adodb. When the library connects to a SQLite3 database and calls the metaColumns(), metaForeignKeys(), or metaIndexes() methods with a crafted table name, an attacker can execute arbitrary SQL statements. This can lead to unauthorized data access, data manipulation, or even complete database compromise, making it critical for users to address this issue promptly.
How To Fix
Minimum fixed version
5.22.10-0.1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade libphp-adodb
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 $table parameter of the metaColumns(), metaForeignKeys(), and metaIndexes() methods. For example, validate and sanitize the input before passing it to these methods to prevent injection attacks. Here is a sample code snippet for validation:
if (preg_match('/^[a-zA-Z0-9_]+$/', $table)) {
// Safe to use $table
} else {
// Handle invalid table name
}
Conclusion
The SQL injection vulnerability in libphp-adodb poses significant risks to applications using affected versions. It is crucial for developers and system administrators to update to the patched version and implement the recommended workarounds to safeguard their databases from potential attacks.
See every vulnerability recorded for libphp-adodb →
FAQ
The vulnerability is an SQL injection flaw caused by improper escaping of query parameters in specific methods when interacting with SQLite databases.
Versions 5.22.9 and below are affected by this vulnerability.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If exploited, this vulnerability could allow attackers to execute arbitrary SQL statements, potentially leading to unauthorized access or manipulation of the database.
Yes, the vulnerability has been fixed in version 5.22.10-0.1 of libphp-adodb. Users are advised to update to this version or later.
References
Related vulnerabilities
Recent vulnerabilities recorded for libphp-adodb.