Actions
Bug #9444
open
VJ
VJ
detect/frame: in IDS mode, frame chunking doesn't work
Bug #9444:
detect/frame: in IDS mode, frame chunking doesn't work
Affected Versions:
Effort:
Difficulty:
Label:
Description
In IDS mode, SetupStreamCallbackData() (src/detect-engine-frame.c, lines 504-530 on main 5c7787ed6) holds back the inspection of an open or incomplete frame until 2500 more bytes are available:
const uint64_t usable = StreamDataRightEdge(stream, eof);
...
uint64_t want = frame->inspect_progress;
if (frame->len == -1) {
...
want += 2500;
...
const uint64_t have = usable;
if (!ips && have < want) {
return false;
usableis an absolute stream offset.frame->inspect_progressis relative to the frame start.BufferSetup()sets it from the frame-relativefo_inspect_offset + data_len, and line 541 uses it asframe->offset + frame->inspect_progress.- So
wantis short byframe->offset. For a frame at offset O, inspection runs once 2500 - O new bytes are available. For a frame at or past offset 2500, it runs on every packet that updates the app-layer. - Each run inspects the new data, so a content match in every new chunk alerts again.
- The complete-frame branch of the same function already uses an absolute value (
want = frame->offset + frame->len, line 520).
IPS mode is not affected: it skips this check (!ips) and inspects a sliding window by design.
Effects¶
- Alerts per segment: a frame rule alerts once per segment, instead of once per 2500 bytes, on any frame that stays open while the parser consumes data and that starts past offset 2500. For example, the
smtp.dataframe of every message after the first one in a session. - Inspection work: the same frames are inspected on every packet.
OT Updated by OISF Ticketbot about 3 hours ago
- Subtask #9445 added
OT Updated by OISF Ticketbot about 3 hours ago
- Label deleted (
Needs backport to 8.0)
VJ Updated by Victor Julien about 3 hours ago
- Related to Bug #9446: eve/frame: slide accounting error caused missed records added
VJ Updated by Victor Julien about 3 hours ago
- Status changed from In Progress to In Review
Actions