Repository navigation
FreeUnit 1.37.2, 09 Nov 2026
This release fixes three security issues: a router crash on a variable pass, local privilege escalation through unitc, setup-unit and unitctl, and header injection through a proxy rewrite. It also updates Wasmtime to 48.0.8 and njs to 1.0.2. It fixes requests that could stay unanswered in the shared application queue, several router and controller crashes, WebSocket close handling, and stricter HTTP/1.1 parsing. Response compression now covers responses of unknown length and uses the zlib default window. The PHP module builds with PHP 8.7.
Security
- A request to a
passwith variables that named a missing application target could crash the router. Such a request now gets a 404 response. Each request to a variablepassthat named an application also took memory from the configuration pool, which other router threads use at the same time, and kept it until the next reconfiguration. Advisory: GHSA-2j86-h6qw-489m unitcandsetup-unitfound a running unitd by its process title alone and trusted the command line and files of whatever matched. A local user could make an operator who runs the tool as root run that user's program, or source a cache file planted in/tmp. The tools now trust only aunit: mainprocess owned by the superuser or by the user who runs them. unitc reads and creates its/tmpcache only as a regular file it owns, and refuses a symlink. unitctl applies the same owner rule when it discovers a running unitd. Advisory: GHSA-mcrf-v94r-p6fc- When a
rewriteaction changed the URI of a proxied request, the router sent the rewritten target to the upstream without re-encoding it. A rewrite that used the decoded request path (for example$uri) could put a raw CR, LF or space into the target, and so inject a header into the upstream request or smuggle a request to the upstream. The router now percent-encodes the rewritten target by its actual content before it builds the upstream request line. Advisory: GHSA-6p47-x23p-r5wm - Wasmtime, wasmtime-wasi and wasmtime-wasi-http move to 48.0.8 for RUSTSEC-2026-0420 through RUSTSEC-2026-0424. Cranelift moves to 0.135.8. The contrib C API pin is 48.0.8 too.
New
- The PHP module builds with PHP 8.7, which removed five members of
sapi_module_struct. The module now names the members that it sets, so a member that PHP removes no longer shifts the others. - Docker images for Python 3.15.
Changes
- The
response_headersoption refusesContent-Lengthin any letter case andTransfer-Encoding, because FreeUnit sets the body length of a response itself. Before,content-lengthwas accepted and a response could get two body lengths. - The gzip and deflate compressors use the 32 KiB window and memLevel 8, the zlib defaults, instead of a 512-byte window. For a response of known length the window shrinks to fit it. A compressed stream of unknown length uses a 4 KiB window and memLevel 6, about 54 KiB of zlib state.
- A response of unknown length, such as a streamed application response or PHP output without
Content-Length, is now compressed.min_lengthapplies only to a response of known length. A client that refuses identity and accepts no configured coding gets 406. Each such open stream holds its compressor state: about 55 KB for gzip, 1.7 MB for zstd and 6 MB for Brotli. - The Brotli compressor uses a window of at most 512 KiB (19 bits) and gets a known length as a size hint. Before, a response at quality 11 could hold about 43 MB of state. The zstd compressor shrinks its window to a known length. Brotli now reports an error when its output buffer is too small for a flush, instead of returning a cut stream; no case was found where the buffers that FreeUnit allocates are too small. A coded body can be up to 2 bytes shorter.
- The WebAssembly component module builds Wasmtime with
parallel-compilation, so Cranelift compiles the functions of a component on several threads when it loads. The first start of a large component was measured about 4 times faster on an 8-vCPU VM. It uses more CPU at startup, and the module is about 150 KB larger. - The prototype and discovery processes accept
NEW_PORTandREMOVE_PIDonly from the main process. An application worker could otherwise forge either message on the prototype port and corrupt the process records of the prototype. For the discovery port this is defense in depth. - Contrib njs moves to 1.0.2, which fixes memory-safety bugs in the njs engine.
Fixes
- Shared application queue: a request taken from the queue could be dropped with nobody left to answer it (fixed in libunit). Requests could wait for ever when the router did not answer a
GET_PORTfor a router thread that no longer existed. Requests that the last process of an application had taken but not started are now given to the new process; a request it had already started is answered 503 at once and never runs twice. With"limits": {"timeout"}of 0, a request that a process took from the queue and never acknowledged is now answered 503 after about 10 seconds. The router no longer sends a shared memory notice to the closed port of an exited process. - Router and controller crashes: a TLS client that stopped before the 408 response for an expired
idle_timeout; an njs build whose configuration update failed early; a proxy route whose upstream answered a WebSocket handshake with 101 (now 502 with a warning); a configured"return": 101followed by a WebSocket frame; and a control-APIPUTpast a scalar configuration member (now 404). - With
body_temp_pathset, a request body larger thanbody_buffer_sizecould get a 500 response because the router read a released path. - WebSocket: when a client frame gets no shared memory, the router sends a CLOSE frame with code 1011 before it closes the connection. An ASGI application that sent a close frame and then raised an exception now delivers that close frame, and a message above the 10 MiB limit gets code 1009. A client frame sent in the same write as an application handshake reaches the application as its first frame, instead of running the route action a second time.
- HTTP/1.1 parsing:
Connectionoptions count only as whole tokens in any letter case, andclosewins overkeep-alive(RFC 9110, Section 7.6.1; RFC 9112, Section 9.6).Transfer-Encodingtakeschunkedin any letter case; before,Chunkedgot 501. A malformed chunk extension gets 400, and an upstream chunked response with one is refused. The proxy now checks the upstream status line strictly;HTTP/1.1 2049 OKis no longer read as 204, and a malformed status line gets 502. - Compression: a 206 response is no longer compressed. A
compressionobject withoutcompressorsis refused instead of turning compression off without a log line.Accept-Rangesis removed from a response that FreeUnit compresses. - A route regular expression no longer takes PCRE2 backtracking frames from the request memory pool. One bounded match object serves each router thread, and a pattern that reaches a match limit is logged once.
- A Unicode
hostpattern such asmünchen.exampleis converted to punycode when the configuration loads, so it matches the form that browsers send. - After a fatal TLS error the router no longer calls
SSL_shutdown()and no longer logsSSL_shutdown() failedat alert level for each such connection. - Language modules: a response header name longer than 255 bytes from Python, PHP, Perl or Node.js was cut to its length modulo 256; such a response now fails with an error in the log. Python WSGI and ASGI compare header names, not only their hashes. An ASGI
scope["subprotocols"]no longer has an empty slot that could crash the worker. A PHP worker exits afterphp_request_startup()fails instead of serving later requests on broken state. Java decodes request strings as UTF-8 when they are valid UTF-8 and as ISO-8859-1 otherwise.
Upgrade Notes
- Rebuild Go and Node.js applications against the new libunit. Two queue fixes are in libunit, and an application built against an older libunit keeps the old behaviour.
- Run
unitcandsetup-unitas root or as the user who owns unitd. The tools, and unitctl discovery, no longer trust aunit: mainprocess owned by another non-root user. - A stored configuration with
Content-LengthorTransfer-Encodinginresponse_headersstill loads with a warning, and FreeUnit does not send these fields. The control API refuses updates until you remove them. - A stored configuration with a
compressionobject withoutcompressorsstill loads with a warning, and compression stays off. The control API refuses other updates until you addcompressors. - A non-ASCII
hostpattern must be in lowercase Unicode in NFC. The control API refuses a wildcard inside a non-ASCII label, invalid UTF-8 and a label over 63 bytes in punycode. If a stored configuration from an earlier version has such a pattern, it is kept with a warning and compared as written, as before, so unitd still starts. Other stored patterns are converted when the configuration loads. Only ASCII case is folded: FreeUnit does not lowercase non-ASCII letters or normalize to NFC, so such a pattern never matches what a browser sends. It only logs a warning; fix the pattern by hand. - Streamed responses are now compressed when compression is configured. Check memory use for many open streams, in particular with zstd or Brotli.
- A PHP request body that PHP cannot parse within
memory_limitnow costs one worker restart for each such request. - A response header name longer than 255 bytes from a Python, PHP, Perl or Node.js application now fails the response instead of going out cut: 500 from PHP, 503 from Python and Perl. In Node.js,
setHeader()throws a TypeError; if the application does not catch it, the worker exits and the client gets 503. - Some requests that FreeUnit accepted before now get 400 or 502: a malformed chunk extension gets 400, and a malformed upstream status line gets 502. Check clients and upstreams that send such messages.
Full details in CHANGES. The following PR list is retained from GitHub's generated notes. Every commit between the release tags belongs to one of these pull requests.
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 updateIf 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.2-1~trixie # package version, as listed in SHA256SUMS
ASSET=1.37.2-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.2"
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 freeunitOptional -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
- njs: do not destroy a VM that was never compiled by @andypost in #840
- build(deps): Bump anthropics/claude-code-action from 1.0.255 to 1.0.264 by @dependabot[bot] in #846
- Tests: allow 30 seconds for the application queue watchdog by @andypost in #852
- ASGI: preserve queued WebSocket closes; fix Alpine test portability by @andypost in #844
- ci: run the timing and word-size tests on Alpine, also on one CPU by @andypost in #849
- ci: build the PHP module against a PHP pre-release and php-src next by @andypost in #853
- tests: make test_tls_conf_command run on Python 3.10+ by @andypost in #841
- tests: read a response into a bytearray in recvall() by @andypost in #866
- tests: read the clock after the application starts in the Date checks by @andypost in #867
- php: build against PHP 8.7, which removed five SAPI members by @andypost in #854
- ci: publish nightly FreeUnit images for PHP 8.6 and php-src master by @andypost in #855
- zlib: use the 32 KiB window, size it to a known length by @andypost in #858
- test: shard test_settings.py by its current time, upload JUnit reports by @andypost in #850
- core: remove 26 functions that have no callers by @andypost in #790
- ci: run the nightly publish job only from master by @andypost in #868
- changelog: add the 1.37.2 section by @andypost in #851
- brotli: report an incomplete flush or finish as an error by @andypost in #826
- http: compress application responses of unknown length by @andypost in #857
- http: bound the compressor state of a streamed response by @andypost in #870
- conf: require "compressors" in the "compression" object by @andypost in #872
- fix(deps): update wasmtime to 48.0.8 by @andypost in #874
- build(deps): Bump taiki-e/install-action from 2.87.30 to 2.88.1 by @dependabot[bot] in #845
- build(deps): Bump the minor-and-patch group across 4 directories with 2 updates by @dependabot[bot] in #848
- build(deps): Bump the otel group across 2 directories with 1 update by @dependabot[bot] in #875
- http: drop Accept-Ranges from a response that Unit compresses by @andypost in #873
- tests: fix three failures on slow builders by @andypost in #880
- pkg: add Python 3.15 to the supported runtimes by @andypost in #882
- ci: test the oldest and newest Python on each run, all versions weekly by @andypost in #884
- tests: recover from a teardown that finds leftover processes by @andypost in #881
- tests: fix three races on slow builders by @andypost in #883
- port: send no SHM_ACK to a closed port by @andypost in #886
- tests: fail the app queue race only when it stops making progress by @andypost in #885
- libunit: claim a queued request before its slot is freed by @andypost in #889
- ci: cache and retry the package install of build-m32 by @andypost in #894
- router: bound a claimed, unacknowledged request when "timeout" is 0 by @andypost in #890
- h1proto: use the write timer in the idle response timeout handler by @andypost in #898
- router: answer a refused GET_PORT (step 4 of #665) by @andypost in #893
- router: requeue unclaimed requests when the last app process dies by @andypost in #895
- build(deps): bump contrib njs to 1.0.2 by @andypost in #899
- fix(pins): allow RUSTSEC-2026-0441 for pin-utils 0.1.0 by @andypost in #900
- php: exit the worker after a failed request startup by @andypost in #910
- test: remove the race in the main store test by @andypost in #935
- build(deps): Bump anthropics/claude-code-action from 1.0.264 to 1.0.267 by @dependabot[bot] in #930
- build(deps): Bump taiki-e/install-action from 2.88.1 to 2.90.0 by @dependabot[bot] in #931
- build(deps): Bump docker/setup-qemu-action from 3 to 4 by @dependabot[bot] in #932
- build(deps): Bump cc from 1.10.0 to 1.11.0 in /src/wasm-wasi-component in the minor-and-patch group across 1 directory by @dependabot[bot] in #933
- modules: refuse a response header name over 255 bytes by @andypost in #926
- wasm-wc: build Wasmtime with parallel-compilation by @andypost in #912
- h1proto: match Connection options as tokens and fold Transfer-Encoding by @andypost in #920
- router: bound the application target lookup by @andypost in #925
- router: copy "body_temp_path" into the configuration pool by @andypost in #938
- test: send no request before the late start in requeue_unaccounted by @andypost in #942
- test: correct the cause in the requeue_unaccounted comment by @andypost in #943
- Tighten header and status line checks by @andypost in #927
- http: cut the Accept-Encoding cost of responses without Content-Length by @andypost in #888
- http: refuse a malformed chunk extension by @andypost in #944
- websocket: send a CLOSE frame when a frame gets no shared memory by @andypost in #945
- regex: bound the cost of a route pattern match by @andypost in #946
- router, java: fix UTF-8 handling in Java strings and host patterns by @andypost in #928
- perf: faster string compares in libunit, Java, Node and config lookup by @andypost in #929
- build(deps): Bump sysinfo from 0.39.6 to 0.40.1 in /tools/unitctl in the major group across 1 directory by @dependabot[bot] in #934
- tools: trust only a root- or self-owned unitd when discovering it by @andypost in #947
- h1proto: answer 502 when a proxy upstream replies 101 to a WebSocket handshake by @andypost in #950
- conf: refuse a PUT that descends past a scalar config member by @andypost in #948
- python: drop empty subprotocols so no NULL tuple slot reaches the app by @andypost in #951
- openssl: do not call SSL_shutdown() after a fatal TLS error by @andypost in #953
- router, h1proto: start the WebSocket reader only for a real upgrade by @andypost in #955
- http: encode a rewritten proxy target by its content, not quoted_target by @andypost in #956
- tools, ci: owner-filter unitctl discovery and scope the unitctl workflow write permission by @andypost in #957
- docs: name unitctl in the 1.37.2 owner-check entry by @andypost in #960
- app: gate the prototype and discovery NEW_PORT/REMOVE_PID on the sender by @andypost in #958
- release: prepare 1.37.2 by @andypost in #878
Contributors
Thank you to the people credited as authors, committers or reviewers in 1.37.1...1.37.2:
- @andypost (Andy Postnikov) for development, integration and release work throughout the cycle.
- @tuzelko-familiar for the review of the application target lookup fix (#925).
Thank you to the people whose reports led to fixes in this release:
- @lolgab for reporting invalid chunk extensions and a bare LF that could hang a request (#916, fixed by #944).
- @tuzelko-familiar for reporting that route regexes ran with no PCRE2 limits (#538, fixed by #946).
- @ndj888 for asking for the njs 1.0.2 update (#828, done in #899).
Automation contributions are credited to @dependabot[bot]. Six commits use Claude as their author identity; this is an agent identity rather than an additional human GitHub account.
AI-Assisted Contributions and Review
The tagged commit history also records these model credits in authorship and Co-Authored-By / Reviewed-by trailers (names and versions as recorded, with repeated harness and version spellings grouped):
- Claude Opus 4.8 and 5.5; Claude Sonnet 5.5; Claude Fable 5.1.
- Codex, including credits naming GPT-6 and GPT-6-Astra medium.
- DeepSeek V4.1 Flash, including DSH and Free credits; Grok Bot; Gemini 3.1 Pro and 3.8 Flash.
Recorded harnesses include Claude Code, Codex CLI, DeepSeek Harness/DSH, OpenCode, pi, Grok Bot/Temporal and Antigravity. Exact attribution and harness versions remain in the commit history.
Full Changelog: 1.37.1...1.37.2