GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 100 Continue consumes HttpServerCodec's request-method entry, desynchronising later responses on the connection · Issue #199 · azholdaspaev/netty-loom-spring

100 Continue consumes HttpServerCodec's request-method entry, desynchronising later responses on the connection #199

New issue
Copy link
New issue
Copy link
Closed
#443
Closed
100 Continue consumes HttpServerCodec's request-method entry, desynchronising later responses on the connection#199
#443
Copy link
Labels
area/transportNetty transport/protocolbugSomething isn't workingpriority/P2Polish / nice-to-have
Milestone
0.2.0 — Operational hardening

Description

@azholdaspaev
azholdaspaev
opened on Aug 30, 2026
Issue body actions

Summary

Found while reviewing #196; deliberately left out of that PR because the previous aggregator also wrote 100 Continue through the same codec. This is not a regression from streaming.

Verified against repository commit aee97f895640f6a38d0b829472feb9d9fe0ff530 and the Netty 4.2.12.Final sources jar. The shared version catalog still selects that affected release.

HttpServerCodec queues one method per decoded request, but removes one method for every encoded response, including informational responses:

method = queue.poll();
return HttpMethod.HEAD.equals(method) || super.isContentAlwaysEmpty(msg);

An interim response must leave the request's entry available for its final response. The unconditional poll instead lets that final response use the next request's method, or null when the queue is empty.

Impact

For the POST/HEAD failure, HEAD must be decoded before the encoder starts the final POST response:

POST headers with Expect: 100-continue   methods = [POST]
100 Continue encoded                    methods = []
POST body followed by HEAD decoded      methods = [HEAD]
POST's final 200 encoded                 polls HEAD; suppresses POST body

HttpPipeliningHandler preserves dispatch and response order, but cannot prevent this: the codec records HEAD before the gate holds that request pending.

  • With a chunked POST response, the body and terminating chunk disappear while Transfer-Encoding: chunked remains.
  • With a buffered POST response, the body disappears while the declared Content-Length remains.
  • If the next decoded request is CONNECT, a successful POST response can incorrectly lose Transfer-Encoding while retaining chunk framing.

These are response-framing failures on a keep-alive connection. A client can wait for missing bytes, consume the next response as body data, or reject its status line as an invalid chunk size. Exploitability as request smuggling has not been established.

The shift is not necessarily permanent: sequential traffic recovers when the final response polls an empty queue before the next request is decoded. The underlying defect also affects other 1xx statuses, and an interim response to HEAD can remove the method needed to suppress its final response's body.

Fix notes

Recommended resolution: update the shared Netty version from 4.2.12.Final to 4.2.17.Final, the first fixed release in the 4.2 line. Update gradle/libs.versions.toml so transport, codec, handler and native transport dependencies move together.

Upstream netty/netty#17182 adds the INFORMATIONAL guard before polling the request-method queue. The fix is included in Netty 4.2.17.Final, released on 2026-08-04. It delegates informational responses to the base encoder, preserving its special handling of 101; protocol upgrade removes the codec and its remaining queue.

Use the released upstream fix rather than a local workaround, because it repairs the queue where Netty owns it and covers both buffered and streamed encoding. Reflection-based queue repair, a custom codec and informational-response bypass handlers are outside this task.

Validation required before closing:

  • POST bodies reach the wire after 100 Continue even when HEAD or CONNECT is already decoded; chunked framing and declared content lengths remain correct.
  • The final HEAD response has no body, sequential keep-alive traffic remains correct, and informational responses remain observable on the wire.
  • Regression tests exercise the real HttpServerCodec; they fail on 4.2.12.Final and pass on the selected fixed version.
  • Verify resolved Netty versions in core, starter and the Netty example, including dependency-management overrides; all Netty modules use the selected version.
  • Run ./gradlew build and the published-consumer smoke gate described in docs/publishing.md; both CI platform cells pass before merge.

Pointers

  • gradle/libs.versions.toml:6 — shared Netty version to update.
  • netty-loom-spring-core/build.gradle.kts:9-18 — Netty dependencies using the shared version, including native classifier variants.
  • netty-loom-spring-boot-starter/src/main/java/io/github/azholdaspaev/nettyloomspring/autoconfigure/NettyLoomAutoConfiguration.java:123-138 — codec precedes the pipelining gate and body-limit handler.
  • netty-loom-spring-core/src/main/java/io/github/azholdaspaev/nettyloomspring/core/handler/HttpRequestBodyLimitHandler.java:84-89 — writes the full 100 Continue response.
  • netty-loom-spring-core/src/test/java/io/github/azholdaspaev/nettyloomspring/core/handler/HttpRequestBodyLimitHandlerTest.java:198-199 — existing fixture omits the codec and cannot detect this defect.
  • Affected Netty encoder and fixed encoder.

TDD entry point

HttpRequestBodyLimitHandlerTest#shouldPreservePostBodyAfterContinueBeforePipelinedHead

Before upgrading, add a failing wire-level test using an EmbeddedChannel with the real codec, pipelining gate and body-limit handler. Send POST headers with Expect: 100-continue, assert the encoded invitation, then send the body and HEAD together before writing the final POST response. Assert the POST body and chunk terminator reach the wire, and the final HEAD response has no body.

Cover both a streamed chunked response and a buffered response with Content-Length, plus the CONNECT framing case and sequential traffic. Apply the version update only after establishing the failing test. Reverting the version to 4.2.12.Final must reproduce the missing POST body.

Activity

  1. azholdaspaev
    added this to the 0.2.0 — Operational hardening milestone on Aug 30, 2026
  2. azholdaspaev
    added
    bugSomething isn't working
    priority/P2Polish / nice-to-have
    area/transportNetty transport/protocol
    on Aug 30, 2026
  3. azholdaspaev
    added 5 commits that reference this issue on Oct 7, 2026

    NL-199 Name the framing tests in the pipelining test javadoc

    This issue will close once commit d42c5a6 is merged into the 'main' branch.
    d42c5a6

    NL-199 Show the Netty BOM import for a Maven build without Boot's parent

    This issue will close once commit 27fbdc4 is merged into the 'main' branch.
    27fbdc4

    NL-199 Build against Netty 4.2.19 so 100 Continue keeps responses framed

    This issue will close once commit 69e0971 is merged into the 'main' branch.
    69e0971

    NL-199 Name the framing tests in the pipelining test javadoc

    This issue will close once commit 450165d is merged into the 'main' branch.
    450165d

    NL-199 Show the Netty BOM import for a Maven build without Boot's parent

    This issue will close once commit 02d45f0 is merged into the 'main' branch.
    02d45f0
  4. azholdaspaev
    closed this as completedin #443on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/transportNetty transport/protocolbugSomething isn't workingpriority/P2Polish / nice-to-have

    Type

    No type

    Projects

    No projects

      Milestone

      • 0.2.0 — Operational hardeningNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.