]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: h3: reject CANCEL_PUSH on backend side
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 16 Nov 2026 09:23:02 +0000 (10:23 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 16 Nov 2026 14:06:54 +0000 (15:06 +0100)
CANCEL_PUSH frames are always rejected on the frontend side as haproxy
never emits PUSH_PROMISE frames.

Rejection must also be performed systematically on the backend side as
haproxy never emits MAX_PUSH_ID frames, hence any push IDs mentionned by
the server are invalid.

The outcome is the same on both sides: the connection is closed with
H3_ID_ERROR and a glitch is accounted.

This must be backported up to 3.3.

src/h3.c

index 0447b057434cbc6be074330f645a6d638de3f65b..a143ad0aa6a0600ca4c9f0f7d3307760a4d56890 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -2248,24 +2248,21 @@ static ssize_t h3_rcv_buf(struct qcs *qcs, struct buffer *b, int fin)
                                goto err;
                        }
 
-                       if (!conn_is_back(qcs->qcc->conn)) {
-                               /* RFC 9114 7.2.3. CANCEL_PUSH
-                                *
-                                * If a server receives a CANCEL_PUSH frame for a push ID
-                                * that has not yet been mentioned by a PUSH_PROMISE frame, this MUST be
-                                * treated as a connection error of type H3_ID_ERROR.
-                                */
-                               TRACE_ERROR("reject CANCEL_PUSH from client", H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
-                               qcc_set_error(qcs->qcc, H3_ERR_ID_ERROR, 1,
-                                             muxc_tevt_type_proto_err);
-                               qcc_report_glitch(qcs->qcc, 1);
-                               goto err;
-                       }
-                       else {
-                               /* Not supported */
-                               ret = flen;
-                       }
-                       break;
+                       /* RFC 9114 7.2.3. CANCEL_PUSH
+                        *
+                        * If a CANCEL_PUSH frame is received that
+                        * references a push ID greater than currently allowed on the
+                        * connection, this MUST be treated as a connection error of type
+                        * H3_ID_ERROR.
+                        *
+                        * If a server receives a CANCEL_PUSH frame for a push ID
+                        * that has not yet been mentioned by a PUSH_PROMISE frame, this MUST be
+                        * treated as a connection error of type H3_ID_ERROR.
+                        */
+                       TRACE_ERROR("reject CANCEL_PUSH from peer", H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
+                       qcc_set_error(qcs->qcc, H3_ERR_ID_ERROR, 1, muxc_tevt_type_proto_err);
+                       qcc_report_glitch(qcs->qcc, 1);
+                       goto err;
                case H3_FT_GOAWAY:
                        ret = h3_parse_goaway_frm(qcs->qcc->ctx, b, flen);
                        if (ret < 0) {