]> git.ipfire.org Git - thirdparty/suricata.git/commit
stream/tcp: avoid evasion linked to ACK handling
authorEric Leblond <el@stamus-networks.com>
Fri, 28 May 2021 09:38:18 +0000 (11:38 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 25 Jun 2021 15:10:57 +0000 (17:10 +0200)
commit54ebee6f516f983a21d952ec6cf4292ed8ba9d8d
treefe03c27a25db7e116db22d156cf78aa1795f559f
parentdedfa602dd6663290790c9d25dea3fa66878597d
stream/tcp: avoid evasion linked to ACK handling

Actual code will completely discard TCP analysis of a packet that
don't have the ACK bit set but have a ACK value set. This will be
for example the case of all SYN packets that have a ACK value.

Problem is that these type of packets are legit for the operating
systems and for the RFC. The consequence is that an attacker
sending a SYN packet with a non null ACK value will open succesfully
a TCP session to its target and this session will have no protocol
discovery, no TCP streaming and no application layer analysis.
Result is  a quasi full evasion of the TCP stream that will only
appear in the flow log if this log is enable or alert on tcp-pkt
signature that are uncommon.

The patch is updating the code to only discard packets that do not
have the SYN flag set. This prevents the evasion and complies with the
RFC that states that the ACK bit should always be set once the
TCP session is established.

This addresses CVE-2021-35063.

Fixes: fa692df37 ("stream: reject broken ACK packets")
Bug: #4512.
src/stream-tcp.c