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.
draft-ietf-webtrans-http3-15 §6:
Today:
parseCloseSessionCapsule(capsule.go) reads the message viaio.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
parseCloseSessionCapsulerejectlen(msg) > 1024or!utf8.Valid(msg)and route it to a reset withH3_MESSAGE_ERROR.Split out of #265 (draft-15 compliance follow-ups); follow-up to #313.