golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
120.99k stars 17.36k forks source link

x/net/http2: h2spec violation 8.1.2.2 #26321

Open fraenkel opened 5 years ago

fraenkel commented 5 years ago
$ ./h2spec -S -k -t -h 127.0.0.1 -p 8080 http2/8.1.2.2
Hypertext Transfer Protocol Version 2 (HTTP/2)
  8. HTTP Message Exchanges
    8.1. HTTP Request/Response Exchange
      8.1.2. HTTP Header Fields
        8.1.2.2. Connection-Specific Header Fields
          × 1: Sends a HEADERS frame that contains the connection-specific header field
            -> The endpoint MUST respond with a stream error of type PROTOCOL_ERROR.
               Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
                         RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
                         Connection closed
                 Actual: DATA Frame (length:51, flags:0x01, stream_id:1)
          × 2: Sends a HEADERS frame that contains the TE header field with any value other than "trailers"
            -> The endpoint MUST respond with a stream error of type PROTOCOL_ERROR.
               Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
                         RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
                         Connection closed
                 Actual: DATA Frame (length:53, flags:0x01, stream_id:1)

Failures: 

Hypertext Transfer Protocol Version 2 (HTTP/2)
  8. HTTP Message Exchanges
    8.1. HTTP Request/Response Exchange
      8.1.2. HTTP Header Fields
        8.1.2.2. Connection-Specific Header Fields
          × 1: Sends a HEADERS frame that contains the connection-specific header field
            -> The endpoint MUST respond with a stream error of type PROTOCOL_ERROR.
               Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
                         RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
                         Connection closed
                 Actual: DATA Frame (length:51, flags:0x01, stream_id:1)
          × 2: Sends a HEADERS frame that contains the TE header field with any value other than "trailers"
            -> The endpoint MUST respond with a stream error of type PROTOCOL_ERROR.
               Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
                         RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
                         Connection closed
                 Actual: DATA Frame (length:53, flags:0x01, stream_id:1)

There is a CL which I will rebase and associate to this issue.

gopherbot commented 5 years ago

Change https://golang.org/cl/111680 mentions this issue: http2: reject connection-level headers with a protocol error

bcmills commented 1 year ago

@fraenkel, I see that there is a CL still open for this — is there more to be done to move this forward?

fraenkel commented 1 year ago

Brad had a comment regarding how GFE behaves vs the spec. I am not sure if GFE still reports a 400 or not.

ypaq commented 8 months ago

Any update on this?