Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-24971

Undertow HTTP2 breaks protocol specification when client misbehaves

XMLWordPrintable

      With recent nightly builds of JBoss EAP (and WildFly too) we can see failures of 2 negative tests in the h2spec TS we use to check that JBoss EAP/WildFly/Undertow behaves according to the HTTP2 protocol standard.

      Here are the failing tests:

      Hypertext Transfer Protocol Version 2 (HTTP/2)
        8. HTTP Message Exchanges
          8.1. HTTP Request/Response Exchange
            × 1: Sends a second HEADERS frame without the END_STREAM flag
              -> 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:1504, flags:0x01, stream_id:1)
      
            8.1.2. HTTP Header Fields
              8.1.2.1. Pseudo-Header Fields
                × 3: Sends a HEADERS frame that contains a pseudo-header field as 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:1504, flags:0x01, stream_id:1)
      

      What these two tests do is they simulate misbehaving client that breaks the HTTP2 protocol and server is supposed to end the connection with the client with PROTOCOL_ERROR code. But in our case the server happily continues with the DATA frame instead.

      After some checks I found out that it was brought in by changes that were implemented for the UNDERTOW-2258 issue - this PR and specifically this particular commit is the culprit that these two tests started to fail.

      My assumption is that part of the code that sends the PROTOCOL_ERROR shouldn't have been removed completely but should have been kept there under some extra condition?

            flaviarnn Flavia Rainone
            jstourac@redhat.com Jan Stourac
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: