Skip to content

Detect count 5044 v4.8 - #16111

Open
catenacyber wants to merge 7 commits into
OISF:mainfrom
catenacyber:detect-count-5044-v4.8
Open

Detect count 5044 v4.8#16111
catenacyber wants to merge 7 commits into
OISF:mainfrom
catenacyber:detect-count-5044-v4.8

Conversation

@catenacyber

Copy link
Copy Markdown
Contributor

Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/5044

Describe changes:

  • adds other modes to multi-buffers like all, all_or_absent, matches`, and precise indexing

SV_BRANCH=OISF/suricata-verify#3062

Draft : I would like some approval before doing all the individual modifications for each multi-buffer

#16103 with fix found by fuzz in CI

TODOs :

  • add support for all multi-buf keywords
  • add count support

Also rename parse_uint_count as parse_multi_count

This allows to prepare multi-buffers using this code
As for multi-integers, multi-buffers can now have the following
arguments
- nb
- precise index
- all

Ticket: 5044
- or_absent can also be any_or_absent
- nb can also be matches
- precise index can have prefix index
To avoid accepting "email.received: index 1junk;"
Ticket: 5044

As we set "all" before adding a transform, we must take care of
this case `sticky_multi: all; transform; content: "abc";`
so that "all" applies to the transformed multi-buffer
@suricata-review-bot

Copy link
Copy Markdown

AI-generated review posted automatically by Suricata ai-review.

Verdict: request changes

  • Medium — src/detect-engine.c:2413: Selector evaluation treats the 1,024-buffer inspection cap as end-of-list. Network-supplied additional Received headers are ignored, causing incorrect all, matches, precise-index, and oob_or results. Distinguish cap exhaustion from list completion and add boundary regressions beyond 1,024 entries.

  • Medium — tests/detect-email-received-multi/test.rules:2 (suricata-verify PR Next/20171208/v5 #3062): Every selector test is a positive case that also alerts under ordinary “any buffer” behavior, so the suite passes even if selector semantics are ignored. Add negative assertions that distinguish all, match counts, precise indexes, absent lists, and out-of-bounds behavior from the default mode.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.33884% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.02%. Comparing base (7c66954) to head (49071a0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16111      +/-   ##
==========================================
- Coverage   83.06%   83.02%   -0.04%     
==========================================
  Files        1004     1005       +1     
  Lines      277376   277587     +211     
==========================================
+ Hits       230389   230474      +85     
- Misses      46987    47113     +126     
Flag Coverage Δ
fuzzcorpus 61.45% <28.75%> (-0.06%) ⬇️
livemode 18.42% <7.29%> (-0.01%) ⬇️
netns 22.83% <7.29%> (-0.06%) ⬇️
pcap 45.31% <14.59%> (-0.11%) ⬇️
suricata-verify 67.16% <77.68%> (+<0.01%) ⬆️
unittests 58.50% <23.14%> (-0.03%) ⬇️

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
Copy Markdown

WARNING:

field baseline test %
SURI_TLPR1_stats_chk
.app_layer.flow.ftp_data 659 627 95.14%

Pipeline = 33335

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.

3 participants