]> git.kaiwu.me - haproxy.git/log
haproxy.git
18 hours agoMINOR: mux-quic: remove error trace on transport failure master quic-interop
Amaury Denoyelle [Mon, 23 Nov 2026 15:55:11 +0000 (16:55 +0100)]
MINOR: mux-quic: remove error trace on transport failure

An error trace is reported by MUX-QUIC when the transport layer detects
a connection closure. However, most of the time this occurs because the
client has closed the connection after finishing its transfer via a
NO_ERROR code.

This termination is expected and should not be considered as an error.
For this reason, remove the trace from the MUX-QUIC layer.

19 hours agoBUG/MEDIUM: mux-h2: reject non-101 2xx responses to Extended CONNECT
Olivier Houchard [Mon, 23 Nov 2026 15:13:02 +0000 (16:13 +0100)]
BUG/MEDIUM: mux-h2: reject non-101 2xx responses to Extended CONNECT

An Extended CONNECT (RFC8441) is converted to an upgrade request for an
H1 server, and a 101 response is converted to a 200, meaning that the
tunnel is established. But if the server ignores the upgrade and returns
a regular 2xx, it was forwarded as-is, so the client considered the
tunnel as established and took the payload for tunneled data.

Let's handle such a response as an error, as is already done for a 101
without Extended CONNECT.

This was introduced in 2.4 by commit efe2276a9 ("MEDIUM: mux_h2:
generate Extended CONNECT response") and must be backported to all
supported versions.

21 hours agoMINOR: server: lookup defaults section on "from be:"
Amaury Denoyelle [Mon, 23 Nov 2026 13:22:54 +0000 (14:22 +0100)]
MINOR: server: lookup defaults section on "from be:"

This patch is similar to the previous one. As an alternative to a
backend name, "from be:" may now also reference a named defaults section
to reuse its unnamed default-server.

21 hours agoMINOR: server: lookup defaults section on "from srv:"
Amaury Denoyelle [Mon, 23 Nov 2026 08:53:09 +0000 (09:53 +0100)]
MINOR: server: lookup defaults section on "from srv:"

When defining a server, notation 'from srv:<bename>/<srvname>' can be
specified to inherit from a server or default-server defined in another
backend instance.

Extend this to also look up in defaults sections. This is safe as
proxies and defaults sections cannot have the same name since 3.3.

Without this patch, a named default-server in a named defaults section
is unusable as it cannot be referenced by the existing syntax.

21 hours agoMINOR: server: report incorrect usage of "from" keyword
Amaury Denoyelle [Mon, 23 Nov 2026 10:04:24 +0000 (11:04 +0100)]
MINOR: server: report incorrect usage of "from" keyword

Define a parser for the "from" server keyword. It always returns an
error reporting its invalid position as any "from" setting has already
been parsed during _srv_parse_from().

Also, this prevents a later keyword list from overriding this name.

21 hours agoBUG/MINOR: qmux: prevent pacing BUG_ON() on send syscall zero return
Amaury Denoyelle [Tue, 17 Nov 2026 15:15:48 +0000 (16:15 +0100)]
BUG/MINOR: qmux: prevent pacing BUG_ON() on send syscall zero return

Previously, qcc_qmux_send_frames() would return 1 in case a send failed
on a transient error while nothing was emitted. However, this may
trigger a BUG_ON() in qcc_io_send() as this return value is reserved for
QUIC pacing support, not relevant with QMux.

Fix this by converting the return value to a negative value, which is
already used for fatal errors.

The caller is responsible for re-emitting the new the frame later. As
such, the prepared record is cleared from the send buffer to avoid a
duplicate emission on initial flush.

Note that this patch does not implement full support for QMux partial
emission if the send syscall accepts some but not all bytes, resulting
in a partially delivered frame. This must be implemented in a future
patch. Once this is the case, all code related to the handling of send
zero return can probably be removed.

This must be backported up to 3.4.

21 hours agoCLEANUP: tcpcheck: Stop to export most of custom expect functions
Christopher Faulet [Mon, 23 Nov 2026 07:19:01 +0000 (08:19 +0100)]
CLEANUP: tcpcheck: Stop to export most of custom expect functions

The custom expect functions, for instance tcpcheck_ldap_expect_bindrsp(),
are only used by tcpcheck rules. No reason to export them. The only
exception is the one parsing agent-check response because the parsing of
this option is performed in check.c.

Note also tcpcheck_spop_expect_agenthello() was removed during SPOE
refactoring, so there is no function definition.

21 hours agoREGTESTS: mysql-check: refresh the regtest for the auth switch support
Christopher Faulet [Fri, 20 Nov 2026 09:52:14 +0000 (10:52 +0100)]
REGTESTS: mysql-check: refresh the regtest for the auth switch support

The mock servers no longer expect a COM_QUIT command pipelined with
the handshake response for the post-80 and post-80-sha2 modes, and
new servers exercise an auth switch request, with a success and
failures, including a full authentication request and an access
denied error. Two servers also send an invalid auth switch request,
with an empty payload or a plugin name not terminated by a NUL byte,
to make sure the packet is validated before being handled.

21 hours agoDOC: config: update mysql-check doc for the auth switch support
Christopher Faulet [Tue, 17 Nov 2026 14:29:05 +0000 (15:29 +0100)]
DOC: config: update mysql-check doc for the auth switch support

Document the behavior of the post-80 and post-80-sha2 modes when
the authentication plugin of the check user differs from the
announced one.

21 hours agoMEDIUM: tcpcheck: handle MySQL AuthSwitchRequest in mysql-check post-80 modes
Christopher Faulet [Tue, 17 Nov 2026 14:29:00 +0000 (15:29 +0100)]
MEDIUM: tcpcheck: handle MySQL AuthSwitchRequest in mysql-check post-80 modes

With the post-80 and post-80-sha2 modes, when the authentication
plugin of the check user differs from the announced one, the server
replies to the handshake response with an AuthSwitchRequest. The
check now answers with an empty password for the requested plugin,
then concludes on the authentication result: an OK packet marks the
server as UP, an ERR packet as DOWN, and a full authentication
request fails cleanly as it requires the password.

The AuthSwitchRequest packet is validated before being handled: a
packet with an empty payload or with a plugin name not terminated by
a NUL byte is reported as an invalid response. Otherwise the plugin
name would be searched outside the packet bounds.

To do so, the COM_QUIT command is no longer pipelined right after
the handshake response. It is now sent once the authentication
result is known, packed with the auth switch reply when there is
one, so the session is cleanly closed in every case and no
connection error is recorded on the server. The legacy pre-41 and
post-41 modes keep the pipelined COM_QUIT, they cannot receive an
auth switch request.

21 hours agoMINOR: tcpcheck: evaluate custom expect rules on empty response when allowed
Christopher Faulet [Tue, 17 Nov 2026 14:28:55 +0000 (15:28 +0100)]
MINOR: tcpcheck: evaluate custom expect rules on empty response when allowed

The custom expect functions are not evaluated when the response
buffer is empty. When the TCPCHK_EXPT_FL_ALLOW_EMPTY flag is set
on the rule, the function is now called with an empty buffer, on
the condition it properly handles this situation. It is useful
when the connection closure by the server is itself a valid
result.

21 hours agoMINOR: tcpcheck: add TCPCHK_EXPT_FL_ALLOW_EMPTY flag on expect rules
Christopher Faulet [Tue, 17 Nov 2026 14:27:35 +0000 (15:27 +0100)]
MINOR: tcpcheck: add TCPCHK_EXPT_FL_ALLOW_EMPTY flag on expect rules

Custom expect functions are not evaluated when the response buffer is
empty. With the new TCPCHK_EXPT_FL_ALLOW_EMPTY flag, a custom expect
rule can be evaluated with an empty response, on the condition the
custom function properly handles this situation. It is useful when
the connection closure by the server is itself a valid result.

21 hours agoMEDIUM: stconn: Forward kip hint right before the endpoint callback
Christopher Faulet [Fri, 20 Nov 2026 08:30:20 +0000 (09:30 +0100)]
MEDIUM: stconn: Forward kip hint right before the endpoint callback

sc_ep_fwd_kip_when_committed() forwards the <kip> hint of the producer to
the <kop> hint of the consumer, so the latter may use it as an optimization
(the H1 mux announcing a chunk covering the whole payload at once).

It is currently called at the entry of sc_conn_send() and sc_applet_send(),
and in task_run_applet() before checking the applet was not shut. Thus the
hint may be forwarded while no endpoint callback is invoked, or while the
applet is not called at all. This leaves a pending guarantee on the
consumer side for data that may never be emitted by this call.

Move the call right before the callbacks which may consume <kop>
(resume_fastfwd() and snd_buf() for a connection, appctx_snd_buf() for an
applet), and inside the applet shutdown check, so the hint is forwarded
only when a callback is really invoked. resume_fastfwd() does not use <kop>
for now, but it is not the stconn's business to know which callback consumes
it. The recv side already works this way, before fastfwd() and
appctx_fastfwd().

This is not a fix and there is nothing to backport.

21 hours agoBUG/MEDIUM: mux-h1: never forward more data than announced in a chunk
Christopher Faulet [Thu, 19 Nov 2026 08:05:00 +0000 (09:05 +0100)]
BUG/MEDIUM: mux-h1: never forward more data than announced in a chunk

When a chunked message is sent and a new chunk is started in the zero-copy
path of h1_make_data(), the chunk size is taken from the <kop> hint of the
sedesc when it is set:

    h1m->curr_len = (h1s->sd->kop ? h1s->sd->kop : count);

<kop> is the known output payload length, and by contract it is a minimal
guarantee: at least this size will be forwarded. When it is set, the H1 mux
announces it as the size of the chunk and consumes it. 0 means the output
payload length is unknown, and in this case only the size of the data block
is announced.

But nothing checked that the data sent with the chunk did not exceed the
announced size: h1m->curr_len was blindly decremented, possibly wrapping,
and the remaining bytes of the block were emitted without any chunk framing.

Such a violation could be observed when a data filter was used on the
request, before the previous patch fixed its root: the <kip> hint was
forwarded to <kop> on a stream not committed to forward its data, and a
stale value could then be announced for a data block, possibly smaller than
the block itself.

The copy path already reported an error for messages with a content-length
when more data than announced was met. The same check is now done in the
zero-copy path, for chunked messages: report an error and close the stream
instead of silently emitting an unframed payload. This is a guard for extra
safety, on top of the previous patch which fixes the issue at its root, in
the stream connectors.

Both patches must be backported as far as 3.3. On the stable branches, this
one must be applied on top of the other one, otherwise valid messages may be
rejected when a data filter alters the payload size and a stale <kip> hint
was moved to <kop>.

21 hours agoBUG/MEDIUM: stconn: Only forward kip hint on streams committed to forward data
Christopher Faulet [Thu, 19 Nov 2026 08:00:00 +0000 (09:00 +0100)]
BUG/MEDIUM: stconn: Only forward kip hint on streams committed to forward data

The <kip> hint of a sedesc is the payload length the producer endpoint
estimates it will emit. It is forwarded to the <kop> hint of the opposite
sedesc by sc_ep_fwd_kip(), so the consumer endpoint can use it as an
optimization, for instance the H1 mux to announce a chunk size covering the
whole payload at once.

But <kip> could be set by the producer on the data it demultiplexes, before
the app layer has a chance to see it. In particular, when data filters are
registered on the channel, flt_http_payload() resets <kip> after each pass,
because the filters may alter or drop any part of the payload. But in the
meantime, an I/O callback may already have moved the hint to the opposite
side: the consumer then uses a stale <kop> value, and the data it emits may
not match what this value announces.

This is how the H1 mux could be led to announce a chunk smaller than the
data sent with it, and to emit the remaining bytes without any chunk
framing, making an HTTP/1 server process a part of the request payload as
another request (request smuggling).

The root of the issue is that <kip>/<kop> are hints on data which were
not evaluated by the app layer yet, but they may be consumed as if they
were. <kop> is a minimal guarantee on the output payload: when it is
set, at least this size will be forwarded. It is only safe to feed it
with <kip> once the app layer committed to forward the data as-is.

This patch introduced a safe version of sc_ep_fwd_kip(),
sc_ep_fwd_kip_when_committed(), which only forwards the hint when the
producer channel is configured to forward data indefinitely (to_forward ==
CHN_INFINITE_FORWARD). This is the only case where the app layer committed
to forward everything, without any alteration: http_wait_request_body() and
http_wait_for_response_body() set the infinite forwarding only when no data
filter is registered on the channel. Otherwise <kop> stays null and the
consumer endpoints fall back to their conservative behavior (the H1 mux
announces the size of the data it emits).

When the app layer is not committed yet, <kip> is reset instead of being
kept for later. Until the infinite forwarding is reached, data may be
forwarded and emitted by the consumer with a null <kop>, while <kip> still
accounts for them, because it is only decremented when forwarded. Moving
it later would then set <kop> higher than the remaining payload, and the
H1 mux would announce a chunk bigger than the data left to send. Resetting
it keeps <kop> conservative: lower than the remaining payload, never
higher.

Thanks to Hyunho Seo for the issue analysis.

This patch must be backported as far as 3.3.

21 hours agoBUG/MEDIUM: applets: do not wake up applets before the end of the request analysis
Christopher Faulet [Thu, 19 Nov 2026 18:10:00 +0000 (19:10 +0100)]
BUG/MEDIUM: applets: do not wake up applets before the end of the request analysis

The applet is woken up as soon as it is created by sc_applet_create(). But
the request analysis is not over at this point and it may still be paused,
typically by a "http-request wait-for-body" rule, while the applet is
already attached to the back stream connector (the cache after a
cache-use hit, for instance). Thus, the applet could start to consume the
request and to produce its response before the end of the request
analysis, and the response analysers were evaluated in the same time. It
is unexpected and it could lead to weird issues.

To fix the issue, the way the applets are created is changed.
sc_applet_create() no longer schedules the applet and it no longer
switches the stream connector to the ready state. The applet remains in
SC_ST_INI state, in a dormant state, and the request analysis can
continue, undisturbed. The applet is woken up by back_handle_st_req(),
when the request analysis is over and the stream connector switches from
SC_ST_INI to SC_ST_REQ and then to SC_ST_RDY.

Thus, process_use_service() was reviewed accordingly. Because the
use-service action is terminal and it never yields, there is no re-entry
in this function, so the re-entry branch was removed. And the applet is
not woken up by the action anymore. It will be done by
back_handle_st_req(). Note that a re-entry would now fail in
sc_applet_create(), because the SE_FL_DETACHED flag is cleared once an
applet is attached.

Note this design change reverts, in intent, the commit a33ff7a8a
("BUG/MEDIUM: conn-stream: Set back CS to RDY state when the appctx is
created"). Here, the stream connector is set to the ready state when the
applet is woken up, not when the appctx is created, so the ambiguity
discussed in this commit remains solved: there is no target installed on
a stream connector in SC_ST_INI state, and the stream connector is
switched to SC_ST_RDY state before the applet starts to work.

This patch could be backported to all supported versions. But because it is
a design change, it is probably better to not backport it lower than the
3.2, and only after a period of observation. It relies on "BUG/MEDIUM:
stconn: Do not install an applet on a busy stream connector"

21 hours agoBUG/MEDIUM: stconn: Do not install an applet on a busy stream connector
Christopher Faulet [Thu, 19 Nov 2026 18:00:00 +0000 (19:00 +0100)]
BUG/MEDIUM: stconn: Do not install an applet on a busy stream connector

It is possible to install an applet on a stream connector with an applet
already attached. This could happen with a "http-request cache-use" rule
followed by a matching "http-request use-service" rule, when the
cache-use rule hits. The use-service rule installs a second applet on the
same stream connector, replacing the cache one, which is leaked with its
retained cache row. The commit a72de1022 ("BUG/MEDIUM: cache: do not
create a second applet when two cache-use rules hit") only fixed the case
of two cache-use rules. The use-service rules are still vulnerable.

To fix the issue, sc_applet_create() now checks the SE_FL_DETACHED flag
and fails if it is not set. This flag is set when the stream connector is
created and it is cleared when an endpoint is attached, a mux or an
applet, and it is set again by sc_reset_endp() when the endpoint is
reset, to be able to retry a connection. Thus, it is not possible to
install an applet on a stream connector with an applet already attached
anymore.

This patch should be backported to all supported versions. The commit
a72de1022 is not present in the stable branches and the same weakness
exists there since sc_applet_create() was introduced in 2.6.

21 hours agoDOC: htx: add the NOOP block to the HTX API documentation
Christopher Faulet [Mon, 23 Nov 2026 13:23:11 +0000 (14:23 +0100)]
DOC: htx: add the NOOP block to the HTX API documentation

Update the htx-api internals documentation for the HTX_BLK_NOOP block
introduced by the "MINOR: htx: Add a noop block to carry the EOM flag on an
empty message" commit:

  - Add the no-op block to the marker kinds, the supported types list and
    the typical composition of an HTX message.

  - Document that a NOOP block may carry the EOM flag and that htx_set_eom()
    now relies on it, and no longer on an EOT block, to report the end of
    an empty message.

  - Document that an EOT block without the EOM flag is a valid state: the
    end of the trailers was reached but the message is not ended, more data
    may follow. Consumers must check the EOM flag, not the block type.

  - Mention NOOP for htx_add_endof() and the new htx_add_noop() shortcut,
    for htx_get_blk_value() which returns an empty string for it, and fix
    the htx_skip_msg_payload() description which may now add a NOOP block
    when the message becomes empty.

21 hours agoMINOR: htx: Add a noop block to carry the EOM flag on an empty message
Christopher Faulet [Fri, 20 Nov 2026 16:02:29 +0000 (17:02 +0100)]
MINOR: htx: Add a noop block to carry the EOM flag on an empty message

A new HTX block type, HTX_BLK_NOOP, is added. It has the same traits as
the EOH and EOT blocks: a size of 1, to be able to wake the endpoint up
when it is emitted alone, but nothing is sent when a consumer encounters
it. It may carry the EOM flag and it is allowed anywhere in the message.

It is used by htx_set_eom() to report the end of an empty message: the
EOM flag was previously carried by an EOT block in this case, which was
misleading, an end-of-trailers block carrying no data. As a consequence,
an EOT block without the EOM flag is now a valid state, the message is
simply not ended. This must be handled by all the consumers, especially
the muxes:

  - The H1 mux skips the NOOP blocks and, when one carries the EOM flag,
    it reports the end of the message exactly like a last DATA block. An
    EOT block without the EOM flag still ends the message framing, as
    before: on the wire, the trailers terminate a chunked message, there
    is nothing to add after them.

  - The H2 mux skips the NOOP blocks and, when one carries the EOM flag,
    it emits an empty DATA frame with the END_STREAM flag and closes the
    stream. For a trailers frame, the END_STREAM flag is now only set
    when the EOT block carries the EOM flag, and the stream is only
    closed in this case. An EOT block without the EOM flag means the
    message is not finished and more data may follow.

  - The H3 mux skips the NOOP blocks and, when one carries the EOM flag,
    it sets the fin flag on the stream. Like the H2 mux, the fin flag is
    only reported for an EOT block carrying the EOM flag.

  - The FCGI mux skips the NOOP blocks and, when one carries the EOM
    flag, it emits an empty STDIN record to signal the end of the request.

All the other consumers, the filters, the applets, the sample fetches and
the health-checks, were audited: they either ignore the unknown block
types or stop their walk on the block carrying the EOM flag, so a NOOP
block is properly handled by all of them.

There is no need to backport this patch, it is an enabler for future uses.

21 hours agoMINOR: filters: Register a dedicated trace source for the filters
Christopher Faulet [Thu, 19 Nov 2026 12:53:19 +0000 (13:53 +0100)]
MINOR: filters: Register a dedicated trace source for the filters

The filters were traced using the stream trace source, with the
STRM_EV_FLT_ANA and STRM_EV_FLT_ERR events. It was convenient but it
mixed the filters with the stream analysers, and the events were not
detailed enough to know which filter callback was called, nor on which
channel.

Now a dedicated "filter" trace source is registered. The first argument is
always the stream, the second one is the filter instance and the third one
is the channel, so that the lock-on may be performed on a specific filter.
The events are split by callback: start_ana, pre_ana, post_ana, end_ana,
http_hdrs, http_payload, http_end, http_reset, http_reply, tcp_payload and
xfer_data. Two other events are reported when a filter is attached to or
detached from a stream. The wait and err events are reported when the
filter analysis is paused waiting for data or when it fails.

The decoding function reports the stream and the channel states, the
filter id and its flags, the filter offsets, and the channels' buffers
when the verbosity is high enough. This way it is possible to follow a
filter instance through the analysis of a request or a response, which was
not possible with the stream trace source alone.

The STRM_EV_FLT_ANA and STRM_EV_FLT_ERR events are removed, along with
their entries in the stream trace source, since they are not used
anymore.

22 hours agoBUG/MEDIUM: mux-fcgi: avoid out-of-bounds path decoding
Kelly Kane [Tue, 17 Nov 2026 22:15:43 +0000 (22:15 +0000)]
BUG/MEDIUM: mux-fcgi: avoid out-of-bounds path decoding

A client request can make the FastCGI path copy exactly fill its
scratch buffer. b_tail() then wraps to the start, so subtracting the
path length points before the buffer. URL decoding reads and writes
there instead of reading the copied path.

Require one free byte for ist0()'s terminator. The request then
follows the existing error path; ordinary paths keep working.

Commit a01ba66bc2 rejected oversized copies but missed exact fits.

This should be backported to affected stable branches.

Signed-off-by: Kelly Kane <kelly@hawknetworks.com>
24 hours agoBUG/MEDIUM: acme: take the resolvers lock when linking/unlinking DNS requesters
William Lallemand [Tue, 29 Sep 2026 07:14:18 +0000 (09:14 +0200)]
BUG/MEDIUM: acme: take the resolvers lock when linking/unlinking DNS requesters

The dns-01 pre-check links an ACME requester to a resolution in
acme_rslv_start() and unlinks it in acme_rslv_free(), both called from
the ACME task, which runs on any thread. But resolv_link_resolution() and
resolv_unlink_resolution() manipulate the resolvers' resolution lists and
the resolutions' requester lists, which are also manipulated by the
resolvers task and the response handlers on the resolvers' thread under
resolvers->lock. Other requesters (do-resolve in streams, stream_free(),
CLI actions on servers) always take this lock around these calls, but
the ACME code never does.

Among the possible consequences, the requester callbacks are called on
the resolvers' thread while it iterates over the resolution's requesters
under the lock. The last callback wakes the ACME task up, which may then
immediately call acme_rslv_free() on another thread and unlink the last
requester, which aborts and frees the resolution in leave_resolver_code(),
while the resolvers' thread continues to use it (resolv_reset_resolution(),
LIST_DEL_INIT() etc). Concurrent insertions into the resolutions lists
with process_resolvers() may also corrupt them.

This requires an ACME dns-01 challenge with a multi-threaded process and
was only found by code review: there is currently no way to test ACME
here, but the rules are the same as for all other requesters.

Let's take the lock around the link+trigger and the unlink operations.

This was introduced in 3.4 with commit 631fd5f99 ("MEDIUM: acme: add dns-01
DNS propagation pre-check"), so this must be backported to 3.4.

2 days agoREGTESTS: mysql: Close server s6 declaration
Christopher Faulet [Sat, 21 Nov 2026 11:06:19 +0000 (12:06 +0100)]
REGTESTS: mysql: Close server s6 declaration

During rebase of fixes about the mysql health-check, mysql-check.vtc was
broken. The closing braket for s6 was missing.

3 days agoCLEANUP: pattern: don't even run string-based matches on empty strings
Willy Tarreau [Sat, 21 Nov 2026 08:04:40 +0000 (09:04 +0100)]
CLEANUP: pattern: don't even run string-based matches on empty strings

None of our matching patterns supports matching an empty string, so let's
just not even try to call them for empty strings. This may even speed up
suboptimal configs that unconditionally search for certain things in empty
fields.

3 days agoBUG/MEDIUM: pattern: check for non-empty string before matching regexes
Willy Tarreau [Sat, 21 Nov 2026 07:59:56 +0000 (08:59 +0100)]
BUG/MEDIUM: pattern: check for non-empty string before matching regexes

Zübeyir Eser reported in github issue #3602 that passing req.body to the
default regex engine crashes when there is no body. This is because the
body returns an empty sample while the default regex engine demands at
least one byte available to write a trailing zero.

Let's make sure that regex matches don't even run when subject to empty
strings.

This can be backported to all branches.

3 days agoMEDIUM: config: emit warnings when changing bufsize after other sections
Willy Tarreau [Fri, 20 Nov 2026 18:23:26 +0000 (19:23 +0100)]
MEDIUM: config: emit warnings when changing bufsize after other sections

Long ago we emitted a diag when a global section is placed after some
non-global sections, but that's not sufficient because it's even possible
to change tune.bufsize (even shrink it) and face problems such as return
directives or errorfiles loaded with a larger value not being able to be
delivered.

Let's now emit warnings when the value changes, explaining the risks,
discourage from doing so, and do that as well for tune.maxrewrite and
tune.http.maxhdr, which also impacts the ability to build HTTP replies
on the fly.

3 days agoBUG/MINOR: payload: distcc_body must not sample unreceived buffer bytes
Christopher Faulet [Fri, 20 Nov 2026 16:36:16 +0000 (17:36 +0100)]
BUG/MINOR: payload: distcc_body must not sample unreceived buffer bytes

When the declared body of a distcc token is longer than the data actually
received but still fits within the channel's receive limit,
smp_fetch_distcc_body() truncates the sample to channel_recv_limit() instead
of ci_data(). The sample then covers a range of the buffer that has not been
filled by the current connection, exposing stale bytes left by a previous
connection using the same pooled buffer, e.g. via ACLs, set-var, log-format
or header insertion.

In addition, the incomplete-body check mixed reference frames: ofs is
relative to the input head, but was compared against ci_head() - b_orig() +
ci_data(), which is only equivalent when the input head sits at the buffer
origin. With bytes already forwarded, a body extending past the received
data could be considered complete.

Both issues are fixed by comparing and truncating against ci_data(), the
amount of input data actually received, and by always setting
SMP_F_MAY_CHANGE on truncated bodies so the rules are re-evaluated once more
data arrives.

This patch should fix the issue #3583. It must be backported to all
supported versions.

3 days agoBUG/MINOR: quic: fix uninitialized read of pkt->rs.delivered in ACK processing (BBR)
Frederic Lecaille [Fri, 20 Nov 2026 16:30:57 +0000 (17:30 +0100)]
BUG/MINOR: quic: fix uninitialized read of pkt->rs.delivered in ACK processing (BBR)

In qc_notify_cc_of_newly_acked_pkts() the ->rs.delivered field of a TX
packet is unconditionally read for each newly acknowledged packet. But
->rs is filled in at TX time by quic_cc_drs_on_pkt_sent() (called from
drs_on_transmit() under QUIC_FL_TX_PACKET_ACK_ELICITING guard) for
ack-eliciting packets only. For a non ack-eliciting packet, e.g. a pure
ACK packet, which can be acknowledged by a peer, ->rs has never been
written and this read returns an indeterminate value.

This value is consumed by quic_cc_drs_on_ack_recv() and on_ack_rcvd()
which may corrupt the delivery rate sampling round counting
(drs->round_count, drs->next_round_delivered): a stale value from a
previously recycled packet freezes the round detection, a null one
spuriously increments round_count. Only BBR is affected: cubic neither
provides get_drs() nor on_ack_rcvd().

Fix this by reading ->rs.delivered for ack-eliciting packets only, as
already done for the call to quic_cc_drs_update_rate_sample() just
below, and for on_pkt_lost() in quic_loss.c. Also document in
quic_tx_packet_init() that ->rs is deliberately left uninitialized and
must never be read for a non ack-eliciting packet.

Thank you to @brhenc for having reported this bug in GH #3587.

This bug was introduced by 44af88d85 ("MINOR: quic: RX part
modifications to support BBR") with the delivery rate sampling support.
This must be backported up to v3.2.

3 days agoBUG/MINOR: lua: channel: append() must insert data at the end, not at the start
Christopher Faulet [Fri, 20 Nov 2026 16:23:57 +0000 (17:23 +0100)]
BUG/MINOR: lua: channel: append() must insert data at the end, not at the start

hlua_channel_append() inserts the string at the offset of the start of the
input data, like hlua_channel_prepend() does, instead of after the existing
input data. The offset+len expression is computed and passed through
hlua_channel_filter() but never used. The function is otherwise identical to
hlua_channel_prepend(), it seems to be a copy-paste mistake when the
filter-aware insert path was introduced; hlua_http_msg_append() correctly
inserts at offset+len for the same operation.

As a result, Channel.append() behaved exactly like Channel.prepend(),
placing the string in front of the channel's input data instead of at its
end, in contradiction with its documentation ("Same as
Channel.insert(channel, string, channel:input())").

This patch should fix the issue #3598. It must be backported to all
supported versions.

3 days agoBUG/MINOR: vars: fix missing string termination in get var on too long values
Christopher Faulet [Fri, 20 Nov 2026 16:16:44 +0000 (17:16 +0100)]
BUG/MINOR: vars: fix missing string termination in get var on too long values

vars_parse_cli_get_var() builds the output for the CLI's "get var" in the
shared trash chunk using b_putchr(), which silently drops bytes once the
buffer is full. For a value long enough to exhaust trash mid-loop, the
trailing '>' and the terminating NUL were dropped, leaving trash.area
without any NUL within its bounds. cli_msg() only stores the pointer and the
string is later read with ist() (i.e. strlen) in cli_output_msg(), reading
past the buffer.

Now the loop stops before the last byte, and the terminating NUL is always
written within bounds, truncating the output if needed.

This patch should fix the issue #3592. It could be backported to all
supported versions.

3 days agoBUG/MINOR: tcpcheck: fix out-of-bounds read on the MySQL server version
Christopher Faulet [Fri, 20 Nov 2026 10:16:25 +0000 (11:16 +0100)]
BUG/MINOR: tcpcheck: fix out-of-bounds read on the MySQL server version

On success, the MySQL health-check stores the server version, read at offset
5 of the received buffer, as the check description. The version is a
NUL-terminated string, but nothing guarantees the string is terminated,
neither inside the received data nor past its end. And the version pointer
is directly passed to set_server_check_status(), which copies it with
strncpy() up to 127 bytes, stopping at the first NUL byte. With a
non-compliant server sending a handshake with an unterminated version and no
NUL byte in the rest of the received data, the copy reads past the received
data, into the remaining content of the buffer chunk, and the stale bytes
are disclosed in the check status, visible in the logs, the stats page and
'show servers state'.

To fix it, the version is bounded to the received data before being copied
into the check status, like the plugin name of an auth switch request. This
is a rework of the out-of-bounds reads fixed by 3bbfc3bd7 ('BUG/MINOR:
tcpcheck: fix out-of-bounds reads on short MySQL error packets'), which
covered the error packets but not the success path.

This is a read past the received data, so it requires a non-compliant
server, which is out of the threat model (servers are trusted). Thus there
is no security impact here, only a potential information leak in the check
status.

This patch should fix the issue #3596. It should be backported to all
supported versions.

3 days agoBUG/MEDIUM: mux-spop: let the buffer callback allocate despite the queue
Olivier Houchard [Fri, 20 Nov 2026 14:33:44 +0000 (15:33 +0100)]
BUG/MEDIUM: mux-spop: let the buffer callback allocate despite the queue

spop_buf_available() is called by offer_buffers() while the spop_conn is
still in the buffer wait queue. Since commit d1eb48a12 ("MEDIUM: dynbuf:
refrain from offering a buffer if more critical ones are waiting"),
b_alloc() refuses to allocate when the queue of the same or of a more
critical level is not empty, unless DB_F_NOQUEUE is passed. As the spop_conn
is queued with DB_MUX_RX, the demux buffer allocation always fails from
the callback, and the connection remains blocked until it times out.
This was reproduced by faking a failed demux buffer allocation when
receiving the agent's reply: the SPOE processing times out.

Let's pass DB_F_NOQUEUE to the allocations made from the callback, as
was done for mux-h2 in commit d7192a667 ("BUG/MEDIUM: mux-h2: permit the
buffer callback to allocate despite the queue").

The issue comes from the commit above, and mux-spop is affected since
it was introduced in 3.1. This must be backported to 3.1.

3 days agoBUG/MEDIUM: mux-fcgi: let the buffer callback allocate despite the queue
Olivier Houchard [Fri, 20 Nov 2026 14:33:44 +0000 (15:33 +0100)]
BUG/MEDIUM: mux-fcgi: let the buffer callback allocate despite the queue

fcgi_buf_available() is called by offer_buffers() while the fconn is
still in the buffer wait queue. Since commit d1eb48a12 ("MEDIUM: dynbuf:
refrain from offering a buffer if more critical ones are waiting"),
b_alloc() refuses to allocate when the queue of the same or of a more
critical level is not empty, unless DB_F_NOQUEUE is passed. As the fconn
is queued with DB_MUX_RX, the demux buffer allocation always fails from
the callback, and the connection remains blocked until it times out.
This was reproduced by faking a failed demux buffer allocation when
receiving the response: the request ends with a 504.

Let's pass DB_F_NOQUEUE to the allocations made from the callback, as
was done for mux-h2 in commit d7192a667 ("BUG/MEDIUM: mux-h2: permit the
buffer callback to allocate despite the queue").

This was introduced in 3.0 by the commit above and must be backported
to 3.0.

3 days agoBUG/MEDIUM: mux-h2: don't stall on a failed rxbuf alloc without stream
Olivier Houchard [Fri, 20 Nov 2026 13:29:45 +0000 (14:29 +0100)]
BUG/MEDIUM: mux-h2: don't stall on a failed rxbuf alloc without stream

When h2c_dec_hdrs() fails to allocate the temporary buffer used to
decode the HEADERS frame of a new request, it sets H2_CF_DEM_SALLOC and
the connection is queued in the buffer wait list. But h2_buf_available()
only serves H2_CF_DEM_SALLOC for a stream which has a stream connector,
which is not the case yet, so it never succeeds: the demux remains
blocked and the request is not processed until the connection times
out. This can be reproduced by faking a failed allocation there on the
first request of a connection.

There is no buffer the callback could allocate in this case, so let's
clear the flag and restart the demux, which will retry by itself. Since
b_alloc() refuses to allocate when other entries are queued, the retry
would be queued again and the offered buffer would be lost for
everyone, so a new flag H2_CF_DEM_MAYALLOC is set to let the next
h2_get_buf() allocate with DB_F_NOQUEUE, as mux-h1 does with
H1C_F_IN_MAYALLOC.

This was introduced in 2.0 by commit 5c8cafae3 ("MEDIUM: mux-h2: decode
HEADERS frames before allocating the stream"). It must be backported to
all supported versions. Before 3.0 there is no DB_F_NOQUEUE and the new
flag is not needed, clearing H2_CF_DEM_SALLOC and restarting the demux
is enough.

3 days agoMINOR: http: use fuzzy-match for the "return" action keywords
Willy Tarreau [Fri, 20 Nov 2026 14:01:46 +0000 (15:01 +0100)]
MINOR: http: use fuzzy-match for the "return" action keywords

The "http-request return" action supports ~10 keywords whose spelling
is never well-known for the least common ones and requires one to check
the doc. Let's just leverage find_word_index_in_array() to locate the
keyword or suggest a close match.

3 days agoMINOR: init: automatically turn "set-dumpable" on when using "-d"
Willy Tarreau [Fri, 20 Nov 2026 13:15:11 +0000 (14:15 +0100)]
MINOR: init: automatically turn "set-dumpable" on when using "-d"

Since we started to automatically chroot for unprivileged users, it
has become really annoying for developers to get a core file during
their testing. Let's always turn "set-dumpable" on when debug mode
is forced on via "-d".

3 days agoCLEANUP: mux-h2: get rid of the redundant h2_parse_int() function
Willy Tarreau [Fri, 20 Nov 2026 12:43:39 +0000 (13:43 +0100)]
CLEANUP: mux-h2: get rid of the redundant h2_parse_int() function

This one was brought by commiy 8475b372c ("BUG/MINOR: mux-h2: reject
non-numeric values in the tune.h2 keywords") but is no longer needed
with the recent intops additions, let's get rid of it.

3 days agoMINOR: jwt: Deprecate jwt_verify converter
Remi Tricot-Le Breton [Fri, 20 Nov 2026 10:08:46 +0000 (11:08 +0100)]
MINOR: jwt: Deprecate jwt_verify converter

The 'jwt_verify' converter was built with the idea of being easy to use
for all JWT tokens and its second parameter needied to be interpreted
totally differently depending on the first parameter (HMAC vs pubkey
path). This comes with a potential security risk if a user did not check
the algorithm type before calling the converter. If an HMAC-signed token
was tested in a jwt_verify call that provided a certificate as second
parameter, an attacker could try to guess the certificate path and forge
HMAC tokens that validate against the certificate path.

In order to get rid of this potential risk, a new jwt_verify_secret
converter was introduced, and paired with the already existing
jwt_verify_cert one, we can fully get rid of this risk since no
parameter gets treated differently based off client-provided
information.

3 days agoMINOR: jwt: New jwt_verify_secret converter
Remi Tricot-Le Breton [Fri, 20 Nov 2026 10:08:45 +0000 (11:08 +0100)]
MINOR: jwt: New jwt_verify_secret converter

The 'jwt_verify' converter interprets its second parameter differently
depending on its first one: for HMAC algorithms it is used as a shared
secret, while for asymmetric ones it holds the path to a certificate or
a public key. Letting client-provided data decide how a configuration
parameter is interpreted is risky.

Splitting this logic into two converters removes the ambiguity. The new
'jwt_verify_secret' converter only accepts HMAC algorithms and always
interprets its second parameter as a secret, while the existing
'jwt_verify_cert' converter only accepts asymmetric algorithms and
always interprets it as a certificate or public key path.

The historical 'jwt_verify' converter, which keeps both behaviors for
backward compatibility, is left untouched for now, but it is the
converter that should eventually disappear once users migrated to the
two new ones.

3 days agoBUG/MINOR: tcpcheck: fix out-of-bounds reads on truncated SPOP hello frames
Christopher Faulet [Fri, 20 Nov 2026 10:42:38 +0000 (11:42 +0100)]
BUG/MINOR: tcpcheck: fix out-of-bounds reads on truncated SPOP hello frames

The SPOP health-check parser reads the frame header, then dispatches on the
frame type with a read right after the 11-byte header, and decodes the K/V
items of the payload. Nothing prevents these reads to go past the received
data:

  - With a frame announcing no payload (flen == 0) and a received data
    exactly covering the header, the frame type is read one byte past
    the received data. It is fully deterministic and does not even
    require the connection to be closed by the server.
  - When a K/V item key name ends exactly at the end of the received
    data, the type byte of the item value is read one byte past it.
  - The frame length check may also overflow: it is computed as
    4 + flen on a 32-bit value read from the wire, which wraps for a
    length close to UINT32_MAX.

The bytes past the received data are stale buffer content: the parsing and
the check result are then driven by bytes never sent by the server.

The SPOP parser now validates the received data itself: a frame with no
payload is invalid (both the AGENT-HELLO and AGENT-DISCONNECT frames carry
at least one K/V item), the length comparison is made overflow-safe, and the
type byte of every K/V item value is only read when the payload is not fully
consumed. Truncated frames are reported as invalid instead of being parsed
from bytes never received.

It is a read past the received data, inside the check buffer, so it requires
a non-compliant agent, which is out of the threat model (servers are
trusted). There is no security impact, only a check status that depends on
stale data.

It should be backported to all supported versions.

(Reported-by: Gleb Lizunov)

3 days agoBUG/MINOR: tcpcheck: fix out-of-bounds reads on truncated LDAP bind responses
Christopher Faulet [Fri, 20 Nov 2026 10:42:17 +0000 (11:42 +0100)]
BUG/MINOR: tcpcheck: fix out-of-bounds reads on truncated LDAP bind responses

The LDAP health-check relies on the min-recv parameter of the expect rule
matching the first byte of the bind response to guarantee enough data are
received before parsing the message. But this parameter is only honored
while data are still expected: on a FIN or a connection error, the last read
is already reached and the rule is evaluated on the received data only. A
truncated response may thus be parsed with fewer bytes than the parser
assumes:

  - With a single byte received, the message size is read one byte past
    the received data.
  - With a message announcing a size lower than 4, the 4-byte comparison
    on the message ID and the bindResponse tag reads up to 3 bytes past
    the received data.

The bytes past the received data are stale buffer content: the parsing and
the check result are then driven by bytes never sent by the server.

The LDAP parser now validates the received data itself: the message size
must be received, and the message must be at least 5 bytes to cover the
message ID, the bindResponse tag and its length. Shorter responses are
reported as truncated.

It is a read past the received data, inside the check buffer, so it requires
a non-compliant server, which is out of the threat model (servers are
trusted). There is no security impact, only a check status that depends on
stale data.

It should be backported to all supported versions.

(Reported-by: Gleb Lizunov)

3 days agoREGTEST: spoe: add large-frame tests for the applet and the mux
Christopher Faulet [Wed, 18 Nov 2026 07:55:51 +0000 (08:55 +0100)]
REGTEST: spoe: add large-frame tests for the applet and the mux

Two tests exercising a near-max-size SPOP frame (a 14000-byte
binary argument) through the SPOE applet and the SPOP mux:

- largeframe.vtc, on-frontend-tcp-request event carrying
  req.payload(0,14000) sampled from a buffered 30KB request;

- groupframe.vtc, http-request send-spoe-group carrying req.body,
  the rule yielding until the request is complete so args are
  encoded from the fully buffered body.

Both rely on a protocol-correct python agent (spoa_largeframe.py),
mirroring encode_varint()/decode_varint() from
include/haproxy/intops.h. largeframe.vtc also uses a small raw
TCP client (lf_client.py) for the 30KB request.

3 days agoREGTEST: spoe: fix the SPOP varint encoding in the mock agent
Christopher Faulet [Wed, 18 Nov 2026 07:55:45 +0000 (08:55 +0100)]
REGTEST: spoe: fix the SPOP varint encoding in the mock agent

The mock agent implemented a LEB128-style variable-length
integer instead of the SPOP one: the continuation shift was
off by 16 on encode and the decode masked the continuation
bytes where the reference implementation adds their full
value. The echoed max-frame-size was thus wrong (14076 instead
of 16380 with the default tune.bufsize) and only passed the
negotiation because it stayed within the accepted range. With
a smaller tune.bufsize the test would fail.

Mirror encode_varint()/decode_varint() from
include/haproxy/intops.h. Validated against the C
implementation for all values below 2000 plus larger
boundaries.

3 days agoBUG/MEDIUM: stick-tables: update the bucket's next_exp before releasing its lock
Olivier Houchard [Thu, 19 Nov 2026 18:16:31 +0000 (19:16 +0100)]
BUG/MEDIUM: stick-tables: update the bucket's next_exp before releasing its lock

process_tables_expire() computes the next expiration date of a table's
bucket under the bucket's lock, but releases the lock (and frees the
expired entries) before replacing the bucket's next_exp with this date. In
this window, another thread may insert a new entry (under the bucket's
lock) and call stktable_requeue_exp() for it. If next_exp still holds the
old (past) date, stktable_requeue_exp() considers the table as already
queued early enough and does nothing. Then the expiration task replaces
next_exp with the later date it computed, possibly TICK_ETERNITY, and
repositions or removes the table from its tree accordingly. The new entry
then doesn't expire until some other activity on this table requeues it.
The window was widened by commit 3e25104a9 ("MEDIUM: stick-tables: Avoid
freeing elements while holding a lock") which moved the freeing of expired
entries there.

Let's set next_exp before releasing the bucket's lock, so that any
insertion performed after it sees the new value. Since entries are
inserted under this lock, the computed date covers every entry present
in the bucket, so a concurrent stktable_requeue_exp() may safely be
overwritten and a plain store is enough, the CAS is not needed anymore.

This was introduced in 3.3 by commit 8bc8a21b2 ("MEDIUM: stick-tables: Use
a per-shard expiration task") and must be backported to 3.3.

3 days agoCLEANUP: tree-wide: remove unneeded dependencies on tools.h
Willy Tarreau [Fri, 20 Nov 2026 10:47:43 +0000 (11:47 +0100)]
CLEANUP: tree-wide: remove unneeded dependencies on tools.h

110 files were including tools.h without needing it, despite this file
being large and coming itself with many dependencies. This patch removes
these includes or replaces them with smaller ones when appropriate. All
these files were successfully built.

This reduces the total preprocessed size by ~1%:
  - before: 8643090 lines, 260047208 total bytes
  - after:  8562136 lines, 258459721 total bytes

3 days agoREORG: tools/intops: move the int-to-str conversion functions to intops as well
Willy Tarreau [Fri, 20 Nov 2026 10:25:29 +0000 (11:25 +0100)]
REORG: tools/intops: move the int-to-str conversion functions to intops as well

These functions come with statically allocated thread-local arrays that
are used to store the output values during conversions. But they're used
just like the str-to-int ones, so let's place them here. This comes with
the creation of intops-t.h for a few macro definitions used to define the
array sizes.

3 days agoREORG: tools/intops: move the integer-specific functions from tools to intops
Willy Tarreau [Fri, 20 Nov 2026 10:06:27 +0000 (11:06 +0100)]
REORG: tools/intops: move the integer-specific functions from tools to intops

This was already the case for their declaration in intops.h instead of
tools.h, but we were still lacking an intops.c file, so everything
remained stuffed anywhere in tools.c, difficult to find.

This moves all the functions mentioned in intops.h from tools.c to a new
intops.c file. That's roughly 450 less lines in tools.c and a slightly
better organized file where it should be easier in the future to locate
the function one needs.

3 days agoMINOR: tools: add some of the missing null-terminated integer parsers
Willy Tarreau [Thu, 19 Nov 2026 16:26:44 +0000 (17:26 +0100)]
MINOR: tools: add some of the missing null-terminated integer parsers

We have a number of integer parsers depending on what delimits the
integer, but the null-terminated ones were still fairly limited,
especially when range checks were expected. This commit adds the
following parsers:

  int str2irc(const char *str, int *ret);
  int str2uirc(const char *str, uint *ret);
  int str2lrc(const char *str, long *ret);
  int str2ulrc(const char *str, ulong *ret);
  int str2llrc(const char *str, llong *ret);
  int str2ullrc(const char *str, ullong *ret);

The all return an error status like their equivalent length-defined
ones, with the returned value via a pointer. They stop on a null
character and return parsing error when non-digit chars appear in the
string, or when too large a number is being produced for the range.

Note that for now they're in tools.c and defined in intops.h because
other ones were done similarly, but all of these should move to a new
intops.c file.

3 days agoBUG/MINOR: mux-h2: reject non-numeric values in the tune.h2 keywords
Martin Mirchev [Wed, 18 Nov 2026 12:36:59 +0000 (20:36 +0800)]
BUG/MINOR: mux-h2: reject non-numeric values in the tune.h2 keywords

The tune.h2 numeric keywords are parsed with atoi(), so trailing garbage
and non-numeric values are silently accepted: "tune.h2.max-frame-size
16384x" sets 16384, "tune.h2.fe.max-total-streams x" and
"tune.h2.fe.glitches-threshold x" set 0, which means "unlimited" for both,
"tune.h2.header-table-size 8192k" sets 8192 and a missing glitches value
is taken as 0. The same applies to initial-window-size,
max-concurrent-streams (including its "rq-load" and "min" values) and the
max-{frames,rst}-at-once keywords, where a negative value is also silently
turned into a huge unsigned limit.

Parse these values with strtol() and reject empty values, trailing
characters and values that do not fit in an int, keeping the existing
range checks and error messages. max-{frames,rst}-at-once now also reject
negative values.

This should be backported to all stable versions.

3 days agoBUG/MINOR: mqtt: reject invalid CONNECT flags and MQTT 3.1.1 CONNACK return codes
Martin Mirchev [Wed, 18 Nov 2026 12:35:30 +0000 (20:35 +0800)]
BUG/MINOR: mqtt: reject invalid CONNECT flags and MQTT 3.1.1 CONNACK return codes

mqtt_is_valid() and the mqtt_field_value() converter accept several
messages the specifications forbid:

  - a CONNECT with the Will QoS set to 3. The only check rejected the
    case where both QoS bits are set without the Will flag, so neither
    "Will QoS 3 with Will" nor "Will QoS 1 or Will Retain without Will"
    was caught (MQTT 3.1.1 3.1.2.6/3.1.2.7, MQTT 5.0 3.1.2.6/3.1.2.7);
  - an MQTT 3.1.1 CONNECT with the Password flag but not the User Name
    flag (MQTT 3.1.1 3.1.2.9; MQTT 5.0 allows it, so only 3.1.1 is
    checked);
  - an MQTT 3.1.1 CONNACK with a return code above 5, e.g. 200 (MQTT
    3.1.1 3.2.2.3 only defines 0 to 5).

For example mqtt_is_valid returns 1 for a 3.1.1 CONNECT with flags 0x1c
or 0x40, and for a 3.1.1 CONNACK "20 02 00 c8". Reject these messages.

This should be backported to all stable versions.

3 days agoBUG/MINOR: mux-spop: match the AGENT-HELLO and AGENT-DISCONNECT keys exactly
Martin Mirchev [Wed, 18 Nov 2026 12:34:24 +0000 (20:34 +0800)]
BUG/MINOR: mux-spop: match the AGENT-HELLO and AGENT-DISCONNECT keys exactly

The K/V keys of the AGENT-HELLO and AGENT-DISCONNECT frames are compared
with "sz >= strlen(KEY) && !memcmp(str, KEY, strlen(KEY))", which is a
prefix match: an agent sending "max-frame-size-bogus" (or "versionX",
"capabilitiesX", "status-codeX") has the item treated as the mandatory
one. With an invalid value under "max-frame-size-bogus", haproxy closes the
connection with "max-frame-size too big or too small", exactly as for the
real key, while a key sharing no prefix is ignored as it should be.

Compare the whole key instead. The commented-out "message" check is
updated the same way.

This should be backported to all versions with mux-spop (3.1+).

3 days agoBUG/MINOR: intops: reject varints that do not fit in 64 bits in decode_varint()
Willy Tarreau [Thu, 19 Nov 2026 14:57:15 +0000 (15:57 +0100)]
BUG/MINOR: intops: reject varints that do not fit in 64 bits in decode_varint()

decode_varint() accepts any number of continuation bytes. From the 11th
byte on, the shift count exceeds 63, which is undefined behaviour (UBSan:
"shift exponent 67 is too large for 64-bit type"), and a 10-byte varint
whose last byte is above 15 silently wraps: a value >= 2^64 is decoded
modulo 2^64. For example an SPOP agent sending the AGENT-HELLO
max-frame-size as f0 ff ff ff ff ff ff ff ff 7f has it decoded as
2314921131297212640 instead of being rejected.

In order to avoid adding costly checks in the inner loop, let's only
process the first 9 bytes as usual in the current loop and make a
special case of the 10th byte where we add an overflow check if ever
met.

This should be backported to all stable versions.

Reported-by: Martin Mirchev <mirchevmartin2203@gmail.com>
Co-authored-by: Martin Mirchev <mirchevmartin2203@gmail.com>
3 days agoBUG/MINOR: resolvers: reject DNS messages without the QR bit
Martin Mirchev [Wed, 18 Nov 2026 03:33:04 +0000 (11:33 +0800)]
BUG/MINOR: resolvers: reject DNS messages without the QR bit

resolv_validate_dns_response() checks the query ID, the RCODE, the
question and the records, but not the QR bit, which tells a response
(1) from a query (0). A message with QR=0 is thus processed as a
response: one carrying the same answer as a valid response is accepted,
and the query itself, if it comes back from the nameserver's address
(e.g. through an echo or a forwarding loop), is processed as a response
without any answer.

The sender still has to match the nameserver address, the query ID and
the question, so this does not make spoofing easier, but such a message
is not a response and should be treated as invalid, as RFC 1035 defines
the QR bit for this purpose.

This patch adds DNS_FLAG_RESPONSE and makes such messages invalid. The
new reg-test reg-tests/resolvers/response_flag.vtc uses a small DNS
fixture that sends the same A answer with and without the QR bit, and
checks that only the former resolves and that the latter is counted as
invalid.

This may be backported to the stable branches.

3 days agoBUG/MINOR: net_helper: accept an Ethernet header ending with the protocol
Martin Mirchev [Wed, 18 Nov 2026 03:25:34 +0000 (11:25 +0800)]
BUG/MINOR: net_helper: accept an Ethernet header ending with the protocol

The eth.data, eth.hdr, eth.proto and eth.vlan converters walk the
Ethernet header with "idx + 2 < data", which requires at least one byte
after the 2-byte protocol field. An input that ends exactly with the
header is thus reported as incomplete, so eth.proto and eth.vlan return
nothing on the output of eth.hdr: "eth.hdr,eth.proto" never works, and
neither does any frame truncated right after the protocol field.

The protocol field is complete when idx + 2 <= data, so let's use this
condition in the 4 loops. Frames that carry data after the header are
not affected. The net_helper reg-test now checks eth.hdr followed by
eth.proto and eth.vlan.

This should be backported to 3.4.

3 days agoBUG/MINOR: net_helper: check the TCP option length before reading its value
Martin Mirchev [Wed, 18 Nov 2026 03:25:19 +0000 (11:25 +0800)]
BUG/MINOR: net_helper: check the TCP option length before reading its value

tcp_fullhdr_find_opt() only checks that an option fits in the TCP header
and has a length of at least 2, so the tcp.options.mss, tcp.options.tsval
and tcp.options.wscale converters read their value from the bytes that
follow the option when its length field is too small. With a 24-byte
header ending with "NOP NOP 02 02" followed by the payload 0x12 0x34,
tcp.options.mss returns 4660, and with "NOP NOP 03 02" followed by 0xaa,
tcp.options.wscale returns 170. When the option is the last one and
nothing follows the header, the value is read past the end of the input
sample (by up to 4 bytes for tsval).

This patch makes these 3 converters ignore the option when its length is
not the one defined for it (4 for MSS, 10 for TimeStamp, 3 for Window
Scale), as when the option is absent, so that they return 0 in this case. A new
reg-test, reg-tests/converter/net_helper.vtc, checks these cases.

This should be backported to 3.4.

3 days agoBUG/MINOR: ocsp: fix NULL dereference when the OCSP responder sends no header
Remi Tricot-Le Breton [Thu, 19 Nov 2026 15:44:03 +0000 (16:44 +0100)]
BUG/MINOR: ocsp: fix NULL dereference when the OCSP responder sends no header

Both OCSP response handlers look for a "Content-Type" header in the
response received from the responder by iterating over hc->res.hdrs
until they reach the end-of-array marker. But this array is only
allocated when the response contains at least one header so the array
may be NULL.

This is reachable in production as soon as the OCSP auto-update is
enabled. Any responder which answers with a header-less HTTP/1.0
response (a plain error page, a minimal embedded server, a proxy that
strips the headers) crashes the worker. The same issue applies to the
client-certificate OCSP check used by the "do-ocsp-request" action,
where the request is sent to the URI found in the client certificate.

This patch must be backported to 3.3.

3 days agoBUG/MINOR: httpclient/cli: fix NULL dereference when the response has no header
Remi Tricot-Le Breton [Thu, 19 Nov 2026 15:44:02 +0000 (16:44 +0100)]
BUG/MINOR: httpclient/cli: fix NULL dereference when the response has no header

The CLI "httpclient" command (expert mode) displays the response status
line, then its headers, then its body. The httpclient applet only
allocates the response headers array when the response contains at least
one header.

A response without any header is perfectly legal for HTTP/1.0, so any
server which answers a header-less response crashes the process when the
"httpclient" command is used against it. Only an admin can run this
command, so it cannot be triggered by untrusted input and stays MEDIUM,
but a crash remains a crash for users who rely on this command to probe
their backends.

This patch must be backported to 3.3.

4 days agoMINOR: ssl/quic: mark hq-interop QUIC ALPN as experimental
Amaury Denoyelle [Thu, 19 Nov 2026 15:19:14 +0000 (16:19 +0100)]
MINOR: ssl/quic: mark hq-interop QUIC ALPN as experimental

hq-interop in ALPN corresponds to HTTP/0.9 layer. This protocol is
reserved for QUIC interop testing and must not be active in production.

Introduces a new global keyword 'tune.quic.interop'. It may be set to
either 'fe' or 'off', anticipating a future 'be' value for backend
support. The keyword parsing forces users to activate experimental
directives.

The second part of this patch is in ALPN keyword parsing. If hq-interop
is found but 'tune.quic.interop fe' is not set, an error is reported.
This parser may also run at runtime for dynamic crt-list loading. In
this case, 'hq-interop' token is silently removed if present.

For now, nothing is performed on the server-side. This is because QUIC
backend is still incomplete and is itself experimental.

4 days agoMINOR: ssl: allow prefix lookup for alpn_remove_token()
Amaury Denoyelle [Fri, 20 Nov 2026 08:42:24 +0000 (09:42 +0100)]
MINOR: ssl: allow prefix lookup for alpn_remove_token()

Extend alpn_remove_token() by adding an extra boolean argument <prefix>.
This changes how ALPN entries are compared, so that strings are
considered as matching if they begin with the specified value.

This will allow clearing ALPNs which may take various suffixes, for
example for hq-interop/h3 with an IETF draft version.

4 days agoBUG/MINOR: ssl/cli: use the right list member in "add ssl crt-list" release
William Lallemand [Fri, 20 Nov 2026 10:49:08 +0000 (10:49 +0000)]
BUG/MINOR: ssl/cli: use the right list member in "add ssl crt-list" release

cli_release_add_crtlist() walks the crtlist_entry's list of ckch_inst with
the "by_ckchs" list member instead of "by_crtlist_entry". Since
list_for_each_entry_safe() re-bases each node with the offset of the given
member, walking a list whose elements are chained through
"by_crtlist_entry" using the offset of "by_ckchs" produces a bogus struct
ckch_inst pointer, which is then passed to ckch_inst_free(). The latter
writes through it (LIST_DELETE on both members and free()), so this is
not just a wild read but real memory corruption.

This happens when "add ssl crt-list" fails after at least one ckch_inst
was already generated and appended to the entry being added (e.g. a later
bind_conf failing to instantiate), in which case the worker dies with a
SIGSEGV during the cleanup of the discarded entry. This requires ADMIN
CLI access so it stays out of the threat model, but it is a crash of the
worker triggered by a legitimate command.

Use "by_crtlist_entry" like every other walk of this list in the same
file (crtlist_entry_free() and both loops of the delete handler). The bug
is present since the introduction of the command in 2.2 (e67c80be7f
"MEDIUM: ssl/cli: 'add ssl crt-list' command"), so every maintained
branch is affected, but the fix applies cleanly everywhere as this code
never changed since.

This should be backported in every stable branches.

Reported by Bruno Henc (@brhenc).

Fixes issue #3586.

4 days agoBUG/MINOR: ech: keep CLI success messages alive until printed
William Lallemand [Fri, 20 Nov 2026 10:06:15 +0000 (10:06 +0000)]
BUG/MINOR: ech: keep CLI success messages alive until printed

The add, set and del ssl ech parsers build their success messages in local
stack buffers and pass them to cli_msg(). This helper only stores the
pointer: the CLI applet prints it after the parser returns, when the
buffer is already out of scope. The success response is therefore read
through a dangling pointer.

Allocate these messages with memprintf() and transfer ownership to
cli_dynmsg(), which frees them after printing or on connection teardown.
Remove the now-unused fixed message size.

Reported by Bruno Henc (@brhenc) in issue #3589.

Fixes issue #3589.
This should be backported to 3.3 and 3.4.

4 days agoBUG/MEDIUM: jwt: Use JWT cert tree for jwt_decrypt
Remi Tricot-Le Breton [Wed, 18 Nov 2026 14:09:31 +0000 (15:09 +0100)]
BUG/MEDIUM: jwt: Use JWT cert tree for jwt_decrypt

The jwt_decrypt converters have the same issue as the jwt_verify one,
they were taking the ckch_lock during runtime processing which could
fail in case the lock was already taken by a CLI operation.
We now make use of the already existing jwt tree to store the private
keys used in the decrypt operations. The only lock taken during runtime
is the jwt tree one which also gets locked in write mode while updating
certificates via the CLI or changing the jwt mode ("add/del ssl jwt").

This patch is a continuation of "BUG/MEDIUM: jwt: Use only JWT cert tree
for jwt_verify", it helps fix for good the issue decribed in GitHub
issue #3526. It relies on "MINOR: jwt: Add rwlock to jwt_cert_tree" as
well.

This patch should be backported up to 3.4.

4 days agoBUG/MEDIUM: jwt: Use only JWT cert tree for jwt_verify
Remi Tricot-Le Breton [Wed, 18 Nov 2026 14:09:30 +0000 (15:09 +0100)]
BUG/MEDIUM: jwt: Use only JWT cert tree for jwt_verify

The jwt_verify converter can either used a public key that was already
stored in a dedicated tree built during init that did not require any
lock, or use a certificate loaded in the ckch_store tree. The main issue
in this second case is that we needed to take the ckch_lock during
runtime but this spinlock is also taken during all CLI commands that
modify the certificates (and can last a long time when a lot of chck
instances are rebuilt for instance).

We now store the public keys used by jwt_verify in the JWT certificate
tree for all code paths instead of looking them up in the CKCH tree. We
keep the tree entry in sync when certificates are loaded, replaced,
removed, or when the "jwt" option is toggled through the CLI. In those
cases, the lock on the JWT tree in only taken while the tree gets
updated, during the ckch_store_replace call.

A keyless entry is also created for certificates whose "jwt" option is
disabled so that jwt_verify can still report JWT_VRFY_UNAVAIL_CERT (-7)
instead of JWT_VRFY_UNKNOWN_CERT (-5).

This patch relies on "MINOR: jwt: Add rwlock to jwt_cert_tree".  It
fixes the issue described in GitHub #3526 (and raised by some IA models
as well).

This patch can be backported up to 3.3.

4 days agoMINOR: jwt: Add rwlock to jwt_cert_tree
Remi Tricot-Le Breton [Wed, 18 Nov 2026 14:09:29 +0000 (15:09 +0100)]
MINOR: jwt: Add rwlock to jwt_cert_tree

The jwt_cert_tree that stores pure public keys loaded during init and is
used by the jwt_verify converter was never locked since we only appended
entries during init and never modified them during runtime.
In future commits its usage will be extended so it will need a locking
mechanism. The tree will only change following CLI updates so a rwlock
should do the job since mos of the work will be done under a read lock
only.

4 days agoBUG/MEDIUM: log/tools: fix cbor binary integer encoding regression with x86_64 systems
Aurelien DARRAGON [Thu, 19 Nov 2026 21:32:11 +0000 (22:32 +0100)]
BUG/MEDIUM: log/tools: fix cbor binary integer encoding regression with x86_64 systems

A regression was introduced in commit c1abbb11f ("OPTIM: log/tools:
switch from function pointer design to dual mode HEX/BIN design for
CBOR encoding").

Indeed, it was assumed that for x86_64 systems that the byte order
for uint64_t was already correct and that the value could be written
as-is. This is totally wrong, because x86_64 is little endian while
CBOR is big endian. Because of this mistake, values greater than 24
were written in reverse/incorrect order when using
cbor_encode_uint64_prefix_bin().

To fix the issue, instead of completely ditching the fast-path,
let's leverage htons, htonl and my_htonll for 2, 4 and 8 bytes
value respectively (since the value length is known under the
function), as they are less expensive than writing the value 1
byte at a time.

Many thanks to Dragan Dosen and Martin Mirchev for having reported the
issue.

No backport needed.

4 days agoBUG/MEDIUM: xprt_qmux: apply the configured bidi streams limit on FE
Olivier Houchard [Thu, 19 Nov 2026 09:53:50 +0000 (10:53 +0100)]
BUG/MEDIUM: xprt_qmux: apply the configured bidi streams limit on FE

QMux frontends always advertise 100 bidirectional streams, ignoring
"tune.quic.fe.stream.max-concurrent" and "tune.quic.fe.stream.max-total"
which QUIC applies in quic_transport_params_init(). The MUX however
relies on the client never being allowed to open more than
stream.max-total streams: with a value below 100, releasing the first
remote stream hits BUG_ON(qcc->lfctl.ms_bidi > max) in
qcc_release_remote_stream(), so the process dies on the first completed
request on a "proto qmux" frontend.

Let's compute the frontend limit as QUIC does. The h3_clr QMux reg-test
now sets stream.max-total to cover this.

This was introduced in 3.4 by commit 497cabd9e ("MEDIUM: quic: implement
fe.stream.max-total"), which did not apply to the QMux transport
parameters. It must be backported to 3.4.

4 days agoBUG/MEDIUM: quic: do not spin on the accept tasklet of a blocked listener
Olivier Houchard [Thu, 19 Nov 2026 17:08:33 +0000 (18:08 +0100)]
BUG/MEDIUM: quic: do not spin on the accept tasklet of a blocked listener

Since commit 4377dbd75 ("BUG/MINOR: quic: Missing listener accept queue
tasklet wakeups") in 2.8-dev5, quic_accept_run() wakes itself up again as
long as connections remain in a listener's accept queue, so that those
beyond the maxaccept budget are accepted. But when the listener cannot
accept anymore, because it is full (bind maxconn) or limited (rate limit,
global maxconn), the tasklet runs in a loop and uses 100% of a thread
until the listener is resumed.

Let's only retry at once when the listener is still ready. Otherwise,
the accept tasklets of the threads with queued connections are woken up
when the listener is enabled again, and when it is unbound so that these
connections are refused.

This should be backported to all stable versions, with the previous
commit.

This was reported in GitHub issue #3578.

4 days agoBUG/MEDIUM: quic: refuse handshakes completed after the listener unbind
Olivier Houchard [Thu, 19 Nov 2026 17:00:34 +0000 (18:00 +0100)]
BUG/MEDIUM: quic: refuse handshakes completed after the listener unbind

QUIC connections are accepted once their handshake is complete. When a
soft-stop unbinds the listener in the meantime, the connection is still
queued, but listener_accept() does not call accept_conn() anymore on the
unbound receiver. The connection never gets its mux and the client waits
until its timeout, while the stopping process keeps it until its idle
timeout and quic_accept_run() wakes itself up in a loop, using 100% of a
thread.

Let's close such connections with a CONNECTION_REFUSED error instead,
when their handshake completes on an unbound listener, or when they are
still queued once it is unbound. The client gets the error right after
its handshake and the stopping process can leave.

This was introduced in 2.8 with the soft-stop support for connections
with their own socket, by commit fb375574f ("MINOR: quic: mark quic-conn
as jobs on socket allocation"). It should be backported to all stable
versions.

This was reported in GitHub issue #3578.

4 days agoBUG/MINOR: h3: reject interim responses ending the stream
Olivier Houchard [Thu, 19 Nov 2026 15:45:45 +0000 (16:45 +0100)]
BUG/MINOR: h3: reject interim responses ending the stream

On the backend side, a HEADERS frame carrying a 1xx status with the FIN
bit is converted into an interim response ending the message with the
EOM flag, which the H1 and H2 muxes never do. The stream forwards it as
an interim response and the client then gets a 502 once the end of the
stream is reported, while such a response is malformed since a final
response must follow an interim one.

Let's reject it as a malformed response with H3_ERR_MESSAGE_ERROR, as
the H2 mux does with an END_STREAM flag on a 1xx response, so the client
only gets a 502.

This was introduced with the backend side support by commit f79effa30
("MINOR: h3: convert HTTP/3 response into HTX for backend side support")
in 3.3-dev2, so it must be backported to 3.3.

4 days agoBUG/MINOR: hlua: reject interim responses in HTTP applets
Olivier Houchard [Thu, 19 Nov 2026 15:44:09 +0000 (16:44 +0100)]
BUG/MINOR: hlua: reject interim responses in HTTP applets

A Lua HTTP service may set a 1xx status. But it can only send one
response, so once the service returns, the interim response is ended
with the EOM flag, which the H1 and H2 muxes never do on a 1xx. The
stream forwards it as an interim response and, the applet being done,
produces a 502 while the interim response is still in the buffer. Since
commit 5fb43f017 ("MEDIUM: htx: Harden HTX API to avoid invalid uses
when EOM was reached") in 3.5-dev8, it crashes on
BUG_ON(htx_msg_ended(dst)). Before, the client got the interim response
followed by the 502.

Let's make start_response() raise a Lua error for interim responses
other than 101, so the service fails with a 500 as for any other error.
The documentation of set_status() was updated accordingly.

No backport needed.

4 days agoBUG/MINOR: hlua: wait for the request in HTTP applets
Olivier Houchard [Thu, 19 Nov 2026 13:51:19 +0000 (14:51 +0100)]
BUG/MINOR: hlua: wait for the request in HTTP applets

Since the HTTP applet uses its own buffers, it only waits for the input
buffer to be allocated before parsing the request, so it may run on an
empty buffer and crash on BUG_ON() when it is woken up before the request
was transferred, e.g. when the stream yields after the applet creation.

Let's wait for some input data instead, as the other HTTP applets do.

This was introduced by commit 48df877da ("MEDIUM: hlua: Update the http
applet to use its own buffers") in 3.3-dev4, so it must be backported to
3.3.

4 days agoMINOR: hlua: add our own safe coroutine.wrap() wrapper
Aurelien DARRAGON [Mon, 16 Nov 2026 11:08:09 +0000 (12:08 +0100)]
MINOR: hlua: add our own safe coroutine.wrap() wrapper

Similar to our coroutine.create() wrapper but for coroutine.wrap() which
returns the new function instead of the coroutine itself.

4 days agoBUG/MEDIUM: hlua: make coroutine.create() safe under haproxy (new attempt)
Aurelien DARRAGON [Mon, 16 Nov 2026 10:24:13 +0000 (11:24 +0100)]
BUG/MEDIUM: hlua: make coroutine.create() safe under haproxy (new attempt)

We got a report from Khaled Nassar that the current coroutine.create()
wrapper implementation that was introduced in 8cd620b4 ("MINOR: hlua:
safe coroutine.create()") is still not safe. Indeed, the fact that the
freshly created coroutine could outlive the ctx that created it (and is
thus bound to it) was overlooked.

This obviously causes undefined behavior ranging from UAF to potential
memory disclosures when the coroutine which outlives its parent ctx
still continues to reference the parent hlua which is destroyed.

As of today, Lua doesn't provide a way to forcefully kill a coroutine
or thread that we created. This means we don't have control over
user created coroutines which were instanciated using coroutine.create()

This is really bug-prone, so instead of allowing potentially unsafe usages
we refuse to create threads from sub contexts. This means
coroutine.create() may only be used from the main context (body / init)
where we know for sure that the context which created the thread will
outlive it.

If user is willing to do parallel work and the current coroutine.create()
is too restrictive, core.register_task() may come into play.

It may be backported to 2.8, although we may decide to change the hard
error into a warning to prevent existing scripts breakage, especially
if coroutine.create() was used wisely by ensuring the coroutine couldn't
outlive its parent context. The warning could give time to migrate to
more suitable API such as core.register_task().

Thanks to Khaled Nassar for having reported the issue.

4 days agoMINOR: ncbuf/test: define seed for random insert test
Amaury Denoyelle [Thu, 19 Nov 2026 13:43:06 +0000 (14:43 +0100)]
MINOR: ncbuf/test: define seed for random insert test

Previously, random seed was not set so random insert test would always
use the same offsets. Change this to use the machine timestamp to
generate different runs each time.

The seed is displayed during the test. It can also be forced via command
line argument '-j' to be able to replay a specific run.

4 days agoMINOR: ncbuf/test: define max iteration to random insert test
Amaury Denoyelle [Thu, 19 Nov 2026 13:41:26 +0000 (14:41 +0100)]
MINOR: ncbuf/test: define max iteration to random insert test

To ensure random insert test does not run for too long, specify a
maximum number of iteration. By default it is set to 10.000, which
is sufficient to fill a 16kB buffer. It can also be overriden on the
command-line using option '-i'.

4 days agoMINOR: ncbuf/test: extract random insert test in a dedicated function
Amaury Denoyelle [Thu, 19 Nov 2026 10:54:13 +0000 (11:54 +0100)]
MINOR: ncbuf/test: extract random insert test in a dedicated function

ncbuf modules provides a function for unit testing. One of the test is
the insertion of random offsets and then their removal. Extract this in
a dedicated test function for better readability.

4 days agoBUG/MINOR: ncbuf/test: remove unnecessary delay in random insert
Amaury Denoyelle [Thu, 19 Nov 2026 13:35:34 +0000 (14:35 +0100)]
BUG/MINOR: ncbuf/test: remove unnecessary delay in random insert

A delay is used for better readability when the buffer content is
displayed on each iteration during the random insert test.

However, this delay also applied when nothing was printed. This renders
the test artificially long. Thus, removes the delay when print is not
requested so that the test can run as fast as possible.

This should be backported up to 2.6.

4 days agoBUG/MINOR: ncbuf/test: remove list dependency for standalone tests
Amaury Denoyelle [Thu, 19 Nov 2026 10:50:50 +0000 (11:50 +0100)]
BUG/MINOR: ncbuf/test: remove list dependency for standalone tests

List dependency prevents compiling ncbuf module as a standalone unit to
execute unit tests. This was required for the random insertion test,
where each inserted offset is saved in a list.

Removes the list dependency and implements a simple single-linked list
for random offsets. This fixes compilation in standalone mode.

This should be backported up to 3.0.

4 days agoCLEANUP/MINOR: ncbmbuf: avoid noop memcpy when data ends on wrapping
Amaury Denoyelle [Thu, 19 Nov 2026 09:39:47 +0000 (10:39 +0100)]
CLEANUP/MINOR: ncbmbuf: avoid noop memcpy when data ends on wrapping

This patch is similar to the previous one applied to ncbuf. It changes
the comparison operator used against wrapping address during an add
operation, so that data fitting with the buffer end are inserted with a
single memcpy invocation.

4 days agoCLEANUP/MINOR: ncbuf: avoid noop memcpy when data ends on wrapping
Amaury Denoyelle [Thu, 19 Nov 2026 09:49:41 +0000 (10:49 +0100)]
CLEANUP/MINOR: ncbuf: avoid noop memcpy when data ends on wrapping

The ncbuf add operation implements support for wrapping in case the
newly inserted data exceeds the buffer end.

This operation is inefficient due to an excessive comparison, in case
the data just ends at the buffer boundary. Two memcpy are used, the
second one with a 0 length argument which is a noop.

Change the comparison to greater-than to select the single memcpy path.
The main objective of this patch is to clean up wrapping comparison and
avoid future incorrect code duplication.

4 days agoBUG/MINOR: quic: do not reject CRYPTO data exactly fitting in buffer
Amaury Denoyelle [Wed, 18 Nov 2026 15:50:24 +0000 (16:50 +0100)]
BUG/MINOR: quic: do not reject CRYPTO data exactly fitting in buffer

CRYPTO data buffering does not support wrapping of data. A BUG_ON()
ensures data never wraps during SSL read operations. This can never fire
as a similar comparison exists first in CRYPTO parsing to reject
wrapping content.

However, this code uses an incorrect greater-than-or-equal operator on
buffer wrapping. This incorrectly rejects CRYPTO content that exactly
fits in the receive buffer and closes connection. Fixes the comparison
operators so that CRYPTO data ending exactly at the buffer end can now
be normally handled.

This should be backported up to 2.6 after a period of observation.

4 days agoBUG/MEDIUM: http-ana: restore the purge of backend analyzers on applets
Christopher Faulet [Thu, 19 Nov 2026 09:30:00 +0000 (10:30 +0100)]
BUG/MEDIUM: http-ana: restore the purge of backend analyzers on applets

Commit 7568a0555 ("BUG/MINOR: http-ana: fix response compression for
applets") introduced a regression. It removed the purge of the request
analyzers performed when a request was intercepted by an applet, to only set
AN_REQ_HTTP_INNER. The idea was that http_process_request() called on
AN_REQ_HTTP_INNER configures all the analyzers needed to handle keep-alive
and compression on the HTTP response.

But doing so, some analyzers that were removed before the commit above,
remain attached. One of them, AN_REQ_SWITCHING_RULES, is responsible to set
a backend and all backend analyzers with it. So an request intercepted by an
applet in the frontend is still branched to a backend with its analyzers
armed. And they are evaluated against the intercepted request, as if it was
forwarded to the backend. Thus the http-request rules of the unassigned
backend are applied to the applet request. For instance, with a
"http-request deny" rule in the backend, a request intercepted by the
frontend stats applet is denied with a 403.

So the purge of the backend analyzers is restored, to only keep the
minimally required analyzers to handle keep-alive and compression on the
HTTP response. But, unlike the antique code from 1.5-dev24, the inner
processing is preserved: AN_REQ_HTTP_INNER is not removed by the purge
because it is needed to enable compression of the applet response when the
applet is branched from a backend.

No backport is needed.

5 days agoDOC: config: ungrpc does not support compressed messages
Frederic Lecaille [Thu, 19 Nov 2026 09:56:39 +0000 (10:56 +0100)]
DOC: config: ungrpc does not support compressed messages

They are skipped, so a field only present in such a message yields no
value. This was not documented.

5 days agoREGTESTS: protobuf: cover the gRPC message compression flag
Frederic Lecaille [Thu, 19 Nov 2026 09:53:40 +0000 (10:53 +0100)]
REGTESTS: protobuf: cover the gRPC message compression flag

Regression test for "BUG/MINOR: sample: do not parse compressed gRPC
messages in ungrpc".

Two bodies are added to the frontend which already walks a body of two
gRPC messages:

  - "01 00000005 0a03616161 00 00000002 1007" flags the first message
    compressed. Its payload must not be parsed, so x-g1 stays empty
    instead of reading "aaa". x-g2 must still find 7 in the second
    message, which checks the skip resumes on a message boundary.

  - "02 00000002 1007" sets an invalid flag, so the walk must stop and
    x-g2 must stay empty.

A failing expect aborts the script, so the second body is only observed
after the fix, not before it.

5 days agoBUG/MINOR: sample: do not parse compressed gRPC messages in ungrpc
Martin Mirchev [Wed, 18 Nov 2026 12:39:28 +0000 (20:39 +0800)]
BUG/MINOR: sample: do not parse compressed gRPC messages in ungrpc

sample_conv_ungrpc() skips the 5-byte gRPC message header without looking
at its Compressed-Flag byte, so a message whose payload is compressed
(flag 1) is handed to the protobuf parser as if it were plain protobuf,
and so is a message with an invalid flag value. A request body
"01 00 00 00 02 08 2a" (compressed flag, 2-byte payload) returns 42 from
"req.body,ungrpc(1,uint32)", exactly as the uncompressed one does, while
the real field value would only appear after decompression.

Skip compressed messages, as their payload cannot be parsed, and stop on
a flag other than 0 or 1 since the gRPC framing is then invalid.

This should be backported to all stable versions.

5 days agoBUG/MINOR: payload: also encode an absolute payload_lv offset2
Dinko Korunic [Wed, 18 Nov 2026 17:05:05 +0000 (18:05 +0100)]
BUG/MINOR: payload: also encode an absolute payload_lv offset2

Since commit bf65cd4d77 ("MAJOR: arg: converts uint and sint in sint")
in 1.6-dev3, the optional offset2 of payload_lv is stored as a single
SINT whose LSB indicates a relative offset and whose 63 MSB carry the
value, and smp_fetch_payload_lv() decodes it this way. But
val_payload_lv() only encodes relative values as "(v << 1) + 1" and
leaves absolute ones untouched. An absolute offset2 is thus read as half
of its value, and an odd one is even taken as a relative offset. With a
payload starting with "01 41 42 43 44 45":

    req.payload_lv(0,1,4)   returns 0x42 instead of 0x44
    req.payload_lv(0,1,5)   behaves like (0,1,+2), returns 0x43
                            instead of 0x45

This only affects which bytes are extracted: the resulting offset is
still checked against the buffer by the fetch function, so there is no
memory-safety impact. Configurations using an absolute offset2 were
silently reading from the wrong place and will now read from the
documented one.

Let's always encode offset2, adding the relative flag as the LSB. Relative
and implicit offsets are not affected.

This depends on the previous commit "BUG/MEDIUM: payload: reject
out-of-range payload and payload_lv arguments" for its context, and
should be backported to all supported versions along with it.

5 days agoBUG/MEDIUM: payload: reject out-of-range payload and payload_lv arguments
Dinko Korunic [Wed, 18 Nov 2026 17:05:04 +0000 (18:05 +0100)]
BUG/MEDIUM: payload: reject out-of-range payload and payload_lv arguments

The offsets and lengths taken by the payload and payload_lv sample fetch
families are parsed as 64-bit ARGT_SINT, but smp_fetch_payload() and
smp_fetch_payload_lv() store them into unsigned ints and perform their
bounds checks in 32 bits:

    if (buf_size > max || buf_offset + buf_size > max)

The payload, req.payload and res.payload keywords have no argument
validation at all, and val_payload_lv() only rejects a negative offset1
and a null length. A negative or oversized argument therefore becomes a
value close to 4G once truncated, the sum wraps, passes the checks, and
the fetch either returns a sample pointing about 4 GB past the buffer
(payload) or makes the length loop read past it (payload_lv, where a
negative length turns into a ~4G byte count). Each of these expressions
crashes the process the first time it is evaluated, for example from a
"tcp-request content" rule:

    req.payload(-1,1)
    req.payload(4294967295,1)
    req.payload_lv(1,-1)               (heap-buffer-overflow read)
    req.payload_lv(4294967295,1)
    req.payload_lv(0,1,+4294967290)    (once a converter reads the sample)

Lua is affected as well (e.g. txn.f:req_payload(-1,1)), since it relies
on the same validation callbacks. HTX streams are not affected because
the fetches return early there. The tcp-check path performs the same
arithmetic on check->bi.

Such an expression has to be written in the configuration, so this is not
a vulnerability per the threat model, but nothing warns about it, and once
it is present the first connection that reaches the rule crashes the
process.

This patch adds val_payload() for the payload family, which limits both
the offset and the length to [0, INT_MAX] (a null length still means "the
rest of the buffer"). val_payload_lv() now limits offset1 to [0, INT_MAX],
the length to [1, INT_MAX], the raw offset2 to [-2*INT_MAX, INT_MAX], and
the resulting relative offset to [0, INT_MAX]. INT_MAX is far beyond any
buffer size so no working configuration is affected, and with each term
bounded this way the sums computed by the fetch functions can no longer
wrap, so these functions are left untouched. Configurations that used
out-of-range values already crashed or never matched; they now fail to
load with an explicit error instead:

    invalid args in fetch method 'req.payload' : payload offset must be
    between 0 and 2147483647

Lua calls now raise an error instead of crashing.

This should be backported to all supported versions.

5 days agoREGTESTS: quic: undecryptable 0-RTT packets must not exhaust the Rx buffer
Frederic Lecaille [Wed, 18 Nov 2026 16:47:39 +0000 (17:47 +0100)]
REGTESTS: quic: undecryptable 0-RTT packets must not exhaust the Rx buffer

On a listener with "allow-0rtt", a 0-RTT packet whose header protection
cannot be removed is queued in the 0-RTT encryption level pqpkts list, with
a reference on the connection Rx buffer. That buffer is reclaimed in order
and stops at the first referenced packet, so a queued 0-RTT packet pins all
the data behind it. When no 0-RTT RX secret exists, because the early data
were rejected by the TLS stack or because the TLS library does not support
0-RTT, those packets can never be decrypted and are never released: past
about 64 kB, every packet of the connection is dropped until the idle
timeout.

The test completes a handshake, keeps the connection healthy with an HTTP/3
request, then injects 120 long header 0-RTT packets whose payload is
encrypted with keys haproxy does not know, which reproduces the state
reached when 0-RTT keys are absent. Dropped packets are counted as
dropped_pkt_bufoverrun, shown as dropbuff= by "show quic full", so the vtc
asserts through the CLI that this field does not appear: the Rx buffer was
not exhausted and the connection was not stalled.

It needs the Python client in reg-tests/quic/qclient, so it carries
'#REGTEST_EXTRA=qclient' and only runs when requested.

Covers 2335f9196.

5 days agoREGTESTS: quic: NEW_CONNECTION_ID must not reference a retired CID
Frederic Lecaille [Wed, 18 Nov 2026 16:45:37 +0000 (17:45 +0100)]
REGTESTS: quic: NEW_CONNECTION_ID must not reference a retired CID

A NEW_CONNECTION_ID frame stored pointers to the CID and the stateless
reset token of its quic_connection_id. RETIRE_CONNECTION_ID frees that
object at once, while a frame built for it may still be queued, in flight,
or duplicated later for a retransmission: it was then built from freed
memory.

Retiring sequence numbers 1 and 2 in the same packet is enough to reach
it: the second RETIRE frees the CID the first NEW_CONNECTION_ID frame
still points to. With the pool cache, the freed object is handed back to
the next CID of the same connection, so two frames carry the same CID,
which the client detects. Without it (ASan, DEBUG_DONT_SHARE_POOLS), freed
heap content is sent and the sanitizer reports a use-after-free.

The test drives a real handshake through the QUIC client in
reg-tests/quic/qclient, then retires both sequence numbers in one packet,
and checks two things: no duplicate CID is advertised for two different
sequence numbers, and the connection is closed with a transport error of
type PROTOCOL_VIOLATION, as RFC 9000 19.16 requires for a sequence number
that was never sent. A crash instead of the CONNECTION_CLOSE frame leaves
the test waiting, which also fails it.

It needs the Python client, so it carries '#REGTEST_EXTRA=qclient' and
only runs when requested.

Covers 827354038 and a50bb45ba.

5 days agoREGTESTS: quic: backend must drop packets with an unsupported version
Frederic Lecaille [Wed, 18 Nov 2026 16:39:29 +0000 (17:39 +0100)]
REGTESTS: quic: backend must drop packets with an unsupported version

On backend connections, quic_rx_pkt_parse() accepts long header packets
carrying an unsupported version, since the version checks only apply to
listeners. Such packets keep QUIC_PACKET_TYPE_UNKNOWN, which maps to no
encryption level, and reach BUG_ON(!qel || !pktns) in qc_enc_level_alloc()
from qc_try_rm_hp().

A server which does not support the negotiated version answers with a
Version Negotiation packet (RFC 9000 6.1), so no malicious peer is needed.

The test starts a socket that replies to the Initial with a long header
packet using an unsupported version, and checks that the request fails with
a 503 instead of killing the process. It needs no helper beyond python3, so
it carries no #REGTEST_EXTRA directive.

Covers f12c7c7d9.

5 days agoREGTESTS: quic: add a Python QUIC client
Frederic Lecaille [Wed, 18 Nov 2026 16:36:19 +0000 (17:36 +0100)]
REGTESTS: quic: add a Python QUIC client

Replaying some QUIC bugs requires a peer that completes a handshake and
then sends specific frames. Hand-crafted datagrams cannot do that.

Add a minimal QUIC v1 + TLS 1.3 + HTTP/3 client in reg-tests/quic/qclient:

  - qcrypto.py: RFC 9001 packet protection (HKDF, initial keys, varints,
    long and short header protection).

  - qclient.py: a QClient object over a real socket, with the received
    frames exposed. Hooks on the send and handshake paths let a caller
    alter packets, and the helpers cover key updates, connection migration
    and HTTP/3 requests, so tests can drive whatever scenario they need.

Both need the 'cryptography' package. Tests using them will carry
'#REGTEST_EXTRA=qclient' and run only when requested.

5 days agoMINOR: reg-tests: add --extra to run tests needing optional tools
Frederic Lecaille [Wed, 18 Nov 2026 16:30:52 +0000 (17:30 +0100)]
MINOR: reg-tests: add --extra to run tests needing optional tools

Some VTC files need helper programs that are not built with HAProxy, such
as the Python QUIC client in reg-tests/quic/qclient/. They cannot simply be
typed 'slow' or 'devel' instead: their type says what they check, and the CI
jobs select tests by type.

Add a new --extra option to run-regtests.sh. A VTC file declares the helper
it needs:

    #REGTEST_EXTRA=qclient

and is skipped unless that name is listed in the --extra option. From the
Makefile, options are passed after '--':

    $ make reg-tests -- --extra qclient

The filter only adds tests: files without the directive, and the selection
made by --type/REGTESTS_TYPES, are unchanged.

Not to be backported: this is development tooling.

5 days agoBUG/MEDIUM: mux-quic: cap elastic MAX_STREAMS to stream.max-total
Olivier Houchard [Wed, 18 Nov 2026 16:41:03 +0000 (17:41 +0100)]
BUG/MEDIUM: mux-quic: cap elastic MAX_STREAMS to stream.max-total

With "tune.streams-elasticity", qcc_release_remote_stream() grants as
MAX_STREAMS increment the difference between the elastic limit and the
streams still usable by the peer. Unlike the static path, nothing caps
the new limit to "tune.quic.fe.stream.max-total". If the window was
reduced under load and the load then drops, the increment computed close
to the end of the connection may exceed the remaining streams, and the
next released stream hits BUG_ON(qcc->lfctl.ms_bidi > max).

Let's cap the increment to the remaining streams. It is still at least 1
since ms_bidi is below max there.

This was introduced by commit e139dd90e ("MAJOR: mux_quic: support
stream elasticity during connection lifetime") in 3.4-dev13 and must be
backported to 3.4.

5 days agoBUG/MEDIUM: quic: never advertise more streams than configured
Olivier Houchard [Wed, 18 Nov 2026 16:52:44 +0000 (17:52 +0100)]
BUG/MEDIUM: quic: never advertise more streams than configured

With "tune.streams-elasticity", the initial max-streams-bidi transport
parameter is set to conn_calc_max_streams() of the configured limit,
i.e. the lowest of "tune.quic.fe.stream.max-concurrent" and
"tune.quic.fe.stream.max-total". But this function may return more than
the value it is passed, as it also considers the share of the extra
streams budget left for each remaining connection, which does not depend
on it: with "tune.streams-elasticity 1000", it returns 10 at low load.

When "tune.quic.fe.stream.max-total" is lower than this, releasing the
first remote stream hits BUG_ON(qcc->lfctl.ms_bidi > max) in
qcc_release_remote_stream(), so the process dies on the first completed
request.

Let's not advertise more than the configured limit. The stream_max_total
reg-test now enables stream elasticity to cover this.

This was introduced by commit d21ec4c70 ("MINOR: quic: use stream
elasticity value for initial advertisement") in 3.4-dev13 and must be
backported to 3.4.

5 days agoBUG/MINOR: mux-quic: fix QMux Rx buffer leak on MUX init failure
Olivier Houchard [Wed, 18 Nov 2026 15:55:27 +0000 (16:55 +0100)]
BUG/MINOR: mux-quic: fix QMux Rx buffer leak on MUX init failure

On QMux, qcm_init() takes over the Rx buffer of the xprt layer. When it
fails later, its error path resets qcc->conn before calling
qcc_release(), which only releases the QMux connection buffers when a
connection is attached, so the Rx buffer is leaked. A client connecting
with TLS but without ALPN to a "proto qmux" listener makes
qcc_install_app_ops() fail and leaks one buffer per connection.

Let's release the QMux Rx buffer in the qcm_init() error path, where the
connection type is still known. The Tx one cannot be allocated yet.

This was introduced in 3.4 by commit 81f22cd68 ("MINOR: mux-quic: define
Rx connection buffer for QMux") and must be backported to 3.4.

5 days ago[RELEASE] Released version 3.5-dev13 v3.5-dev13
Willy Tarreau [Wed, 18 Nov 2026 15:58:50 +0000 (16:58 +0100)]
[RELEASE] Released version 3.5-dev13

Released version 3.5-dev13 with the following main changes :
    - BUG/MINOR: tcpcheck: fix out-of-bounds reads on short MySQL error packets
    - BUG/MEDIUM: mux-h2: put BE conn back in idle list after deferred shut
    - BUG/MEDIUM: mux-spop: do not enforce the timeout on connections with streams
    - MINOR: mux-spop: ignore conn->owner when deciding if a connection is dead
    - BUG/MEDIUM: mux-spop: refresh the connection timeout before parking it idle
    - MINOR: mux-spop: don't add a closing connection to an idle list on detach
    - BUG/MEDIUM: mux-fcgi: put BE conn back in idle list after deferred shut
    - BUG/MAJOR: cache: do not mix variants varying on different headers
    - BUG/MEDIUM: cache: fix "show cache" crash/skip with several caches
    - BUG/MEDIUM: cache: do not create a second applet when two cache-use rules hit
    - BUG/MEDIUM: cache: forbid cache rules in defaults sections
    - BUG/MEDIUM: filters: order the implicit filters around the explicit ones
    - BUG/MINOR: cache: do not refuse to store responses with "Age: 0"
    - BUG/MINOR: cache: do not remove the Age header from the forwarded response
    - BUG/MINOR: cache: recognize null qvalues with decimals in Accept-Encoding
    - BUG/MINOR: cache: do not eat the request while waiting for a buffer
    - BUG/MINOR: cache: reduce the max-age lifetime by the response's Age
    - BUG/MINOR: cache: compare the Age to the heuristic lifetime when none is given
    - BUG/MINOR: cache: do not ignore null lifetimes not written as "max-age=0"
    - REGTESTS: cache: cover the object lifetime with a single script
    - BUG/MINOR: quic: fix ACK_ECN parsing after optional ack ranges
    - BUG/MINOR: qmux: remove invalid BUG_ON() on empty record
    - BUG/MINOR: init: fix missing error on no listener on config check
    - BUG/MEDIUM: fd: Mark a fd as dead on early close
    - BUG/MEDIUM: mux-h1: Report EOS when a demux error is handled by the app layer
    - BUG/MINOR: cache: skip already resolved filters when resolving caches
    - BUG/MINOR: quic: remove CID on BE conn alloc failure
    - BUG/MINOR: h3: prevent missing request FIN on empty trailers
    - BUG/MINOR: sample: fix host_only and port_only on empty input
    - BUG/MINOR: sample: reject a \0 byte in raw string fetches
    - BUG/MINOR: http-ana: don't emit a network-path Location for a "/" redirect prefix
    - BUG/MINOR: log: don't let an LF in a forwarded message create new events
    - BUG/MEDIUM: mux_quic: fix Rx flow control increment on RESET_STREAM
    - OPTIM: lb-chash: don't look for more servers when there is only one
    - OPTIM: lb-chash: limit the scan to few consecutive nodes
    - MEDIUM: backend: avoid picking the same server twice in random draws
    - DOC: config: explain the effect of the weights on random's draws
    - IMPORT: slz: update slz to 1.4-dev5-24
    - MINOR: compression: pass COMP_CT_EVENT to the algorithms for server-sent events
    - MINOR: compression: add tune.comp.res.ring to disable the rings of responses
    - MEDIUM: compression/slz: use the event content type for server-sent events
    - DEV: sse-latency: add a parameter after the content-type
    - MINOR: http-ana: also match text/event-stream with trailing parameters
    - BUG/MINOR: h3: skip content-length check on backend bodyless responses
    - BUG/MINOR: h3: reject CANCEL_PUSH on backend side
    - MINOR: h3: reject malformed push frames
    - BUG/MEDIUM: sample: parse json_query integers within the token length
    - BUG/MINOR: mjson: bound the exponent in mystrtod()
    - BUG/MEDIUM: stick-tables: compute the shard of string keys on the stored key
    - BUG/MINOR: hq-interop: skip zero-copy with large buffers
    - BUG/MINOR: hq-interop: ignore uni streams in HTTP/0.9
    - BUG/MINOR: hq-interop: drop data after request
    - REGTESTS: http-messaging: Fix abortonclose issue with connect_tunnels
    - REGTESTS: http-messaging: Properly handle WINDOW_UPDATEs with connect_tunnels
    - BUG/MEDIUM: quic: do not keep 0-RTT packets which cannot be decrypted
    - BUG/MEDIUM: quic-be: keep the source port range of a closing backend connection
    - BUG/MINOR: quic-be: do not register the connection before the quic_conn is initialized
    - BUG/MINOR: quic: initialize the members read by quic_conn_release() first
    - BUG/MINOR: debug: Do not allocate context when we don't need one
    - DEV: h2: add h2dec, a raw HTTP/2 frame decoder
    - DEV: h2: add mkhdr.c, a C port of mkhdr.sh
    - DEV: h2: mkhdr: add -n to repeat the emitted frames
    - DEV: h2: mkhdr: support stream ID ranges with -i
    - DEV: h2: mkhdr: support "--" as a delimiter between frame descriptions
    - MINOR: ssl: add alpn_remove_token() to drop a protocol from an ALPN string
    - MINOR: global: add tune.options2 to host new GTUNE2_* flags
    - MINOR: global: add tune.h2.fe.enabled to disable HTTP/2 on frontends
    - MINOR: sample: add h2_enabled to report whether H2 may be used on frontends
    - REGTEST: ssl: test tune.h2.fe.enabled and h2_enabled on two instances
    - IMPORT: slz-prv: work around lobotomized compilers' fallthrough diagnostics
    - MINOR: sample: add smp_prepare_out() to prepare an output buffer
    - OPTIM: sample: use smp_prepare_out() in the lower and upper converters
    - MINOR: sample: add a "tr" converter
    - BUG/MINOR: http/hardening: free the new profile on strdup() failure
    - BUG/MEDIUM: stick-tables/cli: "set table" without key must not clear the table
    - BUG/MEDIUM: peers: make the soft-stop "dont_stop" state per peers section
    - BUG/MEDIUM: htx: never merge the next DATA block into the referenced one on defrag
    - BUG/MEDIUM: flt-decomp: don't expose EOM before the end of decompression
    - REGTESTS: decompression: test a large decompressed Content-Length response
    - BUG/MEDIUM: mux-h2: don't abort a tunnel attempt on interim responses
    - REGTESTS: http-messaging: check that 1xx don't abort H2 backend tunnels
    - REGTESTS: decompression: don't use yes(1) in http_large_cl
    - BUG/MEDIUM: dns: release the session slot of expired TCP queries
    - BUG/MAJOR: buf: make the shift distance check less strict in b_move()
    - BUG/MAJOR: mux-h2: fail on impossible data transfers in rcv_buf()
    - BUG/MAJOR: h3: do not panic on HTX_FL_PARSING_ERROR after htx_xfer()
    - BUG/MAJOR: mux-quic: fail on impossible data transfers in rcv_buf()
    - Revert "BUG/MINOR: h3: fix missing EOM after trailers without FIN"
    - CI: github: include WolfSSL version in job name
    - CI: github: test WolfSSL with and without debugging
    - Revert "MINOR: http: add <need_eot> to trailers parsing function"
    - CI: github: restrict WolfSSL sanitizer flags to debug jobs
    - BUG/MINOR: ssl: exclude wolfSSL from custom extension support
    - BUG/MEDIUM: stream: keep channel_auto_close() on the request error path
    - REGTESTS: http-messaging: send h1_big_chunk_size_line request at once
    - BUG/MINOR: checks: only trigger a DNS resolution with the resolvers lock
    - BUG/MINOR: dns: detect the server's shutdown on a partial TCP response
    - SCRIPTS: vtest: allow overriding the Git repository URL
    - BUG/MINOR: map: split "add map/acl" payload keys on line breaks
    - CI: github: use haproxytech/VTest2 for regression tests
    - BUG/MEDIUM: peers: bound stick-table update messages
    - BUG/MEDIUM: peers: bound stick-table switch messages
    - BUG/MINOR: peers: bound stick-table acknowledge messages
    - CLEANUP: peers: remove the unused intencode()
    - BUG/MINOR: quic/ssl: report SSL_CTX allocation failure
    - MINOR: peers: move message length constants to peers-t.h
    - BUG/MEDIUM: stick-table: fix the peers overhead in proto_size
    - BUG/MEDIUM: peers: trim received string keys to fit in a buffer

5 days agoBUG/MEDIUM: peers: trim received string keys to fit in a buffer
Olivier Houchard [Wed, 18 Nov 2026 10:02:39 +0000 (11:02 +0100)]
BUG/MEDIUM: peers: trim received string keys to fit in a buffer

Commit b224f63c1 ("BUG/MEDIUM: stick-table: restrict key sizes to what
fits in a buffer") trims string keys in stksess_setkey() so that the
update message fits in a buffer, but string keys received from a peer
are copied directly and only bounded by the table's key size. A peer
with a larger bufsize, or a forged message, can thus store a key which
cannot be encoded when it is later taught to another peer. Since commit
ef4405d67 ("BUG/MEDIUM: peers: bound stick-table update messages") this
does not overflow the trash buffer anymore, but the peer session is
closed and reopened in loop and the resync never completes, as reported
in GitHub issue #3576.

Let's apply the same trimming on the receive path. This must be
backported wherever b224f63c1 was.

5 days agoBUG/MEDIUM: stick-table: fix the peers overhead in proto_size
Olivier Houchard [Wed, 18 Nov 2026 10:07:58 +0000 (11:07 +0100)]
BUG/MEDIUM: stick-table: fix the peers overhead in proto_size

proto_size accounts for 11 bytes of encapsulation, but update messages
are built in place with the header, room for the encoded length, the
update id and the expiration date, plus the string key length. String
keys trimmed to fit the estimate, such as a large header tracked on a
table whose len is close to or above bufsize, thus never fit an update
message, and neither do binary keys of a table accepted at the limit by
the config check. Since commit ef4405d67 ("BUG/MEDIUM: peers: bound
stick-table update messages") this does not overflow the trash buffer
anymore, but the peer session is closed and reopened in loop and the
resync never completes. See GitHub issue #3576.

Let's count the real overhead. This was brought by commit 858263591
("MINOR: stick-table: calculate the on-wire size of each key") and must
be backported wherever it was, along with previous commit "MINOR: peers:
move message length constants to peers-t.h".

5 days agoMINOR: peers: move message length constants to peers-t.h
Olivier Houchard [Wed, 18 Nov 2026 10:07:49 +0000 (11:07 +0100)]
MINOR: peers: move message length constants to peers-t.h

PEER_MSG_HEADER_LEN and PEER_MSG_ENC_LENGTH_MAXLEN are needed by the
stick-table code to estimate the size of update messages, so let's
move them out of peers.c.

This is needed by the next commit, so it must be backported along with
it.

5 days agoBUG/MINOR: quic/ssl: report SSL_CTX allocation failure
Frederic Lecaille [Wed, 18 Nov 2026 14:36:42 +0000 (15:36 +0100)]
BUG/MINOR: quic/ssl: report SSL_CTX allocation failure

ssl_quic_initial_ctx() stores the result of SSL_CTX_new() into
bind_conf->initial_ctx without checking it, unlike ssl_sock_initial_ctx()
which alerts and returns an error. On allocation failure the QUIC bind
therefore crashed without any diagnostic.

Report the failure the same way the TCP path does.

Must be backported to all stable versions.