Skip to content

Reset the CONNECT stream with H3_MESSAGE_ERROR on an over-long or non-UTF-8 WT_CLOSE_SESSION error message (§6) #316

Description

@tomholford

draft-ietf-webtrans-http3-15 §6:

If the Application Error Message exceeds 1024 bytes or is not valid UTF-8, the receiver MUST reset the stream with code H3_MESSAGE_ERROR.

Today: parseCloseSessionCapsule (capsule.go) reads the message via io.ReadAll(io.LimitReader(r, maxCloseCapsuleErrorMsgLen)) — it silently truncates at 1024 bytes and never validates UTF-8, so neither violation triggers a reset.

(The trailing-data fix in #313 incidentally catches an over-1024-byte message via leftover capsule-body bytes read as trailing data, but invalid UTF-8 within ≤1024 bytes is still accepted.)

Fix: have parseCloseSessionCapsule reject len(msg) > 1024 or !utf8.Valid(msg) and route it to a reset with H3_MESSAGE_ERROR.

Split out of #265 (draft-15 compliance follow-ups); follow-up to #313.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions