Skip to content

v1.14.1

Latest

Choose a tag to compare

@dunglas-release dunglas-release released this 03 Dec 11:51
5254154

FrankenPHP 1.14.1 is a security release. It fixes 3 vulnerabilities in FrankenPHP, two of them rated high: a use-after-free in getenv() when the OPcache JIT is enabled, and a NUL byte in a document root built from request data that let PHP run files the split extension should exclude. It also upgrades to Mercure 1.1.7, which fixes 13 vulnerabilities in the built-in Mercure hub and makes it up to 2.5x faster. This release also stops max_threads auto from starting more threads than a container's memory allows, and fixes apache_request_headers() missing Host over HTTP/1.1. Upgrading is strongly recommended.

🔒 Security

  • High, use-after-free: With the OPcache JIT enabled, the result of getenv() for a value set with env or putenv() could be freed while still in use, so a client could control what later getenv() calls return. The JIT is off by default (GHSA-2v8j-j26h-cpx5).
  • High, document root placeholders: When the root of php or php_server was built from a client-controlled value, such as {query.tenant}, a %00 in that value made PHP run or print a file the split extension excludes. Sites with a fixed root are not affected (GHSA-h69m-723r-5w86).
  • Medium, Caddy rules bypass: With a worker match rule, a request such as /x.php/admin reached the worker with PATH_INFO=/admin, bypassing a Caddy path rule on /admin*. When match routes a request to a worker, PATH_INFO and DOCUMENT_URI are now always empty, and SCRIPT_NAME and PHP_SELF name the worker script (GHSA-hg2f-3j3f-v3r3) by @AlliBalliBaba and @dunglas in #2889.
  • Mercure: The built-in Mercure hub had 13 vulnerabilities, 5 of them rated high. Only sites using the mercure directive are affected. Upgrade to Mercure 1.1.7 by @dunglas in #2885.

None of the FrankenPHP vulnerabilities is exploitable with the default configuration. Each requires a non-default setting: the OPcache JIT, a root built from request placeholders, or a worker match rule combined with an application that routes on PATH_INFO. These three and the Mercure vulnerabilities were all found by Anthropic's OSS Scanner.

🐛 Bug Fixes

  • max_threads auto: In a container, the thread limit was computed from the host's memory, so a container of a few hundred MB on a large host could start hundreds of threads and get killed under load. It now uses Go's memory limit when lower, which Caddy derives from the container's cgroup, or which GOMEMLIMIT sets by @nicolas-grekas in #2878.
  • apache_request_headers() and getallheaders() now include Host for HTTP/1.1 requests, matching $_SERVER['HTTP_HOST'], Apache and PHP-FPM by @lazerg in #2877.
  • Static builds: Build libaom from its latest release instead of its development branch, which no longer compiles, and use the lz4 extension's official PHP 8.6 release by @dunglas in #2892 and #2893.

⚡ Performance Improvements

  • Mercure: The built-in hub delivers up to 2.5x more updates per second on 2.5x less CPU, thanks to faster URL Pattern matching and batched writes. See the Mercure 1.1.7 benchmarks by @dunglas in #2885.
  • Initialize the locale state of each PHP thread, so locale-aware functions such as basename() take their ASCII fast path with UTF-8 locales by @henderkes in #2882.

📖 Documentation

  • Worker mode never reseeds the legacy random generators (mt_rand(), rand(), shuffle()…) between requests: use random_int() or Random\Randomizer for security-sensitive values by @alepacheco in #2867.
  • Clarify how to build without Brotli by @andreybolonin in #2793.
  • Datadog is now compatible with ZTS PHP, and is no longer listed as a known issue by @henderkes in #2883.

🙏 Sponsor the Maintainers

Each FrankenPHP release now goes along with a steady flow of AI-found vulnerability reports that we reproduce, triage and fix, on top of keeping static binaries building against moving upstream dependencies. Thank you to our sponsors, who make this work possible!

If you or your company rely on FrankenPHP, please consider sponsoring its maintainers:

💖 New Contributors

Full Changelog: v1.14.0...v1.14.1