TCP urgent handling is a complex topic due to conflicting RFCs and
implementations.
Until now the URG flag and urgent pointer values were simply ignored,
leading to an effective "inline" processing of urgent data. Many
implementations however, do not default to this behavior.
Many actual implementations use the urgent mechanism to send 1 byte of
data out of band to the application.
Complicating the matter is that the way the urgent logic is handled is
generally configurable both of the OS and the app level. So from the
network it is impossible to know with confidence what the settings are.
This patch adds the following policies:
`stream.reassembly.urgent.policy`:
- drop: drop URG packets before they affect the stream engine
- inline: ignore the urgent pointer and process all data inline
- oob (out of band): treat the last byte as out of band
- gap: skip the last byte, but do no adjust sequence offsets, leading to
gaps in the data
For the `oob` option, tracking of a sequence number offset is required,
as the OOB data does "consume" sequence number space. This is limited to
64k. For this reason, there is a second policy:
`stream.reassembly.urgent.oob-limit-policy`:
- drop: drop URG packets before they affect the stream engine
- inline: ignore the urgent pointer and process all data inline
- gap: skip the last byte, but do no adjust sequence offsets, leading to
gaps in the data
Bug: #7411.
"$comment":"EVE DNS v2 style query logging; as of Suricata 8 only used in DNS records when v2 logging is enabled, not used for DNS records logged as part of an event.",
"$comment":
"EVE DNS v2 style query logging; as of Suricata 8 only used in DNS records when v2 logging is enabled, not used for DNS records logged as part of an event.",
"type":"array",
"minItems":1,
"items":{
@ -5185,6 +5186,11 @@
"Number of packets dropped due to stream reassembly exception policy",
"type":"integer"
},
"stream_urgent":{
"description":
"Number of packets dropped due to TCP urgent flag",
"type":"integer"
},
"nfq_error":{
"description":
"Number of packets dropped due to no NFQ verdict",
@ -6072,7 +6078,8 @@
"type":"integer"
},
"get_used":{
"description":"Number of reused flows from the hash table in case memcap was reached and spare pool was empty",
"description":
"Number of reused flows from the hash table in case memcap was reached and spare pool was empty",
"type":"integer"
},
"get_used_eval":{
@ -6125,7 +6132,8 @@
"type":"integer"
},
"tcp_reuse":{
"description":"Number of TCP flows that were reused as they seemed to share the same flow tuple",
"description":
"Number of TCP flows that were reused as they seemed to share the same flow tuple",
"type":"integer"
},
"total":{
@ -6550,6 +6558,10 @@
"urg":{
"description":"Number of TCP packets with the urgent flag set",
"type":"integer"
},
"urgent_oob_data":{
"description":"Number of OOB bytes tracked in TCP urgent handling",
@ -109,5 +109,7 @@ alert tcp any any -> any any (msg:"SURICATA STREAM FIN SYN reuse"; stream-event:
# Depth setting reached for a stream. Very common in normal traffic, so disable by default.
#alert tcp any any -> any any (msg:"SURICATA STREAM reassembly depth reached"; stream-event:reassembly_depth_reached; classtype:protocol-command-decode; sid:2210062; rev:1;)
# next sid 2210066
alert tcp any any -> any any (msg:"SURICATA STREAM urgent OOB limit reached"; stream-event:reassembly_urgent_oob_limit_reached; classtype:protocol-command-decode; sid:2210066; rev:1;)