CVE-2025-14179: NUL-byte SQL injection in PHP PDO Firebird
- Vendor
- PHP Group
CVE-2025-14179 is an SQL injection vulnerability in PHP's PDO Firebird driver affecting PHP 8.2 before 8.2.31, 8.3 before 8.3.31, 8.4 before 8.4.21, and 8.5 before 8.5.6. During PDO::prepare(), the driver tokenizes and reconstructs SQL using strncat(), which stops copying string-token data at an embedded NUL byte. This can discard a string literal's closing quote and alter the interpretation of subsequent SQL tokens, allowing attacker-controlled values to become executable SQL despite having been correctly escaped with PDO::quote(). The flaw occurs in preprocessing before native statement preparation, not in the quoting routine itself.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation compromises the intended separation between SQL syntax and quoted application data. Attackers can manipulate query logic and retrieve unauthorized database records or database metadata. Data modification or deletion may also be possible, depending on the affected query and the database account's privileges. Demonstrated exploitation includes UNION-based retrieval of user records and database-engine version information. Operating-system command execution is not established.
Mitigation
If you can’t patch tonight, do this now.
Until patched, avoid embedding PDO::quote() output into SQL text; use parameter placeholders with bound values instead. Reject embedded NUL bytes in inputs that can reach the affected query-construction path where application requirements permit. Restrict the application's database account to necessary privileges to limit potential impact. Disabling prepared-statement emulation is not a workaround: PDO Firebird already uses native preparation, and the flaw occurs in its preceding SQL preprocessing.
Remediation
Patch, then assume compromise.
Upgrade PHP to 8.2.31, 8.3.31, 8.4.21, 8.5.6, or a later supported patched release, or install an equivalent vendor-backported security update. The fix replaces strncat()-based token reconstruction with binary-safe handling that preserves complete string literals containing NUL bytes. For products bundling PHP, apply the vendor release containing the patched runtime.
Exploits
No public exploits tracked yet. Mallory keeps watching.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2025-14179 exploited in the wild?
- As of Oct 17, 2026, Mallory has no reports of CVE-2025-14179 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2025-14179?
- As of Oct 17, 2026, Mallory has found no public exploit for CVE-2025-14179.
- Is there a patch for CVE-2025-14179?
- Upgrade PHP to 8.2.31, 8.3.31, 8.4.21, 8.5.6, or a later supported patched release, or install an equivalent vendor-backported security update. The fix replaces strncat()-based token reconstruction with binary-safe handling that preserves complete string literals containing NUL bytes.
- What products are affected by CVE-2025-14179?
- PHP Group Php.
- How severe is CVE-2025-14179?
- CVE-2025-14179 has a CVSS v4 score of 7.4 (High) and an EPSS score of 0.44% (39th percentile) as of Oct 17, 2026.
Recent activity
25 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.