Skip to content

Treat RST_STREAM with wrong payload size as a connection error - #1128

Closed
arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:rfc9113-rst-frame-size-error
Closed

arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:rfc9113-rst-frame-size-error

Conversation

@arturobernalg

@arturobernalg arturobernalg commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

RFC 9113, section 6.4 requires that a RST_STREAM frame whose length is other than 4 octets be treated as a connection error of type FRAME_SIZE_ERROR. The previous FrameType declaration set payloadErrorFatal to false for RST, which caused the frame-size check in FrameType.check() to throw a StreamException (stream error) instead of a ConnectionException (connection error). As a result, Tomcat replied with a RST_STREAM rather than a GOAWAY frame.

Fix: set payloadErrorFatal to true for FrameType.RST so that an oversized or undersized RST_STREAM payload always triggers a GOAWAY.

Update TestHttp2Section_6_4#testResetFrameWrongLength to assert the correct GOAWAY response with error code FRAME_SIZE_ERROR.

RFC 9113, section 6.4 requires that a RST_STREAM frame whose length is
other than 4 octets be treated as a connection error of type
FRAME_SIZE_ERROR. The previous FrameType declaration set
payloadErrorFatal to false for RST, which caused the frame-size check
in FrameType.check() to throw a StreamException (stream error) instead
of a ConnectionException (connection error). As a result, Tomcat replied
with a RST_STREAM rather than a GOAWAY frame.

Fix: set payloadErrorFatal to true for FrameType.RST so that an
oversized or undersized RST_STREAM payload always triggers a GOAWAY.

Update TestHttp2Section_6_4#testResetFrameWrongLength to assert the
correct GOAWAY response with error code FRAME_SIZE_ERROR.
@arturobernalg
arturobernalg force-pushed the rfc9113-rst-frame-size-error branch from e0b5090 to f4f543c Compare October 29, 2026 13:38
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.

1 participant