]> git.ipfire.org Git - thirdparty/suricata.git/commit
pop3: fix incorrect direction matching 13260/head
authorShivani Bhardwaj <shivani@oisf.net>
Mon, 19 May 2025 05:58:23 +0000 (11:28 +0530)
committerShivani Bhardwaj <shivanib134@gmail.com>
Mon, 19 May 2025 05:58:23 +0000 (11:28 +0530)
commit31a395c734f7664be2d5b526de1a65f9cbe8f883
tree2fcc5bd4c97b9a762bfdaabb160ab8ed3697ec60
parentdbc2f9d1db7cecab3cbbd9fb9fbc9fca9835b272
pop3: fix incorrect direction matching

sawp crate has its own Direction enum as follows.

pub enum Direction {
    ToClient = 0,
    ToServer = 1,
    Unknown = 2,
}

While it is correct to send this Direction enum as argument to the
sawp_pop3 parser as it expects, it is not correct to use it where the
direction param is obtained from the internal API of Suricata.
The reason is that Suricata's definition of its Direction enum is as
follows.

pub enum Direction {
    ToServer = 0x04,
    ToClient = 0x08,
}

This can lead to issues like incorrect progress tracking of a transaction in
a direction which could cause inspection on incorrect data and buggy behavior.
rust/src/pop3/pop3.rs