Repository navigation
Releases
2.3.7
Sōzu 2.3.7 fixes worker upgrades and shutdown, HTTP/1 and HTTP/2 connection handling, WebSocket teardown, and TCP and UDP listener accounting. Building from source now requires Rust 1.95.0.
2.3.6
Security
libz-sysmoves from 1.1.31 to 1.1.33 for RUSTSEC-2026-0544, a heap buffer overflow in zlib'sgz_vacate(); it reachessozu-libthroughflate2. Thesozu-e2eKafka test now speaks the Kafka protocol throughkafka-protocolinstead ofrskafka, which depends on the unmaintainedchrono(RUSTSEC-2026-0543);chronoleaves the lockfile andcargo audit --deny warningspasses again (#1928).
Fixed
- The PROXY protocol v2 header Sōzu prepends to UDP datagrams (
send_proxy_protocol, first datagram or every datagram withproxy_protocol_every_datagram) now names the address the client contacted as its destination, the UDP listener's address and port, as the specification defines it and as the TCP header always did. It named the backend the datagram was forwarded to: a capture against a production load balancer on 2026-11-17 showed destination10.101.0.6(the backend node) over UDP and the load balancer's public IP over TCP. The source, the real client address, was and stays correct. A listener bound to a wildcard address (0.0.0.0or::) advertises that wildcard IP with the listener port, because Sōzu does not read a datagram's real destination from the packet (IP_PKTINFO); bind the listener to the address clients reach when a backend needs the destination IP. Library API:ManagerInput::ClientDatagramgains adstfield, which breaks code that builds it (#1927).
2.3.5
Security
-
A frontend HTTP/2 stream that Sōzu resets now gives its stream slot back at once. A stream error the client provokes (a malformed request such as a
:pathcarrying a fragment, a body that does not match itscontent-length, a zero-increment or overflowingWINDOW_UPDATE, a stream made to depend on itself,DATAorHEADERSon a half-closed stream) is answered withRST_STREAM. The stream left the connection's stream table but kept its slot and its two pool buffers until the connection closed. With the defaultmax_buffers = 1000, about 499 such resets on one connection emptied the worker's buffer pool. From then on the worker refused new streams withREFUSED_STREAMfor want of buffers, on that connection and on a new connection alike, until the connection closed. The reset now logs the request and recycles its slot, whatever state the stream was in. Access-log timing changes with it: each provoked reset of a request not yet logged now writes its access-log line when the reset happens, so a request rejected at itsHEADERS(a malformed:path), or reset after a default answer, is loggedH2::Resetat once, where it used to be loggedsession closewhen its connection closed. A request reset while waiting for or linked to a backend was already loggedH2::Reset, and still is, once. Debug builds now assert after every frame and every read and write pass that no frontend slot is left out of the stream table without being recycled (#1922). -
A request answered
504by a timeout no longer leaves its backend connection able to answer another request. On an HTTP/2 frontend the connection outlives the504, and the client's next request could receive the late response of the request that timed out. Two paths led there, both with an HTTP/1.1 backend that had received the whole request and not answered yet. Whenback_timeoutfired first (the default order, 30 s against afront_timeoutof 60 s), the backend connection was returned to the session's keep-alive pool with that request still unanswered on it, so the next request of the session for that backend was written behind it and read its response. Whenfront_timeoutfired first (aback_timeoutlonger thanfront_timeout), the backend connection, HTTP/1.1 or HTTP/2, stayed attached to the stream slot: the next request reused the slot and received whatever the backend sent later, and a late read or close on a slot the session had since dropped indexed past the stream table and panicked. The mix-up stays inside one client connection, so it crosses users only where an intermediary multiplexes several of them onto it. Both timeout branches ofMux::timeout_innernow end the request on its backend before they install the answer: the HTTP/1.1 connection is closed instead of pooled or left attached, and an HTTP/2 backend stream is reset. A backend that had answered whole is still pooled. An HTTP/1.1 frontend closes after the default504(Connection: close) and was not affected with the default answers (#1924).
2.3.4
Added
-
BREAKING (library API).
path_type = "REGEX_PATH"(CLI--path-regex-path,PathRuleKind::REGEX_PATH = 3) matches a regex, anchored at both ends, against the request path up to its first?only, the Gateway API HTTPRouteRegularExpressionpath match.REGEXkeeps matching the path together with its query string, so/api/.+matches/api/?x=1underREGEXbut notREGEX_PATH, and^/api/v2$matches/api/v2?x=1only underREGEX_PATH. It ranks asREGEXdoes. Withrewrite_path, its$PATH[n]captures come from the path alone and the original?queryis appended to a rewritten path that has no?of its own; a redirectLocationfollows it.REGEX,PREFIXandEQUALSare unchanged. Library API:PathRule::from_cli_options(sozu-command-lib) takes a fourthpath_regex_pathargument, andPathRule(sozu-lib) andPathRuleType(sozu-command-lib) gain aRegexPathvariant, which breaks exhaustive matches on them. A worker that predates the kind refuses such a frontend as an invalid path rule, so upgrade every worker before declaring one (#1909). -
An HTTP listener can serve cleartext HTTP/2 by prior knowledge with the new opt-in
h2c_prior_knowledgeoption (HttpListenerConfigfield 38,UpdateHttpListenerConfigfield 44; TOMLh2c_prior_knowledge = true; CLIsozu listener http add --h2c-prior-knowledge,sozu listener http update --h2c-prior-knowledge/--no-h2c-prior-knowledge). A connection whose first 24 bytes are the HTTP/2 connection preface is served as an HTTP/2 frontend, as an HTTPS connection that negotiatedh2through ALPN is, with the listener's H2 flood thresholds and tuning; every other connection stays HTTP/1.x. The first bytes are peeked, never consumed: a strict prefix of the preface waits for more bytes withinrequest_timeout, and a diverging byte decides HTTP/1.x. A client that sends nothing, or only part of the preface, beforerequest_timeoutis closed without the408an HTTP/1-only listener answers. The scheme stayshttp(:scheme,X-Forwarded-Proto,Forwarded: proto), the option composes withexpect_proxy, andUpgrade: h2cremains unsupported. Such a listener is held to the H2 minimumbuffer_size(16393) at configuration load, like an HTTPS listener advertisingh2. Off by default: without it a preface is answered400 Bad Requestas before. The use case is cleartext gRPC, e.g. the Kubernetes Gateway APIGRPCRoute. New metricshttp.h2c.prior_knowledge(connections served as h2c) andhttp.upgrade.h2c.failed. A listener update applies to new connections only (#1911).
Fixed
-
A worker now leaves its event loop when its command channel reports an error, as it already did on a hang-up. The main process closing the channel with a worker answer still unread resets the connection, which the worker used to log and ignore, so it kept running with nothing left to drive it and a caller joining its thread waited forever (#1912).
-
An HTTP/1.1 backend now receives a single
Hostheader when a frontend setsrewrite_host. The router added aHostheader block on top of the rewritten authority, which the HTTP/1.1 converter already writes asHost, so the backend saw two, and servers that refuse a duplicateHost(Go'snet/http) answered400. A frontend request header namedHostnow replaces the request authority instead of adding a second, differentHostline;rewrite_hoststill takes precedence over it, and an HTTP/2 backend now receives that value as:authoritywhere the header was previously dropped (#1908). -
A fast HTTP transfer is no longer cut at a random offset. When the inner loop of
Mux::ready_innerreachedMAX_LOOP_ITERATIONS(10,000) in oneready()call, it closed the session unless output was still queued, even if every iteration had forwarded bytes. When the client and the backend both kept up for that many iterations (about 160 MiB with 16 KiB buffers), the client saw a clean close in the middle of aContent-Lengthbody ("Premature end of Content-Length delimited message body"), withhttp.infinite_loop.errorincremented and, before 2.3.0, no log at the default level. Downloads and uploads over plaintext and TLS HTTP/1.1 were measured exposed, and the listener's ALPN list played no part; HTTP/2 frontends run the same loop. A call that reaches the budget after forwarding at least one stream byte per budgeted iteration to either peer (Context::stream_bytes_out) now yields: it keeps its readiness, counts the newhttp.mux.loop_budget_yieldcounter, and the worker resumes it after its next poll, which does not block while a session is queued (ProxySession::yielded,Server::resume_yielded_sessions). A fast transfer neither is cut nor holds the single-threaded worker past one budget per turn. A call that forwarded nothing keeps the existinghttp.infinite_loop.errorpath. Reproduced deterministically bya_transfer_progressing_at_the_loop_limit_yields_and_resumes_without_a_new_event, and end to end inlarge_response_tests.rs(256 MiB over loopback: 4/40 plaintext and 5/60 TLS downloads, 10/20 TLS uploads cut onmain).ProxySessiongains ayieldedmethod with a defaultfalse, so other implementors are unaffected (#1906). -
A response in progress is no longer cut by the timeout of the peer that is not holding it up.
back_timeoutfired while Sōzu itself had stopped reading the backend because a slow client left response bytes queued, and cut the response (backend_response_timeout);front_timeoutfired while a client that had taken every byte waited on a slow backend, and closed the session silently, because kawa'sis_completed(nothing queued) was read as "response fully proxied". Each timeout now defers to the other while the response waits on the other peer (response_waits_on_client); the two conditions are complementary, so a client that stops reading still meetsfront_timeoutand a silent backend still meetsback_timeout. Reproduced end to end with 4 s pauses against 2 s timeouts, cut at 4.0 and 6.0 of 8 MiB before the fix (#1906).
Upgrade notes
- The command schema gains
PathRuleKind::REGEX_PATH = 3and the optionalh2c_prior_knowledgefields (HttpListenerConfigfield 38,UpdateHttpListenerConfigfield 44). Configuration and saved state written by 2.3.3 load unchanged. Upgrade the main process and every worker before declaring aREGEX_PATHfrontend or enablingh2c_prior_knowledge: a worker that predates them refuses aREGEX_PATHfrontend as an invalid path rule, and ignores the unknownh2c_prior_knowledgefield, so it keeps answering a preface400 Bad Request. A main-only replacement does not qualify the transition. The release gate exercises the published 2.3.3 binary with two workers, saved state and HTTP/HTTPS/TCP/UDP traffic before, during and after replacement. Existing 2.2.1 and 2.3.1 compatibility cases remain separate. - Library API:
PathRule::from_cli_options(sozu-command-lib) takes a fourth argument, andPathRule(sozu-lib) andPathRuleType(sozu-command-lib) gain aRegexPathvariant.ProxySession(sozu-lib) gains ayieldedmethod whose default returnsfalse, so other implementors are unaffected.
2.3.3
Changed
- Ordinary worker requests and
SetMetricDetailno longer compute full-config invariant hash snapshots in non-debug release builds. Debug assertions still retain this coverage, and legitimate query hashes are unchanged.
Fixed
- Partial cluster and certificate-worker queries now answer
Failureon timeout, refusal, incomplete or invalid worker responses, rather than a partialSuccess. This includes a certificate fingerprint query refused by a worker that does not hold the certificate. - The debug
ConfigStatediff postcondition now compares TCP frontend membership rather thanVecorder. Storage and emission are unchanged.
Upgrade notes
- The command schema, configuration and saved-state formats are unchanged from 2.3.2. Upgrade the main process and every worker; a main-only replacement does not qualify the transition. The release gate exercises the published 2.3.2 binary with two workers, saved state and HTTP/HTTPS/TCP/UDP traffic before, during and after replacement. Existing 2.2.1 and 2.3.1 compatibility cases remain separate.
2.3.2
Added
-
BREAKING (library API) —
feat(health-check): probe port.HealthCheckConfiggains an
optionalport(proto field 9): when set, bothHTTPandTCPprobes connect to the
backend's IP address on that port instead of its data port, and the HTTP probe'sHost
(h2c:authority) names thatip:port. Unset, the probe dials the data port as before. It
serves backends whose health endpoint or companion listener lives on another port, as
UdpHealthConfig.tcp_portalready does for UDP clusters.validate_health_check_config
refuses a port outside1..=65535at the CLI, the TOML loader, the master state and the
worker. New TOML keyportin[clusters.<id>.health_check]andsozu cluster health-check setflag--port;sozu cluster health-check listgains aportcolumn (datawhen
unset).porttargets a backend IP address: it is refused, with a stable error, when a
backend of the cluster has aunix_path, in either order and in the TOML loader (DNS-expanded
entries included), the master state and the worker; aunix_pathbackend withoutportis
probed through its UNIX socket. Library API:HealthCheckConfigandFileHealthCheckConfiggain the public field
port, so a struct literal must name it (only the protobufHealthCheckConfigalso accepts..Default::default()). A message or saved
state without the field decodes as before.portis an additive field 9 on the existing
AddClusterandSetHealthCheckmessages, so it is not fail-closed: a worker older
than 2.3.2 decodes the message, ignores the unknown field and probes the data port. Upgrade
the main process and every worker to 2.3.2 before enablingport. Rust source: an
exhaustiveHealthCheckConfigorFileHealthCheckConfigliteral must nameport
(Option<u32>in both).Before enabling it. Upgrade the main process and every worker, and use the new CLI,
before settingport: an older worker ignores field 9 and probes the data port, which in
TCPmode passes every backend accepting connections there; an oldersozuCLI that
patches a cluster by read-modify-write (sozu cluster h2 enable|disable) drops it, and so
does an older binary loading the saved state. Documented indoc/health_checks.md,
doc/configure.mdanddoc/configure_cli.md; covered by
test_health_check_tcp_mode_probe_port_closed_marks_serving_backend_down,
test_health_check_http_mode_probe_port_closed_marks_serving_backend_down,
test_health_check_tcp_mode_probe_port_answering_keeps_backend_upand
test_health_check_http_mode_probe_port_answering_keeps_backend_up
(e2e/src/tests/health_check_mode_tests.rs),
probe_address_replaces_only_the_port_when_one_is_set(lib/src/health_check.rs),
set_health_check_out_of_range_port_rejectedand
a_health_check_port_and_a_unix_backend_never_share_a_cluster(command/src/state.rs),
a_health_check_port_and_a_unix_path_backend_never_share_a_file_cluster
(command/src/config.rs),probe_dials_the_probe_port_not_the_data_port,
unix_backend_without_probe_port_is_probed_through_its_socket(lib/src/health_check.rs) and
a_probe_port_already_set_refuses_a_unix_backendand
a_unix_backend_already_there_refuses_a_probe_port(lib/src/server.rs),
diff_converges_when_a_probe_port_and_a_unix_backend_swap(command/src/state.rs),
a_static_reload_converges_when_a_probe_port_and_a_unix_backend_swapand
a_load_state_converges_when_a_probe_port_and_a_unix_backend_swap
(bin/src/command/requests.rs), plus unit tests in
command/src/config.rsandbin/src/cli.rs. -
HTTP and HTTPS frontends can route on request headers
(#1253). The new
header_predicateslist of a frontend (RequestHttpFrontendfield 17, TOML
header_predicates = [{ name, match, value }], CLI--match-header <match>=<name>[=<value>]) holds conditions that must all be true:exact
(byte-equal value),regex(anchored at both ends) orpresent. Names are
case-insensitive;HostandCookieare refused. For one hostname, a
frontend whose predicates hold outranks every frontend without predicates,
so a canary and its base can share a hostname and path in any declaration
order. Predicates are part of the frontend's identity, so a removal names
them too. Frontends without predicates route as before, and the command
schema change is additive: saved states without the field load unchanged.
A frontend with predicates travels on dedicated request verbs
(AddHttpFrontendWithHeaderPredicates& co) that a worker predating the
feature cannot decode, so it fails the request instead of installing the
route without its guard; frontends without predicates keep the historical
verbs. Repeated identical predicates canonicalize to one identity, a TCP
frontend rejectsheader_predicatesinstead of ignoring them, and frontend
listings show a redacted predicate count rather than names or values.
Protobuf:RequestHttpFrontendfield 17 andRequestfields 66-69
(AddHttpFrontendWithHeaderPredicates,RemoveHttpFrontendWithHeaderPredicates,
AddHttpsFrontendWithHeaderPredicates,RemoveHttpsFrontendWithHeaderPredicates).
Rust source:RequestHttpFrontend,HttpFrontendConfigand
FileClusterFrontendConfiggain the public fieldheader_predicates, so an
exhaustive struct literal must name it (the protobufRequestHttpFrontendalso accepts..Default::default());
request::RequestTypegains the four verbs above, so an exhaustivematch
must handle them;ConfigError::InvalidHeaderPredicate { index, reason }is
new, so an exhaustivematchonConfigErrormust handle it.
command::response::HttpFrontendalso gains the public field
header_predicates: Vec<HeaderPredicate>;
FileClusterFrontendConfig::header_predicatesis an
Option<Vec<HeaderPredicateConfig>>, andHeaderPredicateConfigis a new
public type (sozu_command_lib::config).
sozu_lib::router::Router::treenow holds
(PathRule, MethodRule, HeaderRules, Route)tuples instead of
(PathRule, MethodRule, Route), andsozu_lib::router::RouterErrorgains
InvalidHeaderPredicate { index, reason }, so an exhaustivematchon it
must handle it. -
feat(mux):redirect = "silent_close"refuses a request without any
response (#767), the
equivalent of nginx'sreturn 444. A newRedirectPolicy::SILENT_CLOSE = 5
(appended to the protobuf enum; TOMLredirect = "silent_close", CLI
--redirect silent_close) makes an HTTP/1.x frontend close the connection
without writing a byte and an HTTP/2 frontend reset only the refused stream
withRST_STREAM(CANCEL), leaving the connection's other streams running. The
backend is never contacted, whether or not the frontend names a cluster, and
the policy wins over the frontend's other redirect, rewrite and authentication
settings. The access log records status444with messagesilent_close; the
line is not an error (http.errorsis not incremented) and counts in
http.status.4xx. The main sends asilent_closeadd as
AddHttpFrontendWithSilentClose(field 70) or
AddHttpsFrontendWithSilentClose(field 71); other frontends keep the legacy
verbs. A worker older than 2.3.2 cannot decode these requests and fails them,
so it never installs an unguarded forwarding route. Rust source:
RedirectPolicygainsSilentClose,request::RequestTypegains
AddHttpFrontendWithSilentCloseandAddHttpsFrontendWithSilentClose, and
sozu_lib::RetrieveClusterErrorgainsSilentClose, so an exhaustivematch
on any of them must handle the new variants. -
Backends reachable over UNIX domain sockets
(#152). A backend's new
unix_path(configuration file,AddBackend.unix_pathin the protocol,
sozu backend add --unix-path) takes an absolute path or a Linux
abstract-namespace@name; HTTP, HTTPS and TCP clusters dial it instead of
address, which stays the backend's identity and must be unique in its
cluster. Health checks probe the same socket. UDP is not supported: the
configuration file and the main process's state both refuse it there.
A UNIX backend travels on a newAddUnixBackendrequest
(RequestType::add_backendpicks the verb, and the main process rewrites
every fan-out to it): a main process or worker that predates it cannot decode
that request, so it never registers the backend or dialsaddressover TCP.
A client that sendsunix_pathon the historicalAddBackendinstead is
outside this guarantee: an older decoder drops the field. Protobuf:AddBackendfield 7
(unix_path) andRequestfield 72 (AddUnixBackend). Covered by
command/tests/unix_backend_verb.rsand thetest_*unix*e2e tests
(e2e/src/tests/unix_backend_tests.rs). Rust source:AddBackendand
BackendConfiggain the public fieldunix_path(as does the newFileBackendConfig), so
an exhaustive struct literal must name it (the protobufAddBackendalso accepts..Default::default());
request::RequestTypegainsAddUnixBackend, so an exhaustivematchmust
handle it;ConfigError::InvalidBackendUnixPath { cluster_id, address, reason }
is new, so an exhaustivematchonConfigErrormust handle it.
command::response::Backendandsozu_lib::backends::Backendalso gain the
public fieldunix_path: Option<String>, which an exhaustive struct literal
must name. -
A backend
...addressin the configuration file may be ahost:portas well
as a socket address (#347). The name is resolved once, with the system
resolver, when the file is loaded (at startup or bysozu reload --file);
it is never re-resolved while running. Each distinct resolved address
becomes a backend with a deterministic id, `<backend_id>-
2.3.1
Fixed
- A worker whose HTTP, HTTPS, TCP or UDP proxy refused a frontend addition or
removal could keep aConfigStatethat disagreed with the runtime. When
every worker refused the order, the main process could then disagree with
the workers too. Workers now apply the same compensating path as the main
process before returning the failure. Adds use their request-only inverse;
removals snapshot the matching stored frontend so tags, method, path,
position and routing policy are restored exactly. Listener additions use
the request-only path. Upserts, listener updates, cluster removals and
certificate mutations remain outside this compensating path because they
need a distinct snapshot of the displaced value or runtime state. HTTP and
HTTPS frontend changes that target several same-address listeners can also
leave a pre-existing heterogeneous runtime only partially changed when one
listener refuses the order; this fix restoresConfigState, but it does not
reconstruct that runtime-only state.
Upgrade notes
- This patch does not change the command schema, configuration format or saved
state format. A 2.3.0 main and its workers can hot-upgrade to 2.3.1. - The first migration from 2.2.1 under the shipped
Type=notifysystemd units
still requires a controlled service restart with the deployment's normal
drain and health checks. The legacy hot-upgrade path still refuses
NOTIFY_SOCKET; removing the variable or changing the unit is not a safe
workaround. Deployments outside those units must follow the documented
legacy-upgrade preconditions and verify every worker, routing state and
traffic.
This fix makes rejected frontend orders restore their recorded configuration
state. It does not make every Sōzu mutation transactional: mixed worker
acknowledgements, upserts, listener updates, cluster removals, certificate
mutations and pre-existing heterogeneous multi-listener runtime state retain the
limits above.
2.3.0
Highlights
- HTTPS listeners support mutual TLS, trusted client CAs, certificate revocation
lists, and live policy reloads. - Backend health checks support TCP-connect probes and configurable accepted HTTP
status ranges. Load balancing gains shuffle sharding and header/cookie affinity. - UDP clusters gain per-source flow limits, alongside reliability and resource
accounting improvements across TCP, UDP, HTTP/1.1 and HTTP/2. - HTTP/2 scheduling, flow control, draining and flood mitigation are hardened.
- The command socket mode is configurable, and the optional
sozu topdashboard
provides live operational visibility. - Main upgrades use transactional handoffs; worker-upgrade failures are reported
explicitly. Dependencies are refreshed, and the minimum Rust version is 1.93.1. - rustls 0.23.46 includes the fixes for RUSTSEC-2026-0346 through
RUSTSEC-2026-0349. - Rust crate packages build from clean source archives without special Cargo
verification flags.
Upgrading from 2.2.1
The first migration under the shipped Type=notify systemd units requires a
controlled service restart, with the deployment's normal drain and health checks.
The legacy hot-upgrade path refuses NOTIFY_SOCKET; removing that variable or
changing the unit alone is not a safe workaround. Containers whose main has PID 1
must use their normal replacement procedure.
On supported Linux deployments outside those units, the legacy bridge requires
an idle control plane, the replacement CLI, and verification of every worker,
routing state and traffic. Follow the
migration procedure.
Compatibility
Review the detailed breaking-change entries before upgrading: the default
connection-attempt budget increases from three to five, and POWER_OF_TWO load
balancing and path_type = REGEX matching change. Several public library APIs
gain fields or change signatures; upgrade sozu-command-lib, sozu-lib and
sozu together. Upgrade the main, all workers and administrative clients before
enabling new cluster or listener features.
The complete changelog
below retains every detailed change. Compare 2.2.1 with 2.3.0.
2.2.1
Patch release: the main process validates listeners and HTTP/HTTPS
frontends before committing them to its state and rolls back unanimously
rejected or unacknowledged fan-outs, the router rejects malformed
frontend hostnames instead of panicking workers, and a full dependency
refresh re-enables TLS 1.2 + ECDSA under crypto-openssl.
🔐 Security
fix(command): redact TLS certificate and private-key material fromDebugoutput.
Certificate payloads, runtime certified keys and resolvers, HTTP(S) listeners and listener
patches, HTTP frontend configuration, top-levelRequest/RequestTypevalues, retained command
tasks, and generated frontend requests now use boundedDebugsummaries without exposing PEM
contents, certificate DER, custom answer bodies, header values, string-valued command payloads,
or other raw fields carried by those types through nested requests, retained state, or log
statements that useDebugformatting. Direct log and failure projections now also replace
certificate names, HTTP frontend keys, route-miss hosts/paths/custom methods, rewrites, cluster
IDs, custom-answer keys, runtime SNI/ALPN/authority/certificate-SAN values, certificate
fingerprints, and certificate-query domains and results with bounded addresses, kinds, counts,
and byte lengths.StateErroris bounded at itsDisplay/Debugboundary before worker and
audit sinks, and retained-task logs no longer delegate to concrete task payloads.
Wire, Serde, JSON, raw retained state keys, rawStateError,RouterError,ListenerError, and
RetrieveClusterError::SniAuthorityMismatchvariant fields,RequestHttpFrontend::Display, and
certificate-query response payloads remain unchanged.
🐛 Fixed
-
fix(router): reject a malformed frontend hostname instead of panicking the worker.
TrieNode::insertasserted that its recursive insert never reportsInsertResult::Failed, but
the route-table grammar rejects a whole class of hostnames the two cheap guards above the assert
let through: a host ending in/with no openable regex segment (example.com/), a regex
segment that is not.-anchored (abc/[0-9]+/.example.com), a segment that is not a valid regex
(/[/.example.com), and an empty label (.example.com). Those hostnames arrive from the control
plane, so anAddHttpFrontendcarrying one panicked every worker the main process fanned the
request out to — and panicked them again on each restart state replay.add_tree_rulenow
surfaces the rejection asRouterError::AddRoute, so the worker answersFailureand stays up.
Three sibling holes in the same input class are closed with it:convert_regex_domain_rule
indexed one byte past the end of a hostname whose last segment is followed by a bare trailing
.(/a/.) — a release panic reached through the unconditionalDomainRuleparse, upstream of
the trie; hostnames are now bounded toMAX_HOSTNAME_LENGTH(4096 bytes) before any parse, since
the trie recurses once per label (a ~100k-label hostname aborted the worker with an uncatchable
stack overflow) and a/-segment compiles a control-plane-supplied regex whose compilation time
grows with the pattern; andCertificateResolver::add_certificatenow validates every
certificate name against the same trie grammar up front — with the insert no longer panicking, a
discardedInsertResult::Failedwould have registered the certificate while the SNI trie never
learned the name, silently failing every handshake for it.
With workers answeringFailureinstead of dying, the unanimous-rejection rollback from
#1301 also becomes reachable for this class on
the live fan-out path, so the main process'sConfigStateis reverted and no phantom route
persists. Two replay holes remain open and are tracked as follow-ups: theLoadStatepath has no
rollback at all (a poisoned saved state re-injects the entry andSaveStatere-persists it), and
the rollback is skipped when the scatter times out — a single unpatched worker panicking during a
rolling upgrade commits the malformed entry permanently. -
fix(command): validate a listener configuration before committing it to the main-process
state (#1301). An HTTPS listener whose
configuration the worker cannot build (an unusable TLS version/cipher set, or an unparseable
answer template) was recorded in the main process'sConfigStatebefore the worker rejected it,
reserving the address; a corrected reload was then refused withStateError::Existsand never
reached the workers, so the listener stayed down until an explicitRemoveListeneror a restart.
The main process now validates everyAdd{Http,Https,Tcp,Udp}Listenerthe way the worker builds
it — reusing the worker's own construction check, beforeConfigStateis mutated and fanned out —
so an invalid listener never reserves its address and a corrected reload applies cleanly. Invalid
listeners in the static config or a loaded state file are likewise skipped without reserving their
address. TheStateError::Existsmessage now also points at the remedy (remove it first, or apply
the corresponding update, instead of re-adding). As defense-in-depth, when a committed change is
rejected by every worker it was fanned out to, the main process now reverts its ownConfigState
with the inverse request (listener and HTTP/HTTPS-frontend adds), so its authoritative state — the
one replayed into restarted and upgraded workers — never permanently holds an add the whole fleet
refused. -
fix(command): validate HTTP/HTTPS frontends before committing them to the main-process
state (#1313).ConfigStatehas no
route-grammar check —add_http_frontendonly reparses the address and maps the position — so an
Add{Http,Https}Frontendwhose hostname every worker's router refuses was still recorded by the
main process. That state is authoritative:SaveStatere-serialised the malformed entry and every
replay re-injected it, and the replay path (LoadState, static-config load) has no rollback at
all, so the entry survived a unanimous worker rejection and poisoned each subsequent restart. The
main process now runs the worker's own insertion path — the sameRouter::add_http_front, against
a disposable empty router — beforeConfigStateis mutated, on all three apply paths: a live
Add{Http,Https}Frontendis answered with a failure and never fanned out, and a malformed entry
in a saved state file or the static configuration is skipped without entering the state, so it
can never be re-persisted. Skipped entries (frontends and, as before, unbuildable listeners) are
now reported atwarn!instead ofdebug!— an entry silently dropped from the state the
operator saved must be visible at the default log level — and astate loadthat skipped any
entry says how many. Rejection messages report byte lengths only, never the operator-supplied
hostname. -
fix(command): roll back a fanned-out change when the scatter times out with zero worker
acknowledgements (#1314). The unanimous-
rejection rollback from #1301 required at least
one worker to answerFailure, so it was skipped whenever the fan-out timed out instead — and a
worker that panics answers nothing at all: it emits no syntheticFailureand no
expected-response decrement, so the task can only end through its timeout. One unpatched worker
panicking on a malformed frontend during a rolling upgrade therefore left the malformed entry
committed in the main process'sConfigStateforever, withSaveStatere-persisting it, even
though the operator was already told the command had failed. The revert now fires on either
trigger — every scattered worker rejected the change, or the scatter timed out — as long as no
worker acknowledged it; an entry at least one worker applied is still never reverted. Residual: a
slow-but-healthy worker whoseOkarrives after the deadline is invisible to the finished task,
so it keeps the frontend until its next restart or state replay while the main process reverts —
a bounded divergence that self-heals on replay and matches the failure already reported to the
client. -
fix(command): report a fan-out timeout as a failure, not a success.handle_finishing_task
passed a hard-codedtimed_out = falseinto every task completion handler, so a command whose
worker fan-out timed out was reported to the operator asSuccessfully applied request to all workersand its audit line mislabeled theFanoutStatus/result. The realtimed_outflag is
now forwarded, so a timed-out command correctly returns a failure (and the#1301rollback
safety-net's timeout guard now engages as intended).
🔄 Changed
chore: refresh every workspace dependency requirement to its latest published version
(#1317).Cargo.tomlrequirements move to
explicit^x.y.zform: async-trait^0.1.92, flate2^1.1.10, futures^0.3.34,
http-body-util^0.1.5, log^0.4.34, rustls-openssl^0.4.0, and tui-big-text^0.8.9,
with both lockfiles regenerated (cargo auditreports no advisory; the transitive h2 0.4.19
closing RUSTSEC-2026-0258 had already landed onmain). rustls-openssl 0.4.0 fixes the
TLS 1.2 + ECDSA handshake regression that 0.3.x carried, sotest_tls_1_2_ecdsaruns under
crypto-opensslagain and that CI cell is back to full parity with the other providers.
2.2.0
Minor release: TCP passthrough routing by TLS SNI + ALPN, HTTP/1
Transfer-Encoding smuggling hardening, and frontend half-close data-loss
fixes across the pipe and splice paths.
✨ Added
feat(tcp): TCP passthrough routing by TLS SNI + ALPN (#1279).
Aprotocol = "tcp"listener can now fan out to multiple clusters on the
sameaddress:portby reading the TLS ClientHello's SNI (RFC 6066 §3) and,
per route entry, ALPN (RFC 7301 §3.1) during a bounded preread phase —
without decrypting or terminating the connection; the backend still
completes its own handshake with the untouched bytes. New TOML keys: TCP
frontendhostname(mapped to the wiresnifield; exact host or a single
leading*.wildcard) andalpn(repeatable; empty is the per-(address, hostname)catch-all), and listenersni_preread_timeout(default 5s) /
sni_preread_max_bytes(default 16384; config-load rejects a value above
the globalbuffer_size, and the worker defensively clamps the effective
cap to the session buffer at runtime). New CLI
flags:sozu frontend tcp add|remove --sni <host> --alpn <proto>andsozu listener tcp add --sni-preread-timeout <secs> --sni-preread-max-bytes <bytes>(add-only — no wire support yet for patching either knob via
listener tcp update). New metrics:
tcp.sni_preread.{routed,active,duration}and eleven
tcp.sni_preread.rejected.<reason>counters (not_tls,malformed_record,
malformed_handshake,fragmented,too_large,no_sni,
ech_outer_absent,sni_unmatched,alpn_unmatched,
proxy_header_invalid,front_closed) plus
tcp.upgrade.sni_preread.failed. A listener cannot mix SNI-scoped and
no-SNI (legacy single-cluster) frontends;alpnrequireshostname
(ConfigError::AlpnWithoutSni— a no-SNI frontend would silently never
enforce it);sni_preread_max_bytesmust be >= 5 bytes, a full TLS record
header (ConfigError::SniPrereadMaxBytesTooSmall—0would spin the
preread shell on zero-progress reads). These routing-shape invariants (the
mixing ban, ALPN-overlap/catch-all uniqueness, and ALPN-without-SNI) are
now enforced BOTH at TOML config-load (command/src/config.rs) AND
defensively on the worker's hotAddTcpFrontendpath
(TcpListener::validate_new_tcp_front,lib/src/tcp.rs), so a request
sent directly over the command socket or replayed from a stale
LoadStatesnapshot can no longer bypass config.rs and corrupt a
listener's routing table. Seedoc/configure.mdand
lib/src/protocol/tcp_preread/LIFECYCLE.mdfor the full config surface and
state lifecycle. New test coverage: unit tests in
lib/src/protocol/tcp_preread/{mod,shell}.rs, e2e suite
e2e/src/tests/tcp_sni_tests.rs, thefuzz_tcp_clienthellocargo-fuzz
target (wired into thefuzzCI job — nightly toolchain, 300s per target
on every push/PR — andsimulation-sweep.yml's daily
extended-fuzz matrix), and a moonpool-driven deterministic simulation
(sim/tests/tcp_preread_sim.rs,sozu-simcrate — wired into both the
per-PRudp-simulationCI job and a new nightly
tcp-preread-simulation-sweepjob insimulation-sweep.yml).
🔄 Changed
chore(deps):moonpool-simtracks its published crates.io release.
Thesozu-simdev-dependency moves from a pinnedmaingit rev to^0.8.0
on crates.io, closing the follow-up 2.1.1 flagged when the then-published
0.7.0 could not build on stable.chore(deps): dependency refresh —http-body-util0.1.3 → 0.1.4,
mio1.2.1 → 1.2.2,regex1.12.4 → 1.13.0,rustls0.23.41 → 0.23.42,
socket20.6.4 → 0.6.5,toml1.1.2 → 1.1.3.
🐛 Fixed
fix(pipe): stopped truncating in-flight bytes on a frontend half-close
(surfaced by #1279). When the
frontend read side reached EOF whilefrontend_bufferstill held bytes
queued for the backend,Pipe::readablereturnedCloseunconditionally,
silently dropping them instead of flushing first — any front-to-back tail
still in flight at the exact moment of frontend close was lost. The
reproducer that surfaced it was a request payload coalesced with the SNI
ClientHello in the same read (TCP passthrough routing above), but the bug
was general: any plain-TCP upload racing a frontend close could hit it.
readablenow transitions to the half-closedWriteOpenstatus (matching
the existingWouldBlock/Continuehandling), arms backend-writable to
drain the queue, and defers the actual teardown tocheck_connections,
which only closes once nothing is in flight. The HUP path had the same
defect under a heavier load: EPOLLRDHUP can coalesce with the payload tail
into a single epoll batch, soTcpSession::ready_innerobservedHUP
before its processing loop even ran and calledPipe::frontend_hup, which
also returnedCloseunconditionally; it now drains in-flight request
bytes the same way (Continue+ backend-writable + retained frontend
READABLEinterest), andready_innerfalls through into its
same-pass loop on thatContinueinstead of returning immediately, so the
drain completes without waiting on a frontend event that — the client
already sent FIN — will never arrive. Thesplicefast path's EOF arm
(Pipe::splice_readable) had the same unconditional close, dropping bytes
already spliced into the kernel pipe; it now defers teardown the same way
untilsplice_backend_writabledrains them.fix(command):count_tcp_frontends_rawcompiles unconditionally. The
helper was gated#[cfg(debug_assertions)]whileadd_tcp_frontend
references it insidedebug_assert!expressions — which still typecheck in
release builds even though they compile out — so the bench and release
profiles (CI's Criterion step, the Docker image build) failed withE0599
while every debug-profile gate stayed green (command/src/state.rs).fix(packaging): the RPM specVersiontracks the release.
os-build/linux-rpm/sozu.specstill declared2.1.0after the 2.1.1
release. ItsSource0resolves…/archive/%{version}.tar.gz, so the stale
value made the spec fetch the wrong source tarball; it is now bumped in
lockstep with the crates.
🤖 CI
fix(ci): the release build uses the pinned MSRV toolchain. The
per-target release job installs Rust 1.91.0 with its matrix target, matching
therust-toolchainpin (it still requested 1.88.0 after the MSRV bump).fix(ci): the release preflight validates every crate version. The
drift check coveredbin/lib/command/e2eonly, whilesim/(a
workspace member) and the out-of-workspacefuzz/track the same version, so
a partially-bumped tree could ship a green preflight — which is why 2.1.1
needed two follow-up commits to alignfuzz/. The loop now covers all six
manifests andRELEASE.mdnames them.chore(e2e):sozu-e2ecarriespublish = false. The integration-test
harness is not published to crates.io.
🔐 Security
-
fix(h1): harden HTTP/1Transfer-Encodingframing (reopen of #726).
HttpContext::on_request_headers(lib/src/protocol/kawa_h1/editor.rs) now
answers400when a request carries aTransfer-Encodingheader that the
parser did not accept as chunked framing, rather than forwarding it alongside
aContent-Length, and also when more than one non-elidedTransfer-Encoding
header survives kawa's header pass (kawa evaluates each TE field line
independently, so a firstchunkedline can latch chunked framing while a
second, differently-framed line rides along uncaught). Per RFC 9110 §7.6 /
RFC 9112 §6.1 an intermediary must not forward ambiguous message framing. The
rejection runs before routing and increments the
http.frontend.transfer_encoding_smugglingmetric; it mirrors the existing
HTTP/2 → H1 framing-conflict rejection. -
chore: updatekawato 0.7.1 — the complementary upstream parser fix.
kawa0.7.0 resolvesTransfer-EncodingbeforeContent-Lengthand applies
RFC 9110 §6.3 / RFC 9112 §6.1 at the parser level: a present
Transfer-Encodingnow elides everyContent-Lengthregardless of header
order (previously only once chunked framing had been adopted), repeated
Transfer-Encodingfield lines combine with the last line deciding the final
coding (so a leadingchunkedline no longer latches chunked framing on its
own), and a request whose combined final coding is notchunkedis rejected
by the parser instead of forwarded.kawa0.7.1 (CleverCloud/kawa#21)
completes it by excluding leading and trailing optional whitespace from every
header field value, per RFC 9112 §5 ("A field value does not include leading
or trailing whitespace"). Two behaviours change for sozu. A legal
Content-Length: 5(trailing space) is no longer rejected as an invalid
field value. And aTransfer-Encoding: chunked\t— which 0.7.0 already framed
as chunked, since the value is whitespace-trimmed to determine the final
coding, but then forwarded verbatim — is now forwarded as the canonical
chunked. Framing on one reading of a value while forwarding another is a
desync primitive in its own right: with theContent-Lengthelided, a backend
that does not itself trim would see neither a coding it recognizes nor a
length, and would read the chunked body bytes as a pipelined request.An whitespace-obfuscated coding is therefore now handled rather than
refused — it is a legal chunked request, and rejecting it would reject legal
traffic the same wayContent-Length: 5was being rejected. What sozu
guarantees is that it never forwards aTransfer-Encodingthat differs from
the framing it applied: it normalizes, or it ...