Repository navigation
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 withenvorputenv()could be freed while still in use, so a client could control what latergetenv()calls return. The JIT is off by default (GHSA-2v8j-j26h-cpx5). - High, document root placeholders: When the
rootofphporphp_serverwas built from a client-controlled value, such as{query.tenant}, a%00in that value made PHP run or print a file thesplitextension excludes. Sites with a fixedrootare not affected (GHSA-h69m-723r-5w86). - Medium, Caddy rules bypass: With a worker
matchrule, a request such as/x.php/adminreached the worker withPATH_INFO=/admin, bypassing a Caddypathrule on/admin*. Whenmatchroutes a request to a worker,PATH_INFOandDOCUMENT_URIare now always empty, andSCRIPT_NAMEandPHP_SELFname 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
mercuredirective 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 whichGOMEMLIMITsets by @nicolas-grekas in #2878.apache_request_headers()andgetallheaders()now includeHostfor 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: userandom_int()orRandom\Randomizerfor 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
- @alepacheco made their first contribution in #2867
Full Changelog: v1.14.0...v1.14.1