SCTP decoder and sticky buffers v4 - #15482
Closed
glongo wants to merge 12 commits into
Closed
Conversation
Extend the SCTP decoder to parse chunk headers after the 12-byte common header. Each chunk is validated for minimum header size and length consistency per RFC 4960 sec 3.2. Add SCTPChunkHdr and SCTPVars structs to track per-packet chunk metadata Add five new decoder events for protocol violations: - SCTP_CHUNK_TOO_SMALL: insufficient data for a chunk header - SCTP_CHUNK_LEN_INVALID: chunk length < 4 or exceeds packet - SCTP_INIT_CHUNK_NOT_ALONE: INIT/INIT_ACK bundled (RFC 4960 sec 6.10) - SCTP_INIT_WITH_NON_ZERO_VTAG: INIT with vtag != 0 (RFC 4960 sec 8.5.1) - SCTP_DATA_WITH_ZERO_VTAG: DATA chunk with vtag == 0 Ticket OISF#4251
Implement a sticky buffer to match the raw SCTP header (common header + chunks) Ticket OISF#4251
Add a U8 numeric keyword to match the first SCTP chunk type in a packet with prefilter support. Ticket OISF#4251
Add a U8 numeric keyword to match the number of SCTP chunks parsed in a packet with prefilter support. Ticket OISF#4251
Add a U32 numeric keyword to match the SCTP verification tag from the common header with prefilter support. Ticket OISF#4251
Add a boolean NOOPT keyword to match SCTP packets containing an INIT chunk. Ticket OISF#4251
Add a boolean NOOPT keyword to match SCTP packets containing a DATA chunk. Ticket OISF#4251
Add a boolean NOOPT keyword to match SCTP packets containing an ABORT chunk. Ticket OISF#4251
Log SCTP-specific fields in the EVE JSON "sctp" object for alert events. Ticket OISF#4251
Track the first DATA chunk's data offset and length during chunk iteration, then reassign p->payload to point at the user data. When no DATA chunk is present (INIT, SACK, HEARTBEAT, etc.), payload_len is set to 0 since there is no application data. Ticket OISF#4251
Add a sctp.data sticky multi-buffer that allows content matching on the bytes inside any of the SCTP DATA chunks extracted. Ticket OISF#4251
Add documentation for all sctp keywords. Ticket OISF#4251
glongo
requested review from
a team,
jasonish,
jufajardini and
victorjulien
as code owners
May 29, 2026 13:23
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #15482 +/- ##
==========================================
- Coverage 82.76% 82.74% -0.02%
==========================================
Files 998 1008 +10
Lines 272286 273082 +796
==========================================
+ Hits 225344 225975 +631
- Misses 46942 47107 +165
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
WARNING:
Pipeline = 31761 |
Member
|
Lets drop the has_init, has_data, has_abort keywords. While syntactically nicer, they are actually inferior implementations lacking prefilter support. Given that chunk_type can also express this, we don't need them. |
victorjulien
requested changes
Jun 1, 2026
victorjulien
left a comment
Member
There was a problem hiding this comment.
see my comment on the keywords
Contributor
Author
|
Replaced with #15497 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to ticket: https://redmine.openinfosecfoundation.org/issues/4251
Describe changes:
Open questions:
Previous PR: #15386
SV_BRANCH=OISF/suricata-verify#2999