Skip to content

Improper HTTP/2 enforcement of a reduced session window size #9115

@bneradt

Description

@bneradt

While adding test coverage for #9085, I noticed that we have issues handling multiplexed HTTP/2 DATA frames on the client side as we handle translating the transactions toward the origin. I forced the client to send DATA continuation frames by reducing the stream window to 10 bytes. The client (Proxy Verifier) multiplexes three transactions per this window. The client and ATS handle this fine. Toward the origin, I notice that ATS sends the first request headers and the first 10 byte body as a chunked body. This 10 byte body corresponds to the first DATA frame content. The problem is that ATS does not continue to stream this first request until chunk termination. Instead, ATS then sends the headers for the second request. This is, naturally, not acceptable for HTTP/1 since there is no concept of multiplexing like that for HTTP/1.

I have an AuTest that reproduces this. I'll attach to this issue:

  1. The AuTest.
  2. The Proxy Verifier replay file used by the test to generate the HTTP traffic.
  3. A tcpdump I captured while running the test. Port 2007 is client-side HTTP/2, port 2002 is the client side HTTP/1.1 traffic.
  4. A TLS keylog file to decrypt the tcpdump on the client side (the origin side is plaintext HTTP/1.1).

Looking at the pcap file:

  • Note that the transaction has an initial GET request for path /zero-request. Ignore this.
  • Frame 55 contains the headers for the first relevant POST request. Wireshark doesn't parse it because the stream is ultimately corrupted per the bug recorded in this issue.
  • Frame 57 contains the 10 byte chunk for the first request. It correctly has no chunk terminator because further bytes should be forthcoming.
  • Frame 61 incorrectly contains the header bytes for the second POST request. This is malformed HTTP/1.1 as an HTTP/1.1 parser would be expecting more chunk bytes, not header bytes of another request.

tls_session_keys.txt
h2_to_h1_malformed.pcap.gz
http2_flow_control.replay.yaml.gz
http2_flow_control.test.py.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions