If your PHP app talks to a Firebird database, this one’s for you. Everyone else can breathe a little easier.

At a glance

  • CVE: CVE-2025-14179. Aleksey Solovev and Nikita Sveshnikov of Positive Technologies found it.
  • Severity: 9.8 (Critical) at NVD. PHP’s own advisory rates it high.
  • Affected: 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, but only for apps using PDO’s Firebird driver (pdo_firebird).
  • Known exploited: No. It’s not on CISA’s KEV list.

What’s going on

PDO::quote() is meant to make a string safe to drop into SQL. With Firebird, there’s a catch. Before running a query, the driver rebuilds it token by token. When it reaches a quoted string that contains a NUL byte (\0), it copies it with a C function, strncat(), that stops at the NUL. So the closing quote gets lost, and whatever SQL comes next is swallowed into the string.

PHP’s advisory shows how that plays out. Quote "\0" and 'or 1=1--', put them into a query like WHERE name = {$param} AND name = {$param2}, and the driver ends up running WHERE name = ' AND name = 'or 1=1--', which hands back every row. If both values come from user input, that’s plain SQL injection, even though you did the “right thing” and quoted them. It applies to SELECT, INSERT, UPDATE, DELETE, MERGE, WITH and EXECUTE statements.

So who’s at risk? Apps that use PDO with Firebird and build SQL by running user values through PDO::quote() and pasting them into the query string. If you’re on MySQL/MariaDB, PostgreSQL or SQLite, this bug isn’t in your code path.

Timeline

  • Disclosed: 2026-05-07 (PHP’s advisory went public with the fixed releases)
  • Patch released: 2026-05-07 (PHP 8.2.31, 8.3.31, 8.4.21 and 8.5.6)
  • CVE published at NVD: 2026-05-10

== UPDATE ==

The May 2026 PHP releases fix it.

  • Patch available: Yep.
  • Fixed in: PHP 8.2.31, 8.3.31, 8.4.21, 8.5.6. Branches older than 8.2 are end of life and aren’t covered by PHP’s advisory, so if you’re still on one, a distro backport or an upgrade is your way out.
  • How to apply: Update PHP through your package manager (or PHP distribution) to the fixed release or anything newer on your branch, then restart your web server and any PHP-FPM pools so every worker loads the new build. As of this write-up, the newest releases are 8.2.36, 8.3.37, 8.4.28 and 8.5.13, and they include later security fixes too. If you use your distro’s PHP packages, install the distro’s security update instead; distros often backport the fix without bumping to the upstream version number.
  • If you can’t patch yet: PHP doesn’t list a workaround. Since the trick needs a NUL byte inside a quoted value, rejecting user input that contains "\0" (a quick str_contains($value, "\0") check) before it reaches your Firebird queries cuts off this attack. It’s a stopgap, though, not a substitute for upgrading.

References