The score on this one looks scary, but only a small slice of PHP setups are actually in its path. Here’s how to tell if you’re one of them.

At a glance

  • CVE: CVE-2024-11236
  • Severity: 9.8 (Critical) at NVD. PHP’s own advisory rates it medium.
  • Affected: PHP 8.1 before 8.1.31, 8.2 before 8.2.26, and 8.3 before 8.3.14, but only if you use the PDO Firebird or PDO dblib driver, and mainly on 32-bit builds.
  • Known exploited: No. It’s not on CISA’s KEV list.

What’s going on

First, a heads-up: NVD’s description of this CVE talks about ldap_escape() on 32-bit systems. That’s actually a different bug, which PHP tracks as CVE-2024-8932 and fixed in the same releases. PHP’s advisory and ChangeLog tie CVE-2024-11236 to the Firebird and dblib PDO drivers, so that’s what this post covers. Either way, the fixed versions are the same.

Now the bug itself. When you call PDO::quote(), the database driver works out how much room the quoted string needs before building it. In the Firebird (pdo_firebird) and dblib (pdo_dblib) drivers, that size sum can overflow on a very long input, or end up larger than PHP’s maximum string length. Either way, PHP ends up writing past the end of the buffer it set aside. That kind of out-of-bounds write can crash PHP or corrupt memory, and PHP notes it’s especially triggerable on 32-bit builds.

So who should care? You’d need all of these:

  • an app that uses PDO with Firebird, or with dblib (the driver PHP uses to talk to Microsoft SQL Server and Sybase through FreeTDS),
  • attacker-controlled, very long strings going through PDO::quote(),
  • and, realistically, a 32-bit PHP build.

If your app talks to MySQL/MariaDB, PostgreSQL or SQLite, this one doesn’t touch you. Not sure which build you’ve got? php -r 'echo PHP_INT_SIZE;' prints 8 on a 64-bit build and 4 on a 32-bit one.

Timeline

  • Disclosed: 2024-11-21 (PHP’s advisory went public with the fixed releases)
  • Patch released: 2024-11-21 (PHP 8.1.31, 8.2.26 and 8.3.14)
  • CVE published at NVD: 2024-11-24

== UPDATE ==

This was patched back in November 2024, so if you’ve kept PHP up to date, you’re already covered.

  • Patch available: Yep.
  • Fixed in: PHP 8.1.31, 8.2.26, 8.3.14. PHP 8.4 isn’t listed as affected. Keep in mind 8.1 reached end of life on 31 Dec 2025, so it’s worth moving to a supported branch.
  • 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. On a distro’s older PHP, look for its security update instead: Debian, for example, backported this fix to php7.4 on Debian 11 (bullseye) in version 7.4.33-1+deb11u7 (DLA-3986-1).
  • If you can’t patch yet: PHP doesn’t offer a workaround. If nothing on the server uses Firebird or dblib, disable the pdo_firebird and pdo_dblib extensions so the buggy code isn’t loaded at all. If you do need them, keep a firm cap on the length of user input before it gets anywhere near your database code.

References