Skip to content

Commit 5ddc400

Browse files
a-denoyellecapflam
authored andcommitted
BUG/MEDIUM: h3: ensure the ":scheme" pseudo header is totally valid
Ensure pseudo-header scheme is only constitued of valid characters according to RFC 9110. If an invalid value is found, the request is rejected and stream is resetted. It's the same as for previous commit "BUG/MEDIUM: h3: ensure the ":method" pseudo header is totally valid" except that this time it applies to the ":scheme" pseudo header. This must be backported up to 2.6. (cherry picked from commit a3bed52) Signed-off-by: Christopher Faulet <[email protected]>
1 parent 47d13c6 commit 5ddc400

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/h3.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,15 @@ static ssize_t h3_headers_to_htx(struct qcs *qcs, const struct buffer *buf,
675675
len = -1;
676676
goto out;
677677
}
678+
679+
if (!http_validate_scheme(list[hdr_idx].v)) {
680+
TRACE_ERROR("invalid scheme pseudo-header", H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);
681+
h3s->err = H3_ERR_MESSAGE_ERROR;
682+
qcc_report_glitch(h3c->qcc, 1);
683+
len = -1;
684+
goto out;
685+
}
686+
678687
scheme = list[hdr_idx].v;
679688
}
680689
else if (isteq(list[hdr_idx].n, ist(":authority"))) {

0 commit comments

Comments
 (0)