]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect/app-layer-proto: don't run detection on ALPROTO_UNKNOWN 11732/head
authorVictor Julien <vjulien@oisf.net>
Fri, 6 Sep 2024 11:14:48 +0000 (13:14 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 9 Sep 2024 09:01:27 +0000 (11:01 +0200)
commit79aa4861e0a7f729c9d827770abe21dce2260b0a
treee80f3133b94d79dd22f91f57aa679673e840af38
parent84735251b577a284af3795708786974fd30720b0
detect/app-layer-proto: don't run detection on ALPROTO_UNKNOWN

The `app-layer-protocol` keyword inconsistently checks whether the
alproto is ALPROTO_UNKNOWN. In the regular match function it isn't
checked, in the prefilter function its checked for all but the "either"
mode.

This leads to false positives for negated matching, as an expression
like "!tls" will match if checked against ALPROTO_UNKNOWN.

This patch adds the checking everywhere. The keyword returns no match as
long as the alproto is ALPROTO_UNKNOWN.

Bug: #7241.
src/detect-app-layer-protocol.c