[quicwg/base-drafts] Signal error upon receipt of multiple trailing HEADERS (#2858)

Bence Béky <notifications@github.com> Fri, 28 June 2019 14:59 UTC

Return-Path: <noreply@github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AB1D012033B for <quic-issues@ietfa.amsl.com>; Fri, 28 Jun 2019 07:59:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.998
X-Spam-Level:
X-Spam-Status: No, score=-7.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FROM_EXCESS_BASE64=0.001, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z9CqdC8VVXH4 for <quic-issues@ietfa.amsl.com>; Fri, 28 Jun 2019 07:59:17 -0700 (PDT)
Received: from out-7.smtp.github.com (out-7.smtp.github.com [192.30.252.198]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5B2EB120343 for <quic-issues@ietf.org>; Fri, 28 Jun 2019 07:58:59 -0700 (PDT)
Date: Fri, 28 Jun 2019 07:58:57 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1561733938; bh=+w92L+lqQcSP0dak+xrZnleWsB2soU9vxts4E+EFbRk=; h=Date:From:Reply-To:To:Cc:Subject:List-ID:List-Archive:List-Post: List-Unsubscribe:From; b=VMRJGEiL9f3NvoCjRJb7LZVKPHDTTFxt+FcG6vWEdgpV7K3MjLzFUup+/8nqW2nWw 4bSaqtGZa+aKWBnRhkHrFHAVEdHQmDV/sO99NmarDStIQ9VzHQjWjDeI1vTXGnh7Xc EC0KFkRmUENFugnU+X5QS5lLrLOvM99cQn9UuQQc=
From: Bence Béky <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+AFTOJK7ZLXIHNLMSQHWY3AF3ENO3DEVBNHHBXCVYSE@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/issues/2858@github.com>
Subject: [quicwg/base-drafts] Signal error upon receipt of multiple trailing HEADERS (#2858)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5d162b31e50e9_66e13fe9952cd96827189b"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: bencebeky
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/dR2PUyTAFkhHVfoDPulWxZdckbU>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.29
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Jun 2019 14:59:20 -0000

According to https://quicwg.org/base-drafts/draft-ietf-quic-http.html#request-response, a  bidirectional HTTP stream can have at least one HEADERS frame (exactly one if the stream is client-initiated), zero or more DATA frames, then zero or one HEADERS frame, in this order.  Handling the receipt of frames that does not conform to this requirement is inconsistent:

(1) If a DATA frame is received before any other frame, that's an error:
> If a DATA frame is received before a HEADERS frame [...], the recipient MUST respond with a connection error of type HTTP_UNEXPECTED_FRAME [...].

(2) If the trailing HEADERS frame is followed by another HEADERS frame, that is to be discarded:
> Trailing header fields are carried in an additional HEADERS frame following the body. Senders MUST send only one HEADERS frame in the trailers section; receivers MUST discard any subsequent HEADERS frames.

(3) There is no guidance on how to handle a DATA frame after the trailing headers.

I suggest that every violation to this requirement should be an error.  (I do not feel strongly whether a connection error like (1) is handled right now, or a stream error.  The implementation I am contributing to will promote most stream errors to connection errors regardless.)

Note that (2) comes from the technical limitation that header blocks needed to be processed, which is not the case any longer with QPACK.  It just seems like that when the requirement to decode the header block was removed at https://github.com/quicwg/base-drafts/commit/404c5b8ee838042f7269574b608d1b15e2a25fd9, adding the requirement to signal an error was not in scope of that commit.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/2858