Skip to content

Backport8 5180 7846 v1#14844

Closed
catenacyber wants to merge 3 commits intoOISF:main-8.0.xfrom
catenacyber:backport8-5180-7846-v5
Closed

Backport8 5180 7846 v1#14844
catenacyber wants to merge 3 commits intoOISF:main-8.0.xfrom
catenacyber:backport8-5180-7846-v5

Conversation

@catenacyber
Copy link
Contributor

jufajardini and others added 3 commits February 19, 2026 09:57
... to account for midstream sessions.

Commit 497394e removed inspection of app-proto txs for packets
without an established TCP connection. But this meant that the
first packet seen in a session pick mid-stream could go without
inspection (previous bug 5510 seemed to point towards this behavior,
too).
If a flow has more packets, the stream will be inspected as part of
the upcoming packets and this would go unnoticed. In a single-packet
flow, however, the inspection for the packed would be skipped. Although
this might not affect alerts -- as they could be processed as part of
the flow timeout logic, the actual traffic could be evaded in IPS, in
case of a drop rule.

From the above, the most visible scenario is when there is only one packet on the flow,
as then the engine doesn't have "more time" to pick-up real-packets to
inspect for that given flow. But certain tests show that this can also
happen for more than one packet scenarios: there will be one less drop
event, or traffic from a packet that should have been already dropped
will be logged.

This led to the possibility of a real packet not being blocked, in IPS,
or matched against rules, as the corresponding portion of the stream
was only inspected later, as part of the stream/flow-timeout logic.

To ensure that we correctly flag the first packet seen for a given mid-stream
session, we must check for the session state and existance *after* we
have dealt with TCP flags and state.

Related to
Bug OISF#5510

As part of
Bug OISF#5180

(cherry picked from commit bd76c29)
Ticket: 7846
(cherry picked from commit dbea660)
Ticket: 7846
(cherry picked from commit 539e4ee)
@catenacyber
Copy link
Contributor Author

cc @jufajardini created with OISF/suricata-verify#2906

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 87.65432% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.57%. Comparing base (7c082f0) to head (36e7e6f).
⚠️ Report is 16 commits behind head on main-8.0.x.

Additional details and impacted files
@@              Coverage Diff               @@
##           main-8.0.x   #14844      +/-   ##
==============================================
+ Coverage       83.56%   83.57%   +0.01%     
==============================================
  Files            1010     1011       +1     
  Lines          266211   266371     +160     
==============================================
+ Hits           222452   222613     +161     
+ Misses          43759    43758       -1     
Flag Coverage Δ
fuzzcorpus 63.96% <23.33%> (-0.04%) ⬇️
livemode 18.63% <21.33%> (-0.01%) ⬇️
pcap 44.56% <23.33%> (-0.03%) ⬇️
suricata-verify 64.84% <81.08%> (+0.01%) ⬆️
unittests 58.86% <45.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline = 29771

@victorjulien victorjulien added this to the 8.0 milestone Feb 24, 2026
@victorjulien
Copy link
Member

Merged in #14892, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants