mirror of https://github.com/OISF/suricata
firewall: a non-fast-pattern engine does not miss on an incomplete state
An engine that is not the rule's fast-pattern engine is reached on every update while the transaction is at its hook. While that state is not complete, such an engine's buffer is missing or partial, yet a miss returned -1, a final no-match, and the walk applied the hook's default policy: an allow-list rule such as `http.host; pcre:"/good\.example/";` dropped a benign request whose headers span two segments. In effect that changes rules without a prefilter. For a gated rule the first engine is the fast-pattern one, and its in-progress miss already returned -2 through mpm_in_progress; this arm is only reached when nothing matched with no flags set, which for a gated rule means the pattern engine already deferred. A miss on a buffer engine of the transaction's current, incomplete state now returns -2, as a fast pattern in progress does: no default policy is applied for it, and the rule is inspected again on the next update. Engines without a buffer, the hook's generic list (flowbits, xbits), stay final: they read variables the rules before them already set. The deferral is bounded by the state: on the update that completes the state, the engine sits below the transaction's progresses and the miss is final, so the hook's default policy decides there. A flow that never completes the state keeps it undecided, as it does for a reset - no default is applied and the flow is not decided by omission. Ticket: #9257.pull/16492/head
parent
9451642a28
commit
729c97ca3a
Loading…
Reference in New Issue