Commit Graph

6 Commits (56541c7c37d0de3f4c7eaafc19118ad837bbbc3d)

Author SHA1 Message Date
Victor Julien c9270f6854 detect: fix multi inspect buffer issue; clean up
Fix multi inspect buffer API causing cleanup logic in the single
inspect buffer paths. This could lead to a buffer overrun in the
"to clear" logic.

Multi buffers now use InspectionBufferSetupMulti instead of
InspectionBuffer. This is enforced by a check in debug validation.

Simplify the multi inspect buffer setup code and update the callers.

(cherry picked from commit 3dc50322db)
5 years ago
Victor Julien 2f3524f7e2 mqtt: move sub/unsub limits into app-layer config
(cherry picked from commit 3c1cc1e345)
5 years ago
Sascha Steinbiss 07669cd70a detect/mqtt: add topic inspection limit
We add a new 'mqtt.(un)subscribe-topic-match-limit' option
to allow a user to specify the maximum number of topics in
a MQTT SUBSCRIBE or UNSUBSCRIBE message to be evaluated
in detection.

(cherry picked from commit 4c0ef73bf2)
5 years ago
Philippe Antoine 234cafdcfe detect: use u32 for InspectionBufferMultipleForList
So that we do not have an endless loop casting index to
u16 and having more than 65536 buffers in one transaction

Changes for all protocols, even ones where it is impossible
to have such a pattern, so as to avoid bad pattern copy/paste
in the future

(cherry picked from commit 7d0a39412b)
5 years ago
Victor Julien 12f7e05c27 detect: fix heap overflow issue with buffer setup
In some cases, the InspectionBufferGet function would be followed by
a failure to set the buffer up, for example due to a HTTP body limit
not yet being reached. Yet each call to InspectionBufferGet would lead
to the matching list_id to be added to the
DetectEngineThreadCtx::inspect.to_clear_queue. This array is sized to
add each list only once, but in this case the same id could be added
multiple times, potentially overflowing the array.

(cherry picked from commit 13cebb1857)
6 years ago
Sascha Steinbiss c31360070b rust/mqtt: add MQTT parser 6 years ago