Skip to content

Commit fa692df

Browse files
committed
stream: reject broken ACK packets
Fix evasion posibility by rejecting packets with a broken ACK field. These packets have a non-0 ACK field, but do not have a ACK flag set. Bug OISF#3324. Reported-by: Nicolas Adba
1 parent 9f0294f commit fa692df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/stream-tcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4803,6 +4803,7 @@ int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt,
48034803
/* broken TCP http://ask.wireshark.org/questions/3183/acknowledgment-number-broken-tcp-the-acknowledge-field-is-nonzero-while-the-ack-flag-is-not-set */
48044804
if (!(p->tcph->th_flags & TH_ACK) && TCP_GET_ACK(p) != 0) {
48054805
StreamTcpSetEvent(p, STREAM_PKT_BROKEN_ACK);
4806+
goto error;
48064807
}
48074808

48084809
/* If we are on IPS mode, and got a drop action triggered from
@@ -6929,7 +6930,7 @@ static int StreamTcpTest10 (void)
69296930

69306931
tcph.th_win = htons(5480);
69316932
tcph.th_seq = htonl(10);
6932-
tcph.th_ack = htonl(11);
6933+
tcph.th_ack = 0;
69336934
tcph.th_flags = TH_SYN;
69346935
p->tcph = &tcph;
69356936

0 commit comments

Comments
 (0)