]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http2: fix parsing of goaway frames
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 9 Oct 2025 18:32:00 +0000 (20:32 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 15 Oct 2025 19:42:57 +0000 (21:42 +0200)
There was a last stream id before the error code
As per section 6.8 of RFC 7540

Ticket: 7991
(cherry picked from commit 9a4a29e2189fbd8e5bf47d00b0bcdecaf2aa7d04)

rust/src/http2/http2.rs
rust/src/http2/parser.rs

index af6e22f69cf9c49169d81e8f5a9883d717b5f377..ed8a2abc82b7ac33562a91c0ca9ba4014e4f868f 100644 (file)
@@ -69,7 +69,7 @@ pub enum HTTP2ConnectionState {
 
 const HTTP2_FRAME_HEADER_LEN: usize = 9;
 const HTTP2_MAGIC_LEN: usize = 24;
-const HTTP2_FRAME_GOAWAY_LEN: usize = 4;
+const HTTP2_FRAME_GOAWAY_LEN: usize = 8;
 const HTTP2_FRAME_RSTSTREAM_LEN: usize = 4;
 const HTTP2_FRAME_PRIORITY_LEN: usize = 5;
 const HTTP2_FRAME_WINDOWUPDATE_LEN: usize = 4;
index 239d4e942a8287a6db9ed91ef417719590524c37..9d79b8cf1a0b73b226d73a9a863da1eb16d2c364 100644 (file)
@@ -161,6 +161,7 @@ pub struct HTTP2FrameGoAway {
 }
 
 pub fn http2_parse_frame_goaway(i: &[u8]) -> IResult<&[u8], HTTP2FrameGoAway> {
+    let (i, _last_stream_id) = be_u32(i)?;
     let (i, errorcode) = be_u32(i)?;
     Ok((i, HTTP2FrameGoAway { errorcode }))
 }