This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 2d6fd56558 Treat an invalid RST_STREAM frame length as a connection 
error (#1118)
2d6fd56558 is described below

commit 2d6fd56558496f289d4f3964ad57acbc1615e62d
Author: Arturo Bernal <[email protected]>
AuthorDate: Thu Nov 5 21:10:26 2026 +0100

    Treat an invalid RST_STREAM frame length as a connection error (#1118)
    
    RFC 9113, section 6.4 requires a RST_STREAM frame with a length other
    than 4 octets to be treated as a connection error of type
    FRAME_SIZE_ERROR. It was being handled as a stream error.
---
 java/org/apache/coyote/http2/FrameType.java            | 2 +-
 test/org/apache/coyote/http2/TestHttp2Section_6_4.java | 7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/http2/FrameType.java 
b/java/org/apache/coyote/http2/FrameType.java
index 070c4ae0b7..55006f717c 100644
--- a/java/org/apache/coyote/http2/FrameType.java
+++ b/java/org/apache/coyote/http2/FrameType.java
@@ -25,7 +25,7 @@ enum FrameType {
     DATA            (  0, false,  true, null,              false),
     HEADERS         (  1, false,  true, null,               true),
     PRIORITY        (  2, false,  true, (x) -> x == 5,     false),
-    RST             (  3, false,  true, (x) -> x == 4,     false),
+    RST             (  3, false,  true, (x) -> x == 4,      true),
     SETTINGS        (  4,  true, false, (x) -> x % 6 == 0,  true),
     PUSH_PROMISE    (  5, false,  true, (x) -> x >= 4,      true),
     PING            (  6,  true, false, (x) -> x == 8,     false),
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_6_4.java 
b/test/org/apache/coyote/http2/TestHttp2Section_6_4.java
index ba0dc64cd1..15a24bad6e 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_6_4.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_6_4.java
@@ -16,7 +16,6 @@
  */
 package org.apache.coyote.http2;
 
-import org.junit.Assert;
 import org.junit.Test;
 
 /**
@@ -67,9 +66,7 @@ public class TestHttp2Section_6_4 extends Http2TestBase {
         os.write(resetFrame);
         os.flush();
 
-        // Read reset frame
-        parser.readFrame();
-
-        Assert.assertEquals("3-RST-[" + Http2Error.FRAME_SIZE_ERROR.getCode() 
+ "]\n", output.getTrace());
+        // RFC 9113, section 6.4: a connection error, not a stream error
+        handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR);
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to