Skip to content

Treat interleaved non-CONTINUATION frame on same stream as PROTOCOL_ERROR - #1132

Open
arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:rfc9113-header-block-interleaved-frame
Open

arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:rfc9113-header-block-interleaved-frame

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

RFC 9113, section 4.3 states:

An endpoint that receives any frame other than CONTINUATION while receiving a header block MUST treat that as a connection error (Section 5.4.1) of type PROTOCOL_ERROR.

Http2Parser.validateFrame() threw a connection error of type COMPRESSION_ERROR when a non-CONTINUATION, non-RST_STREAM frame arrived on the same stream as an open header block. The correct error code per the RFC is PROTOCOL_ERROR.

Fix: change the error code from COMPRESSION_ERROR to PROTOCOL_ERROR in the wrongFrameType branch of validateFrame().

Add TestHttp2Section_4_3#testHeaderContinuationInterleavedDataSameStream to prove the violation (sends a DATA frame on the same stream while a header block is in progress) and verify the fix.

…RROR

RFC 9113, section 4.3 states that any frame other than CONTINUATION
received while a header block is in progress MUST be treated as a
connection error of type PROTOCOL_ERROR.

Http2Parser.validateFrame() was using COMPRESSION_ERROR for this case
when the offending frame arrived on the same stream as the open header
block. Changed the error code to PROTOCOL_ERROR to match the RFC.

Add TestHttp2Section_4_3#testHeaderContinuationInterleavedDataSameStream
to prove the violation and verify the fix.
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