]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect: don't run pkt sigs on ffr pkts
authorVictor Julien <vjulien@oisf.net>
Mon, 21 Oct 2024 13:24:50 +0000 (15:24 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 11 Dec 2024 21:24:41 +0000 (22:24 +0100)
commitc84599a59e9d897408c87ee69bd81f1e52161cc5
treee75943703b7b34b121d8b2d0a485c0c9418e75cb
parent72673308158264e56d0cfaa8341185d7bfc79945
detect: don't run pkt sigs on ffr pkts

Last packet from the TLS TCP session moves TCP state to CLOSED.

This flags the app-layer with APP_LAYER_PARSER_EOF_TS or
APP_LAYER_PARSER_EOF_TC depending on the direction of the final packet.
This flag will just have been set in a single direction.

This leads to the last packet updating the inspect id in that packets
direction.

At the end of the TLS session a pseudo packet is created, because:
 - flow has ended
 - inspected tx id == 0, for at least one direction
 - total txs is 1

Then a packet rule matches:

```
alert tcp any any -> any 443 (flow: to_server;                  \
        flowbits:isset,tls_error;                               \
        sid:09901033; rev:1;                                    \
        msg:"Allow TLS error handling (outgoing packet)"; )
```

The `SIG_MASK_REQUIRE_REAL_PKT` is not preventing the match, as the
`flowbits` keyword doesn't set it.

To avoid this match. This patch skips signatures of the `SIG_TYPE_PKT`
for flow end packets.

Ticket: #7318.
(cherry picked from commit 0e4faba79ae7e9fbe36815956cfd44af6d7f9378)
src/detect.c