]> git.ipfire.org Git - thirdparty/suricata.git/commit
smtp: avoid creating empty transaction
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 14 Nov 2023 20:51:37 +0000 (21:51 +0100)
committerVictor Julien <vjulien@oisf.net>
Tue, 6 Feb 2024 14:16:43 +0000 (15:16 +0100)
commit61f2e4e1e5b34dfd8ae44d1c15253e2da65f6e6a
tree327e314759421d13fdff3b1a42b2d8fc4d83dc5c
parent8f73a0ac5588cb5e5c501b3c7a07cb5d35b99d92
smtp: avoid creating empty transaction

Ticket: 6477

So as to avoid ending up with too many empty transactions.

This happens when Suricata sees a DATA command in the current
transaction but did not have a confirmation response for it.
Then, if Suricata receives another DATA command, it will
create another new transaction, even if the previous one
is empty. And so, a malicious client can create many empty
transactions by just sending a repeated amount of DATA commands
without having a confirmation code for them.

Suricata cannot use state->current_command == SMTP_COMMAND_DATA
to prevent this attack and needs to resort to a new boolean
is_data because the malicious client may send another dummy command
after each DATA command.

This patch leaves only one call to SMTPTransactionCreate
src/app-layer-smtp.c
src/app-layer-smtp.h