Skip to content

SSE: bound the line length and the event size - #919

Merged
arturobernalg merged 5 commits into
apache:masterfrom
arturobernalg:sse-bound-line-and-event
Nov 2, 2026
Merged

arturobernalg merged 5 commits into
apache:masterfrom
arturobernalg:sse-bound-line-and-event

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

The parser accumulated an unterminated line, or data: lines without a blank line, without any limit, so a misbehaving server could exhaust the heap. Reproduced with a single unterminated line: OutOfMemoryError after 64 MiB with -Xmx256m.

EventSourceConfig now has maxLineLength (1 MiB) and maxEventSize (8 MiB). When a limit is exceeded the stream fails with MessageConstraintException, reported through the listener failure callback, and its buffers are released. Values <= 0 are rejected.

Tests added for both parsers. A failed stream may reconnect under the usual backoff.

ok2c and others added 5 commits October 31, 2026 14:53
…be executed manually during release preparation due to those tests failing intermittently in CI
Since the default verifier fallback was removed, CLIENT or BOTH policy
with a null HostnameVerifier performed no hostname verification at all.
ConscryptClientTlsStrategy and the deprecated DefaultClientTlsStrategy
constructor now select the BUILTIN policy when no verifier is given, and
AbstractClientTlsStrategy rejects CLIENT or BOTH without a verifier.
Once the CONNECT tunnel is established a 407 comes from the origin. It
was evaluated against the proxy auth exchange, which failed with a
NullPointerException or IllegalStateException. The response is now
returned to the caller as is.
The target name was passed as the endpoint name when connecting to the
first hop, so the proxy certificate was verified against, and the SNI
set to, the target virtual host instead of the proxy. The target name is
now used only when upgrading to TLS for the target.
The parser accumulated an unterminated line, or data lines without a
blank line, without any limit, so a misbehaving server could exhaust the
heap. EventSourceConfig now has maxLineLength (1 MiB) and maxEventSize
(8 MiB). When a limit is exceeded the stream fails with
MessageConstraintException and its buffers are released.
@arturobernalg
arturobernalg requested a review from ok2c November 1, 2026 11:43
@arturobernalg
arturobernalg merged commit 42e82fe into apache:master Nov 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants