Re: HTTP/2 client behaviour on receiving illegal PUSH_PROMISE frames

Lucas Pardue <lucaspardue.24.7@gmail.com> Tue, 22 September 2020 20:11 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 78A413A1966 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 22 Sep 2020 13:11:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.771
X-Spam-Level:
X-Spam-Status: No, score=-2.771 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 OYc3O-jZ0WdU for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 22 Sep 2020 13:11:55 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0E7F73A194B for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 22 Sep 2020 13:11:55 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1kKobT-0003BN-JH for ietf-http-wg-dist@listhub.w3.org; Tue, 22 Sep 2020 20:09:31 +0000
Resent-Date: Tue, 22 Sep 2020 20:09:31 +0000
Resent-Message-Id: <E1kKobT-0003BN-JH@lyra.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <lucaspardue.24.7@gmail.com>) id 1kKobR-0003AF-MQ for ietf-http-wg@listhub.w3.org; Tue, 22 Sep 2020 20:09:29 +0000
Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by titan.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <lucaspardue.24.7@gmail.com>) id 1kKobQ-00072A-7u for ietf-http-wg@w3.org; Tue, 22 Sep 2020 20:09:29 +0000
Received: by mail-ej1-x633.google.com with SMTP id gx22so15596422ejb.5 for <ietf-http-wg@w3.org>; Tue, 22 Sep 2020 13:09:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=birlzK8JzTPusb8CiqYggN8GRA4B1PDBEOM3t3nQjFA=; b=ug/s+GR8bo5gTQx4daX68Sz0QkhE5cfeLeutpGDoRMZXN67blV/e1Yk9gd+VSIS3/G 8uJCGlA+vrL/Z7HnRYsWt2VciAdJJA6xJ9iL72Hh4K5uRc9PInd9mAEU5Xi282Z/GQfb Ee3Mb1VF7Y69/aXchI2tf1Oxf7K4YWjxyfGFXvHaepB1ix+VcOAKS3mmwV67kt1QcxYy fbXdXpNyghai/9MC6YEy8zjGNuoKmLAWDSV/ZH/RGz5ENQKwysjYUnhJmsQmZ47WNwdz 2Tbthl04Ic7T41mqPgm4m0XP2z6NqauSnIgkspoyCdsmUcFkOFOrf8FvZVhjkN4hGgM7 I1hw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=birlzK8JzTPusb8CiqYggN8GRA4B1PDBEOM3t3nQjFA=; b=R1+qvbgxAEBG4lXOmswJFrzJCo3Cxf0KGUUZ2dWJnqsUoho8ozGYDHy8cMI8yCvDuY BxKMAw+29he5Hpsg+DEZE2FOBPL7+/x/gExVoLPfnuMR4p7baVfpQsDv6coj1eq48pyP 1hiZ+QvLTvG7IocHlJtdPgsjAYe+SZgb01LTcvf4GPFP8vsYr90stoTL5R0tdPXsM/H8 +tRuPPpBHstH8XBhCICBB1+UE3GHKSSZVDf8XQxOtgTTV1qpD5RJoyKZ57cOjeg2gEMK 2hE47ZJ/3HerXfMPOqDharzQR8rY1zFcytb2CCL3KgKR3lmApOhgtTthpWVyVjjZJOkv iIwA==
X-Gm-Message-State: AOAM533E87nWmqyVkOzkKPriwdZ3dmYujq7mhmzvEQoszfsvKK+eeK6h LPB2buAbIyylYESO8RMuF9UKMdEjwjLOK7tP3Cz/gno+EuI=
X-Google-Smtp-Source: ABdhPJwMWvhnQuRLPSWDKMpUf/nj0GuoD1e+X6mT7kscxKgjOFsuThWAUsbOFwK3B+Xg1oFwOhYIaJ3coJV9RZ7CXgY=
X-Received: by 2002:a17:906:3ac5:: with SMTP id z5mr6868773ejd.46.1600805356856; Tue, 22 Sep 2020 13:09:16 -0700 (PDT)
MIME-Version: 1.0
References: <CA+phaeeHSjyKx8Dv_DqUmL=1TuYyahsFEW364TQT3Kw5j4U5xw@mail.gmail.com> <CALGR9oZLp+RBZCaCr-Q4uBX7UGieSavizxWLcw3gmHpcuz8k1g@mail.gmail.com> <CA+phaeeaeL+64TyrQgp3+=wDiDbtxcTYqzSzQN2PN34WfRadsQ@mail.gmail.com>
In-Reply-To: <CA+phaeeaeL+64TyrQgp3+=wDiDbtxcTYqzSzQN2PN34WfRadsQ@mail.gmail.com>
From: Lucas Pardue <lucaspardue.24.7@gmail.com>
Date: Tue, 22 Sep 2020 21:09:05 +0100
Message-ID: <CALGR9oYU=JzkZuVYwvY87hycUgy1qKrWV50VF49cfM_A8pntMw@mail.gmail.com>
To: Alan Egerton <eggyal@gmail.com>
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="000000000000a6676005afec8a05"
Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=lucaspardue.24.7@gmail.com; helo=mail-ej1-x633.google.com
X-W3C-Hub-Spam-Status: No, score=-7.8
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1kKobQ-00072A-7u ebe27232b975d83b4533cb2db1fe72af
X-Original-To: ietf-http-wg@w3.org
Subject: Re: HTTP/2 client behaviour on receiving illegal PUSH_PROMISE frames
Archived-At: <https://www.w3.org/mid/CALGR9oYU=JzkZuVYwvY87hycUgy1qKrWV50VF49cfM_A8pntMw@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/38058
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On Tue, Sep 22, 2020 at 8:38 PM Alan Egerton <eggyal@gmail.com> wrote:

> Thanks Lucas, but I don't think either of those reports are quite the
> same: they both appear to concern the state transition from "idle" state on
> sending a PUSH_PROMISE (and that the spec can be misread as describing
> transitions from that state on receiving such frames); whereas I am
> concerned with the correct error handling on receiving an erroneous
> PUSH_PROMISE in the "half-closed(remote)" or "closed" states.
>
> -- Alan
>
>
oops I meant to say "possibly related" because this is about the handling
of push promises with respect to stream lifecycle. My 2c:

I might be squinting at the state machine wrong but I don't think it is
practically possible for the client to have a request stream in a
half-closed (remote) and receive a PUSH_PROMISE. Because the only way to
get a stream in that state is for a server to respond to a request with
END_STREAM set, before the client has sent END_STREAM or RST_STREAM. This
is an early response, which is allowed. But the server shouldn't be trying
to promise things after it closed the stream, that's a plain error.
Similarly, a server sending PUSH_PROMISE after RST_STREAM is also an error.

The odd case is when a client and server have a race about the stream being
closed due to the client sending RST_STREAM in the open state. "Closed
because I said so" is a bit different to "Closed because you said so". The
statement in 6.6 about "MUST handle PUSH_PROMISES" is trying to wiggle out
of the race condition.

Cheers
Lucas