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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 9d9869c31d Treat SETTINGS_INITIAL_WINDOW_SIZE overflow as a connection 
error (#1131)
9d9869c31d is described below

commit 9d9869c31de38410c482f76540750b5d34df7b29
Author: Arturo Bernal <[email protected]>
AuthorDate: Thu Nov 12 12:26:14 2026 +0100

    Treat SETTINGS_INITIAL_WINDOW_SIZE overflow as a connection error (#1131)
    
    Per RFC 9113 section 6.9.2, a change to SETTINGS_INITIAL_WINDOW_SIZE
    that causes any flow-control window to exceed the maximum size must be
    treated as a connection error of type FLOW_CONTROL_ERROR. The previous
    code closed only the affected stream with RST_STREAM, which is a stream
    error and not compliant with the specification.
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java  | 6 ++++--
 test/org/apache/coyote/http2/TestHttp2Section_6_9.java | 9 ++++-----
 webapps/docs/changelog.xml                             | 6 ++++++
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 89dd0e87bf..6a00d02280 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1970,9 +1970,11 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
                 try {
                     stream.incrementWindowSize(diff);
                 } catch (Http2Exception h2e) {
-                    ((Stream) stream).close(new StreamException(
+                    // Per RFC 9113 section 6.9.2, a change to 
SETTINGS_INITIAL_WINDOW_SIZE that
+                    // causes any flow-control window to exceed the maximum 
size is a connection error.
+                    throw new ConnectionException(
                             sm.getString("upgradeHandler.windowSizeTooBig", 
connectionId, stream.getIdAsString()),
-                            h2e.getError(), stream.getIdAsInt()));
+                            Http2Error.FLOW_CONTROL_ERROR, h2e);
                 }
             }
         } else if (setting == Setting.NO_RFC7540_PRIORITIES) {
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_6_9.java 
b/test/org/apache/coyote/http2/TestHttp2Section_6_9.java
index 966bf88d24..28ad585761 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_6_9.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_6_9.java
@@ -263,11 +263,10 @@ public class TestHttp2Section_6_9 extends Http2TestBase {
         // Increase the flow control window but keep it under the limit
         sendWindowUpdate(3, 1 << 30);
 
-        // Now increase beyond the limit via a settings frame
+        // Now increase beyond the limit via a settings frame.
+        // Per RFC 9113 section 6.9.2 this must be treated as a connection 
error
+        // of type FLOW_CONTROL_ERROR, not a stream error.
         sendSettings(0, false, new SettingValue(4, 1 << 30));
-        // Ack
-        parser.readFrame();
-        Assert.assertEquals("3-RST-[" + 
Http2Error.FLOW_CONTROL_ERROR.getCode() + "]\n", output.getTrace());
-
+        handleGoAwayResponse(3, Http2Error.FLOW_CONTROL_ERROR);
     }
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6c1c05ca2f..3827c443d8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -128,6 +128,12 @@
         been reset is now treated as a connection error as per RFC 9113, 
section
         5.1. Pull request <pr>1129</pr> provided by Arturo Bernal. (markt)
       </fix>
+      <fix>
+        Treat a change to <code>SETTINGS_INITIAL_WINDOW_SIZE</code> that causes
+        any flow control window to exceed the maximum size as an HTTP/2
+        connection error as required by RFC 9113, section 6.9.2. Pull request
+        <pr>1131</pr> provided by Arturo Bernal. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


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

Reply via email to