Skip to content

1.37.3

Latest

Choose a tag to compare

@phpclub phpclub released this 27 Nov 10:13

FreeUnit 1.37.3, 27 Nov 2026

This is a security release, and every user should upgrade. It fixes three groups of security issues, each with its own advisory: the request path of the Java module, WebSocket, timer and proxy buffers in the router, and route rules that a rewrite or a pass with variables could bypass. Java applications are affected with no special setting. The value of a variable in rewrite and pass is now used as data, which can change the result of a working configuration: read the Upgrade Notes first. The release also updates Wasmtime to 48.0.10, rustix to 1.1.6 and url to 2.5.9, adds Docker images for PHP 8.6, and brings back the Homebrew tap.

Security

  • Java module request path. The Java module took the path for the servlet mapping from the request URI as the client sent it: decoded, but with . and .. segments and repeated slashes left in. A client was able to get the files of WEB-INF and META-INF, to read the files of the directory above the application directory (and one more level for each segment of a context path), to get a static file in place of a mapped servlet, and to skip a filter with a prefix pattern. A file name followed by / gave the source of a JSP file instead of its output. The module now resolves the path before the mapping, answers 404 for WEB-INF and META-INF in any letter case and for each servlet, and answers 404 for a file name followed by /. Advisory: GHSA-h635-72hj-3wfw
  • WebSocket, timer and proxy buffers in the router. The router process could crash, or read memory that it had freed, when a WebSocket connection ended while messages of the application were still unsent, or when the send timeout ended a WebSocket request. The memory of the unsent messages was not released, and after enough such connections the application stopped answering. At the upgrade the router also released the request header buffers that the request still read, so an access log record could hold bytes of another request, and on musl the router process ended. The same advisory covers a timer handler that could run for a timer that was armed again, a proxy response header buffer that was released while it was still parsed after a 1xx response, and a crash on a TLS listener with a max_frame_size of about 4 GiB or more. Advisory: GHSA-hm9m-3c5h-jqp7
  • Route rules with rewrite and pass. The router decoded the value of a variable in a rewrite or a pass template after it inserted the value, so $uri and $arg_* were decoded twice. A rewrite result that did not start with / kept a leading .. segment, so a share that joins a directory and $uri could serve a file outside that directory. The action could then use another path, application, target, route or upstream than the one that the route rules matched. After a rewrite, a proxy action also sent a ? or # of the new path unencoded. A raw # in the request target and a Host field with an empty host part or a dot in the port gave the same kind of mismatch. Advisory: GHSA-p2mm-qm5c-m9w7
  • A request target that contains an unencoded space, a control character such as HTAB, or DEL now gets a 400 response. Before, the router accepted such a target. Percent-encoded spaces and control characters remain supported.
  • The Last-Modified header field of a static file was formatted with no range check of the modification time. A time far outside the years 1000 to 9999 could crash the router. Such a file is now served without Last-Modified.
  • The router, the discovery process, the prototype processes and the application processes of embedded language modules kept the listen socket of the control API open. Now only the main process and the controller keep it.
  • Wasmtime, wasmtime-wasi and wasmtime-wasi-http move from 48.0.8 to 48.0.10 (RUSTSEC-2026-0566 through RUSTSEC-2026-0573, and RUSTSEC-2026-0587, which affects Windows hosts only). Cranelift moves to 0.135.10, and the contrib C API pin is 48.0.10 too. rustix moves to 1.1.6 for RUSTSEC-2026-0486, and url to 2.5.9 for RUSTSEC-2026-0592.

New

  • Docker images for PHP 8.6: php-8.6 with the non-thread-safe build (NTS), like the images of PHP 8.3 to 8.5, and php-8.6-zts with the thread-safe build (ZTS). The official cli image of PHP 8.6 is ZTS, and the official nts image has no embed SAPI, which the PHP module needs. So the NTS base is built from the official cli recipe without the ZTS options and published as ghcr.io/freeunitorg/php-nts.

Changes

  • The value of a variable other than $request_uri in a rewrite or a pass template is now used as data. A %XX in a value is not decoded, and a ? or # in a value no longer ends the path. The literal text of a template, $request_uri, the resolving of . and .. segments, and the query string are not changed. The result of an njs template is used as data too.
  • Unit is packaged for Homebrew again. The official tap freeunitorg/homebrew-unit builds unitd with njs, ships the released unitctl binaries, and carries the language module formulas and the php-embed formulas.

Fixes

  • Proxy: when the read of an upstream response header ended without a complete header, for example after the timeout, the router did not free the header buffer and the memory of the request. A Content-Length of an upstream response that did not parse is no longer sent to the client.
  • With chunked_transform enabled, the router kept a buffer for each distinct number of bytes that followed a chunked request body on a connection, until the router restarted.
  • On a listener with a fixed address, the next request on a keep-alive connection after a configuration update read the address of the listener from freed memory of the old configuration. SERVER_ADDR, SERVER_PORT and the destination route option could get a wrong value, and during an update under load the router process could end.
  • A NUL byte after ? or # in the location of a return action was sent raw in the Location header field. It is now sent as %00.
  • The headers object of an njs template found a request header field only when the template wrote its name in the same letter case as the client. Now the name matches in any letter case.
  • The prototype process of an application with rootfs isolation could crash when the mount table had 256 or more entries, and the application did not start.
  • PHP: with a thread-safe (ZTS) PHP, the working directory of a script followed a replaced symlink only after realpath_cache_ttl seconds. A PHP worker now runs the per-child start of PHP after it forks from the prototype process, which PHP 8.5 and later need: before, every worker of an application shared one Zend memory-manager heap key, and a PHP built with debugging stopped each worker with an assertion.

Upgrade Notes

  • Check every rewrite and pass template that holds a variable. A rewrite that takes an encoded URI from a header, a cookie or an argument, such as $header_x_original_uri, now gets that text as it is, not decoded. A pass whose value held an encoded name now gets status 404, and a value can no longer select a name that holds a slash. In an njs template, call decodeURIComponent() on text that is encoded on purpose.
  • A rewrite result that is empty or does not start with / now gives status 500. Start each rewrite template with a literal /.
  • After a rewrite, a proxy upstream gets a ? or # of the new path as %3F or %23. A rewrite can no longer give the upstream a query of its own: the upstream gets the query of the request.
  • A raw # and the text after it are no longer sent to a proxy upstream or to an application, and $request_uri does not hold them.
  • Some requests that FreeUnit accepted before now get 400: a request target with an unencoded space, a control character or DEL, and a Host field with an empty host part. Check clients that send such requests.
  • Not changed: a request with no Host field still has an empty $host. If a share or a chroot template uses $host as a whole path segment, put a route step with "match": {"host": ""} and "return": 400 before it.
  • Java applications: getServletPath() and getPathInfo() now come from the resolved path, so repeated slashes are merged in them. getRequestURI() is not changed. A JSP file or a servlet below WEB-INF or META-INF no longer answers a direct request; a forward or an include works as before. Not changed: the module does not remove path parameters (the text after ;) before the servlet mapping, so do not rely on a filter with a prefix pattern as the only access control for a servlet that removes them.
  • With the default settings, each open WebSocket connection now keeps its request header buffers until it closes: at most 34816 bytes for each connection.
  • The php-8.6 and php-8.6-zts images have no pecl command and no mbstring extension, like the official PHP 8.6 images.

Full details in CHANGES. The following PR list is retained from GitHub's generated notes. Most of the security fixes of this release were committed to the 1.37 branch directly, so they are not in the list. The Full Changelog link below shows every commit.

Debian trixie packages

Binary .deb packages for FreeUnit on Debian trixie
(amd64 only): install the core daemon plus exactly one language
module. The PHP embed SAPI allows only one PHP version per
instance.

1. Enable deb.sury.org (PHP modules only)

PHP modules depend on libphpX.Y-embed from deb.sury.org. Skip
this step if you only install the Python module.

sudo apt-get update
sudo apt-get install -y --no-install-recommends \
  ca-certificates curl gnupg lsb-release
sudo curl -fsSL https://packages.sury.org/php/apt.gpg \
  -o /usr/share/keyrings/sury-php.gpg
sudo tee /etc/apt/sources.list.d/sury-php.sources >/dev/null <<SURY
Types: deb
URIs: https://packages.sury.org/php/
Suites: $(lsb_release -sc)
Components: main
Signed-By: /usr/share/keyrings/sury-php.gpg
SURY
sudo apt-get update

If packages.sury.org is unavailable, replace it in both the curl
and URIs: lines with a mirror that also serves the apt.gpg key (a
plain package mirror without the key will not work). When that mirror
is plain http, verify the downloaded key against a known-good sha256.

2. Download, verify checksums, install

DEB=1.37.3-1~trixie       # package version, as listed in SHA256SUMS
ASSET=1.37.3-1.trixie     # the same version in the asset URLs (GitHub renames ~ to .)
MOD=php8.4                # php8.3 | php8.4 | php8.5 | python3.13
BASE="https://github.com/freeunitorg/freeunit/releases/download/1.37.3"

curl -fLO "$BASE/SHA256SUMS"
curl -fL -o "freeunit_${DEB}_amd64.deb" "$BASE/freeunit_${ASSET}_amd64.deb"
curl -fL -o "freeunit-${MOD}_${DEB}_amd64.deb" \
  "$BASE/freeunit-${MOD}_${ASSET}_amd64.deb"

sha256sum -c --ignore-missing SHA256SUMS
sudo apt-get install -y \
  "./freeunit_${DEB}_amd64.deb" "./freeunit-${MOD}_${DEB}_amd64.deb"

sha256sum -c --ignore-missing checks only the files you
downloaded and fails if any digest does not match.

3. Run

sudo systemctl enable --now freeunit
systemctl status freeunit

Optional -dbg (debug symbols) and -dev packages are attached
to this release. SHA256SUMS provides integrity only, not
authenticity. The installed package version is X.Y.Z-1~trixie
(the . in the asset file name is GitHub's renaming of ~).

What's Changed

  • changelog: open the 1.38.0 section by @andypost in #961
  • test: widen the margins of the stream slow read test by @andypost in #962
  • ci: fix the deb install steps in the release body, keep the notes by @andypost in #965
  • docker: add PHP 8.6 images, NTS by default and ZTS explicitly by @andypost in #1007
  • php: run the per-child PHP start in the worker after the fork by @andypost in #1024
  • ci: drop the stale unchecked-realloc baseline entries on 1.37 by @andypost in #1017
  • docs(todo): add the Go module path section for the docs.freeunit.org/go decision by @freeunitx in #1026
  • fix(deps): update url to 2.5.9 for RUSTSEC-2026-0592, add 1.37.3 security entries and Fedora 45 by @freeunitx in #1025
  • macos: make macOS CI optional; move packaging to the freeunitorg tap by @freeunitx in #1027
  • release: set the 1.37.3 date and correct four changelog entries by @andypost in #1029

Contributors

Thank you to the people credited as authors, committers or reviewers in 1.37.2...1.37.3:

  • @andypost (Andy Postnikov) for development, integration and release work throughout the cycle.
  • @freeunitx (Alexandr Smirnov) for the url update with the security changelog entries, and for the move of the macOS packaging to the Homebrew tap (#1025, #1027).
  • sword, the author of the commit that refuses unencoded spaces in request targets (ffa54caaf).

Thank you to the people whose reports led to fixes in this release:

AI-Assisted Contributions and Review

The tagged commit history also records these model credits in Co-Authored-By / Reviewed-by trailers (names and versions as recorded, with repeated harness and version spellings grouped):

  • Claude Opus 5.5; Claude Fable 5.1 and 5.2.
  • DeepSeek V4.1 Flash, including a dsh credit.

Recorded harnesses include Claude Code and DeepSeek Harness (dsh). Exact attribution and harness versions remain in the commit history.

Full Changelog: 1.37.2...1.37.3