mirror of https://github.com/OISF/suricata
detect/bytemath: reject literal shift counts of 64
Fail rule load when byte_math pairs << or >> with a literal rvalue of 64 or more. rvalue was bounded only to u32::MAX, so a rule shifting by 100 loaded and then produced 0 for every packet it inspected, spending detection work on a comparison whose outcome was settled before the first packet arrived. A variable rvalue still loads. Its value comes from a byte_extract on the packet and is not known until the rule runs, so the guard in DetectByteMathDoMatch() stays the only check covering that path. DetectByteMathParse() reports every SCByteMathParse() failure as "invalid bytemath values", so the rejected rule is named by the "error parsing signature" line that follows rather than by the reason the parser gave. Issue: 8845pull/16141/head
parent
e5d035fd16
commit
89d09c457c
Loading…
Reference in New Issue