Victor Julien [Tue, 16 Feb 2016 15:50:48 +0000 (16:50 +0100)]
eve: fix mishandling of big messages
When the string representation of a JSON message grew bigger than
64k, the JSON record would just be truncated. This lead to errors
in the parser(s) of the JSON stream.
This patch changes the buffer logic to grow the buffer on demand.
Victor Julien [Fri, 12 Feb 2016 15:31:57 +0000 (16:31 +0100)]
http: fix multipart body tracking slowdown
Optimize HTTP multipart body parsing. Big records that were not files
could slow down Suricata. The reason was that the body tracker was not
moved forward. This lead to growing body buffers, which were expensive
wrt memory and inspection.
This patch add logic to move the tracker forward in this case.
Victor Julien [Fri, 12 Feb 2016 09:54:02 +0000 (10:54 +0100)]
tls-sni: fix uninitialized memory use
On bad traffic the parser could allocated memory that was not
intialized. This was later used in the JSON output logging as
a valid null terminated string.
Victor Julien [Sun, 31 Jan 2016 12:40:07 +0000 (13:40 +0100)]
eve: fix stream payload logging wrong direction
In the EVE stream payload logging the IPS path logged the wrong dir.
Both IDS and IPS can take the same path as the detection engine
inspects in the same direction in both cases, so the alert is also
generated in the same direction.
Maurizio Abba [Mon, 16 Nov 2015 12:21:27 +0000 (12:21 +0000)]
filestore-call: forcing a call to FileStore instead of manually updating
the relative flag in order to have a single point where we actually
touch the File structure
Eric Leblond [Mon, 14 Dec 2015 14:18:07 +0000 (15:18 +0100)]
suricata: can't use -l and unix socket runmode
It is not possible to use simultaneously -l and unix socket
runmode because setting the log directory make it final so
not modifable by other call.
It is a implementation limitation but it does not make sense
to set logging directory to have it overwritten by the first
directory specified 'by pcap-file'. So it seems correct to
only trigger an error if this both options are used at the same
time.
Eric Leblond [Mon, 14 Dec 2015 13:02:20 +0000 (14:02 +0100)]
unix-manager: fix race condition
Under high load it is possible that the thread is not yet started
and that we register a command at the same time. As a consequence,
the commands list is not yet initialized and we have a segfault.
This patch moves the initialization in the ThreadInit function to
be sure the commands list is available when needed.
Victor Julien [Wed, 16 Dec 2015 09:45:05 +0000 (10:45 +0100)]
icmpv4: improve dest unreachable logic
When a ICMPv4 destination unreachable packet contains an embedded packet
this packet is parsed. When it's found to be invalid, the whole ICMP
packet is tagged as invalid.
In some cases the unreachable packet would still be used.
This patch fixes this by checking the packet is invalid flag as well
in the ICMPV4_DEST_UNREACH_IS_VALID macro.
Victor Julien [Thu, 10 Dec 2015 08:58:52 +0000 (09:58 +0100)]
ips/drop-log: fix crash on logging drops
When logging drops for fragmented UDP packets, triggered by detection
in the reassembled packet, a missing check could lead to access of the
packets UDP header pointer when it was NULL.
Eric Leblond [Thu, 3 Dec 2015 11:07:03 +0000 (12:07 +0100)]
output-json: add app_proto key in root
By adding the key in the root of *flow and fileinfo events it
will be possible to get all events for one application layer by
using a 'event_type:proto OR app_proto:proto' filter. This will
permit to the analyst to get a good view of events related to
one protocol.
Maurizio Abba [Mon, 16 Nov 2015 12:14:24 +0000 (12:14 +0000)]
app-layer-smtp: support for multiline response
Multiline response support is provided but not enforced. This patch
allow parsing multiline response when a reply is processed
Aaron Campbell [Mon, 2 Nov 2015 19:19:12 +0000 (15:19 -0400)]
Fix out-of-bounds memory access in DNS TXT record parser.
The datalen variable is declared unsigned. If txtlen and datalen are equal,
datalen will first be reduced to 0, and then the datalen-- line will cause its
value to wrap to 65535. This will cause the loop to continue much longer than
intended, and eventually may crash on an out-of-bounds *tdata dereference.