mirror of https://github.com/OISF/suricata
detect: fix heap buffer overflow in DetectRunTx post-rule match
PrefilterPostRuleMatch() repopulates det_ctx->pmq with flowbits:isset candidates after a matching flowbits:set rule is found. The subsequent append loop writes directly into det_ctx->tx_candidates[] without first checking that the array has room. The buffer was initially sized for prefilter results only not accounting for post-rule additions. When array_idx already equals tx_candidates_size, the writes go past the end of the heap-allocated block - a heap buffer overflow followed by qsort() over OOB memory, causing a crash (DoS). Addressed by adding a capacity check + expand before the append loop, matching the existing pattern at all other candidate append logic. Ticket: #8866.pull/16213/head
parent
c9ca1a4fba
commit
fa76410603
Loading…
Reference in New Issue