alert http2 any any -> any any (msg:"SURICATA HTTP2 invalid HTTP1 settings during upgrade"; flow:established; app-layer-event:http2.invalid_http1_settings; classtype:protocol-command-decode; sid:2290008; rev:1;)
alert http2 any any -> any any (msg:"SURICATA HTTP2 failed decompression"; flow:established; app-layer-event:http2.failed_decompression; classtype:protocol-command-decode; sid:2290009; rev:1;)
alert http2 any any -> any any (msg:"SURICATA HTTP2 authority host mismatch"; flow:established,to_server; app-layer-event:http2.authority_host_mismatch; classtype:protocol-command-decode; sid:2290013; rev:1;)
+alert http2 any any -> any any (msg:"SURICATA HTTP2 user info in uri"; flow:established,to_server; app-layer-event:http2.userinfo_in_uri; classtype:protocol-command-decode; sid:2290014; rev:1;)
self.decoder.http2_encoding_fromvec(&block.value, _dir);
} else if block.name.eq_ignore_ascii_case(b":authority") {
authority = Some(&block.value);
+ if block.value.iter().any(|&x| x == b'@') {
+ // it is forbidden by RFC 9113 to have userinfo in this field
+ // when in HTTP1 we can have user:password@domain.com
+ self.set_event(HTTP2Event::UserinfoInUri);
+ }
} else if block.name.eq_ignore_ascii_case(b"host") {
host = Some(&block.value);
}
InvalidHTTP1Settings,
FailedDecompression,
AuthorityHostMismatch,
+ UserinfoInUri,
}
impl HTTP2Event {
8 => Some(HTTP2Event::InvalidHTTP1Settings),
9 => Some(HTTP2Event::FailedDecompression),
10 => Some(HTTP2Event::AuthorityHostMismatch),
+ 11 => Some(HTTP2Event::UserinfoInUri),
_ => None,
}
}
"invalid_http1_settings" => HTTP2Event::InvalidHTTP1Settings as i32,
"failed_decompression" => HTTP2Event::FailedDecompression as i32,
"authority_host_mismatch" => HTTP2Event::AuthorityHostMismatch as i32,
+ "userinfo_in_uri" => HTTP2Event::UserinfoInUri as i32,
_ => -1, // unknown event
}
}
HTTP2Event::InvalidHTTP1Settings => "invalid_http1_settings\0",
HTTP2Event::FailedDecompression => "failed_decompression\0",
HTTP2Event::AuthorityHostMismatch => "authority_host_mismatch\0",
+ HTTP2Event::UserinfoInUri => "userinfo_in_uri\0",
};
unsafe {
*event_name = estr.as_ptr() as *const std::os::raw::c_char;