]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 years agosmb: add detect tx flags shim for smb (non-rust) 4414/head
Victor Julien [Tue, 3 Dec 2019 06:09:19 +0000 (07:09 +0100)] 
smb: add detect tx flags shim for smb (non-rust)

5 years agodetect/file_data: fix buffer reusing id 0
Victor Julien [Mon, 2 Dec 2019 13:50:45 +0000 (14:50 +0100)] 
detect/file_data: fix buffer reusing id 0

5 years agoftp: add support for tx detect flags
Jason Ish [Mon, 2 Dec 2019 17:26:08 +0000 (11:26 -0600)] 
ftp: add support for tx detect flags

Related commit for 5.0:
1930b1f5043d9eae17c6665ba920a2a7863f2a8e

5 years agodetect-engine: check for tx detect flag support
Jason Ish [Mon, 25 Nov 2019 22:57:06 +0000 (16:57 -0600)] 
detect-engine: check for tx detect flag support

When registing a detection engine, check that the app-layer
protocol supports tx detect flags.

This is a code implementation error that should be resolved
during development.

VJ: made this a warning as we're updating an older stable
branch.

5 years agodebug: add SCReturnBool function exit macro
Jason Ish [Mon, 25 Nov 2019 22:55:08 +0000 (16:55 -0600)] 
debug: add SCReturnBool function exit macro

5 years agoapp-layer: method to see if parser supports tx detect flags
Jason Ish [Mon, 25 Nov 2019 22:51:44 +0000 (16:51 -0600)] 
app-layer: method to see if parser supports tx detect flags

Add method to check if a parser for an app-layer protocol
supports tx detect flags.

This is a bit of a hack for now as where we need to run
this check from we do not have the IP protocol.

5 years agoconfigure: add python3 to python's to look for 4410/head
Jason Ish [Fri, 29 Nov 2019 21:24:22 +0000 (15:24 -0600)] 
configure: add python3 to python's to look for

5 years agogithub-actions: builds for our tier one linux distributions
Jason Ish [Sun, 24 Nov 2019 05:36:48 +0000 (23:36 -0600)] 
github-actions: builds for our tier one linux distributions

Example of using GitHub actions to perform builds across
CentOS, Ubuntu, Debian and the latest Fedora.

(cherry picked from commit 3887f8d1f3d2816b3f46fb48560f9de57ae66314)

5 years agoapp-layer: validate TX detect flag callbacks
Jason Ish [Wed, 27 Nov 2019 18:47:01 +0000 (12:47 -0600)] 
app-layer: validate TX detect flag callbacks

Check that both are set or unset.

(cherry picked from commit ba3a2c31bf0544e531789d88b19cefd8f5c75dd9)

5 years agoenip: add tx detect flags
Jason Ish [Wed, 27 Nov 2019 15:50:40 +0000 (09:50 -0600)] 
enip: add tx detect flags

(cherry picked from commit 706558d4d5211c545b779be43eb1b3fe28b3b876)

5 years agodcerpc: add tx detect flags
Jason Ish [Tue, 26 Nov 2019 22:18:51 +0000 (16:18 -0600)] 
dcerpc: add tx detect flags

(cherry picked from commit cb62c8dacffd787795c2f30b12b05342ab70d37c)

5 years agomodbus: add tx detect flags
Jason Ish [Tue, 26 Nov 2019 22:01:09 +0000 (16:01 -0600)] 
modbus: add tx detect flags

(cherry picked from commit 21f014f5c3fa03ca5be8e4ee161842b62febcf21)

5 years agokrb5: register tx detect flags
Jason Ish [Thu, 21 Nov 2019 18:26:32 +0000 (12:26 -0600)] 
krb5: register tx detect flags

Related ticker #3345:
https://redmine.openinfosecfoundation.org/issues/3345

(cherry picked from commit fa4b9d37c2c2d8204aaea209d91734c57c337b19)

5 years agorust: define TxDetectFlag struct and binding macros
Jason Ish [Tue, 26 Nov 2019 19:25:04 +0000 (13:25 -0600)] 
rust: define TxDetectFlag struct and binding macros

Define a TxDetectFlag type and macros to generating C
bindings for getting and settings the tx detect
flags.

(cherry picked from commit 8a232be77e4e766ea5618319b1553e1d2a7749ee)

VJ: std::os::raw::c_void to libc::c_void

5 years agorust: add tx detect flags function to registration struct
Jason Ish [Tue, 19 Nov 2019 19:44:31 +0000 (13:44 -0600)] 
rust: add tx detect flags function to registration struct

(cherry picked from commit cde49ec24660bfab7cd2dc0d14cb08a16654ba4c)

5 years agoapp-layer: add tx detect functions to register struct
Jason Ish [Tue, 19 Nov 2019 19:42:24 +0000 (13:42 -0600)] 
app-layer: add tx detect functions to register struct

(cherry picked from commit 20bc08a72271a6b7237efd663765c872e6d8125e)

5 years agoftpdata: add tx detect flags
Jason Ish [Mon, 25 Nov 2019 22:56:50 +0000 (16:56 -0600)] 
ftpdata: add tx detect flags

(cherry picked from commit b1beb76fd7c6fac527c723139088f4a97a9f5d50)

5 years agodnp3: add tx detect flags support
Victor Julien [Fri, 29 Nov 2019 14:43:30 +0000 (15:43 +0100)] 
dnp3: add tx detect flags support

5 years agoapp-layer: don't consider tx flags if not registered
Victor Julien [Fri, 22 Nov 2019 06:54:04 +0000 (07:54 +0100)] 
app-layer: don't consider tx flags if not registered

If a protocol does not support TxDetectFlags, don't try to use them.

The consequence of trying to use them was that a TX would never be
considered done, and it would never be freed. This would lead to excessive
memory use and performance problems due to walking an ever increasing
list.

(cherry picked from commit ab471c30541338aa9232b001436dec9b870e5ccb)

5 years agodns: log addresses in flow direction, not packet
Jason Ish [Mon, 18 Nov 2019 18:58:06 +0000 (12:58 -0600)] 
dns: log addresses in flow direction, not packet

Ticket #3340.
https://redmine.openinfosecfoundation.org/issues/3340

(cherry picked from commit fccbd36d37dd630a76584b3a7ac6083f4c2eb3ed)

5 years agofilestore: don't assume flow is TCP 4350/head 4370/head
Victor Julien [Thu, 24 Oct 2019 12:51:48 +0000 (14:51 +0200)] 
filestore: don't assume flow is TCP

Filestore can be used by UDP based protocols as well. NFSv2 is one
that Suricata supports.

Bug #3278.

(cherry picked from commit 0824b0413455b668777e83cabe9fbc0ea81c400a)

5 years agoyaml: only enable ikev2 if rust is compiled in
Victor Julien [Sat, 2 Nov 2019 15:37:43 +0000 (16:37 +0100)] 
yaml: only enable ikev2 if rust is compiled in

Bug #3279.

5 years agodecode/pppoe: fix potential crash in debug statement
Victor Julien [Sun, 20 Oct 2019 05:50:32 +0000 (07:50 +0200)] 
decode/pppoe: fix potential crash in debug statement

5 years agolog-pcap: don't print (null) for compression method
Victor Julien [Fri, 18 Oct 2019 08:08:18 +0000 (10:08 +0200)] 
log-pcap: don't print (null) for compression method

5 years agotcp: don't set event on empty SACK opt
Victor Julien [Thu, 17 Oct 2019 13:42:15 +0000 (15:42 +0200)] 
tcp: don't set event on empty SACK opt

TCP_OPT_INVALID_LEN was set if the opt len was 2. While useless
an empty SACK is not uncommon.

Seen on an iOS device talking to an Apple server.

Bug #3254.

5 years agosuricata: use version from autoconf
Victor Julien [Mon, 14 Oct 2019 10:58:57 +0000 (12:58 +0200)] 
suricata: use version from autoconf

5 years agosignature: leak fix in DetectAddressParse2
Philippe Antoine [Fri, 11 Oct 2019 08:11:56 +0000 (10:11 +0200)] 
signature: leak fix in DetectAddressParse2

5 years agoautomake: use tar-ustar for longer filenames
Jason Ish [Sat, 12 Oct 2019 14:37:38 +0000 (08:37 -0600)] 
automake: use tar-ustar for longer filenames

According to the automake manual it should be considered
portable these days.

https://www.gnu.org/software/automake/manual/html_node/List-of-Automake-options.html

Required for the dist generation with Rust vendoring.

5 years agomem: Use correct len with strlcpy
Jeff Lucovsky [Sat, 12 Oct 2019 14:35:53 +0000 (10:35 -0400)] 
mem: Use correct len with strlcpy

5 years agoconfigure.ac: fix static build with pcap
Fabrice Fontaine [Fri, 11 Oct 2019 08:55:51 +0000 (10:55 +0200)] 
configure.ac: fix static build with pcap

pcap can depends on nl-3 so use pkg-config to find these dependencies
otherwise all AC_CHECK_LIB calls will fail when building statically

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
5 years agostream: fix progress for min_inspect_depth
Victor Julien [Fri, 11 Oct 2019 12:25:10 +0000 (14:25 +0200)] 
stream: fix progress for min_inspect_depth

Make sure progress don't exceed raw_progress.

5 years agoafl/decode: fix stats related memleak reports
Victor Julien [Tue, 8 Oct 2019 12:19:42 +0000 (14:19 +0200)] 
afl/decode: fix stats related memleak reports

5 years agoMakefile: Make libhtp available at install-rules stage
Shivani Bhardwaj [Mon, 7 Oct 2019 18:27:43 +0000 (23:57 +0530)] 
Makefile: Make libhtp available at install-rules stage

So far when "make install-rules" stage was executed, libhtp path was not
recognized as ldconfig does not run by this stage.
Set "LD_LIBRARY_PATH" since we already know the path where libhtp would
be.

Closes redmine ticket #2669.

5 years agolua: fix lua int size detection
Victor Julien [Fri, 4 Oct 2019 05:36:56 +0000 (07:36 +0200)] 
lua: fix lua int size detection

Failed to work with non-bundled htp and with some stricter
compile flags.

5 years agoconfigure: detect lua integer size
Jason Ish [Fri, 27 Sep 2019 21:33:45 +0000 (15:33 -0600)] 
configure: detect lua integer size

Lua 5.1 and 5.3 use a different integer size. Run a test program
to set the integer size used in the Rust FFI layer to Rust.

5 years agoenip: fix compile warnings in gcc-8
Victor Julien [Sat, 28 Sep 2019 08:55:34 +0000 (10:55 +0200)] 
enip: fix compile warnings in gcc-8

In file included from suricata-common.h:471,
                 from app-layer-enip-common.c:27:
app-layer-enip-common.c: In function ‘DecodeCIPRequestPathPDU’:
util-debug.h:222:31: warning: ‘req_path_class8’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             int _sc_log_ret = snprintf(_sc_log_msg, SC_LOG_MAX_LOG_MSG_LEN, __VA_ARGS__);   \
                               ^~~~~~~~
app-layer-enip-common.c:589:13: note: ‘req_path_class8’ was declared here
     uint8_t req_path_class8;
             ^~~~~~~~~~~~~~~
app-layer-enip-common.c:607:9: warning: ‘segment’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         switch (segment)
         ^~~~~~
app-layer-enip-common.c: In function ‘DecodeCIPResponsePDU’:
app-layer-enip-common.c:773:13: warning: ‘service’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     service &= 0x7f; //strip off top bit to get service code.  Responses have first bit as 1
             ^~
app-layer-enip-common.c: In function ‘DecodeCIPRequestPDU’:
app-layer-enip-common.c:503:25: warning: ‘path_size’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     offset += path_size * sizeof(uint16_t); //move offset past pathsize
               ~~~~~~~~~~^~~~~~~~~~~~~~~~~~
app-layer-enip-common.c:506:5: warning: ‘service’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     switch (service)
     ^~~~~~

Bug #3139.

5 years agochangelog: update for 4.1.5 suricata-4.1.5
Victor Julien [Sun, 22 Sep 2019 08:13:40 +0000 (10:13 +0200)] 
changelog: update for 4.1.5

5 years agoder/asn1: reduce max depth limit to 32
Victor Julien [Sun, 22 Sep 2019 05:54:57 +0000 (07:54 +0200)] 
der/asn1: reduce max depth limit to 32

OpenSSL uses 30, so this seems a reasonable limit.

Set a smaller limit than before to reduce the resources spent on
specially crafted input designed to be maximally expensive.

5 years agoder/asn1: don't pass on more data than is specified
Victor Julien [Fri, 20 Sep 2019 15:12:17 +0000 (17:12 +0200)] 
der/asn1: don't pass on more data than is specified

Set and Sequence parsers would pass on max available data instead
of the size of their object.

Malformed data could trigger massive recursion this way, leading
to spending much more resources than necessary.

Found using AFL.

Bug #3184.

5 years agodecode/ipv4: fix ts opt flags decoding
Victor Julien [Wed, 18 Sep 2019 11:26:23 +0000 (13:26 +0200)] 
decode/ipv4: fix ts opt flags decoding

Field is at data+1 offset, not +3. Also makes sure we always stay
within checked data bounds.

Reported-by: Sirko Höer -- Code Intelligence for DCSO.
Bug #3173.

5 years agodecode/ipv4: unittest to show parsing issue
Victor Julien [Wed, 18 Sep 2019 10:21:04 +0000 (12:21 +0200)] 
decode/ipv4: unittest to show parsing issue

5 years agossl: fix bounds checking in version decoding
Victor Julien [Fri, 6 Sep 2019 13:07:56 +0000 (15:07 +0200)] 
ssl: fix bounds checking in version decoding

Reported-by: Sirko Höer -- Code Intelligence for DCSO.
Bug #3168.

5 years agodefrag: check minimum size of reassembled packet
Jason Ish [Tue, 17 Sep 2019 10:08:15 +0000 (12:08 +0200)] 
defrag: check minimum size of reassembled packet

Before re-assembling, check that the first fragment is large
enough to contain the IPv4 or IPv6 header to prevent
an out of bounds read (IPv4) or write (IPv6).

Reported-by: Sirko Höer -- Code Intelligence for DCSO.
Bug #3170.

5 years agoAvoid to shutdown NSS if it is not initialized
Yujie Zhao [Tue, 17 Sep 2019 12:47:18 +0000 (12:47 +0000)] 
Avoid to shutdown NSS if it is not initialized

5 years agohttp: backport new events 4230/head
Philippe Antoine [Mon, 4 Mar 2019 12:25:46 +0000 (13:25 +0100)] 
http: backport new events

5 years agohtp/lzma: disable by default for 4.1.x. 4224/head
Jason Ish [Thu, 19 Sep 2019 16:16:33 +0000 (10:16 -0600)] 
htp/lzma: disable by default for 4.1.x.

The configuration logic had to be changed to be disabled by
default, to prevent a limit being set, but not the enable
flag from enabling lzma.

5 years agohttp: disable lzma decompression from configuration
Philippe Antoine [Thu, 19 Sep 2019 14:54:44 +0000 (16:54 +0200)] 
http: disable lzma decompression from configuration

5 years agohtp/lzma: set limit from configuration
Jason Ish [Thu, 12 Sep 2019 20:53:07 +0000 (14:53 -0600)] 
htp/lzma: set limit from configuration

Also use a default defined in Suricata, not libhtp.

5 years agohtp: set lzma memlimit from config
Victor Julien [Tue, 10 Sep 2019 11:06:28 +0000 (13:06 +0200)] 
htp: set lzma memlimit from config

5 years agosmtp: fix file_data inspection 4213/head
Victor Julien [Tue, 17 Sep 2019 13:01:45 +0000 (15:01 +0200)] 
smtp: fix file_data inspection

Continue tracking data if API is used with detect. Detection engine
then manages the tracking.

Bug #2395.

5 years agodecode: prevent segfault on bypass without flow 4191/head
Eric Leblond [Fri, 24 May 2019 21:37:49 +0000 (23:37 +0200)] 
decode: prevent segfault on bypass without flow

When using a rule like:
pass ip any any -> any any (msg:"Bypass"; sid:1; rev:1;)

We could get a match even in case of flow exhaustion where the
Packet has no Flow attached.

5 years agogeoip: add --disable-libgeoip 4179/head
Jason Ish [Fri, 6 Sep 2019 18:26:06 +0000 (12:26 -0600)] 
geoip: add --disable-libgeoip

Add ./configure argument --disable-libgeoip to disable
libgeoip when --enable-geoip is requested. This will allow
libmaxminddb to be picked up instead of libgeoip when
both are installed on the system.

5 years agogeoip: remove instructions to install legacy version
Jason Ish [Fri, 6 Sep 2019 16:47:15 +0000 (10:47 -0600)] 
geoip: remove instructions to install legacy version

The code is never hit.  If geoip is requested, and neither
libgeoip or libmaxminddb are available, libmaxminddb
will be recommended.

5 years agogeoip: display which geoip library is in use in configure
Jason Ish [Fri, 6 Sep 2019 16:38:29 +0000 (10:38 -0600)] 
geoip: display which geoip library is in use in configure

Example:
GeoIP support:                           yes, legacy libgeoip
GeoIP support:                           yes, libmaxminddb

5 years agodoc: fix geoip syntax
Eric Leblond [Wed, 31 Jul 2019 22:02:30 +0000 (00:02 +0200)] 
doc: fix geoip syntax

Spaces are not allowed before country code.

5 years agodetect-geoip: restore libgeoip code
Eric Leblond [Wed, 31 Jul 2019 19:42:43 +0000 (21:42 +0200)] 
detect-geoip: restore libgeoip code

Switching to libmaxminddb on a stable release will cause a
dependency to be changed and this may cause issue with some build
systems. Also yaml needs to be updated as geoip is erroring if
no geoip file is defined in the configuration:
 Unable to locate a GeoIP2 database filename in YAML conf.

This patch update configure.ac to search for libgeoip then switch
to libmaxminddb if the first one is not found.

5 years agoafl/fuzz: fix compiler warnings 4157/head
Victor Julien [Mon, 2 Sep 2019 14:59:38 +0000 (16:59 +0200)] 
afl/fuzz: fix compiler warnings

5 years agohttp: fixes stream flags for http tests 4149/head
Philippe Antoine [Mon, 2 Sep 2019 07:17:19 +0000 (09:17 +0200)] 
http: fixes stream flags for http tests

5 years agohttp: wait for response line for filename
Philippe Antoine [Tue, 2 Apr 2019 14:32:43 +0000 (16:32 +0200)] 
http: wait for response line for filename

See http evader case 481

5 years agodetect: fix FP on ICMP unreachable errors 4119/head
Victor Julien [Thu, 22 Aug 2019 09:28:36 +0000 (11:28 +0200)] 
detect: fix FP on ICMP unreachable errors

ICMP unreachable errors are linked to the flow they send an error for.
This would lead to the detection engine calling the TX inspection
engines on them.

The stream inspect engine would default to a match for non-UDP
and non-TCP as for ICMP we're not expected to use a TX inspect engine
for stream data.

This all would lead to a false positive match.

This patch fixes this by making sure the TX engines are not called if
the packet protocol and flow protocol are not the same.

Bug #2841.

5 years agopcap: fix breakloop error handling
Victor Julien [Wed, 5 Jun 2019 20:06:08 +0000 (22:06 +0200)] 
pcap: fix breakloop error handling

Ticket #3004

5 years agocapture: check for flow packets on capture timeout
Victor Julien [Mon, 27 May 2019 13:46:18 +0000 (15:46 +0200)] 
capture: check for flow packets on capture timeout

The capture threads can receive packets from the flow manager in their
Threadvars::stream_pq packet queue. This mechanism makes sure the packets
the flow manager injects into the engine are processed by the correct
worker thread.

If the capture thread(s) would not receive packets for a long time, the
Threadvars::stream_pq would not be checked and processed. This could
lead to packet pool depletion in the flow manager. It would also lead
to flows not being timed out/logged until either packets started flowing
again or until the engine was shut down.

The scenario is more likely to happen in a test (e.g. replay) but could
also delay logging on low traffic sensors.

5 years agorust: Fix deprecation warnings
Shivani Bhardwaj [Fri, 26 Jul 2019 17:52:34 +0000 (23:22 +0530)] 
rust: Fix deprecation warnings

Fix the following warnings by compiler,
(1) warning: use of deprecated item 'take_until_s': Please use `take_until` instead
(2) warning: `...` range patterns are deprecated

For the second warning, the builtin lint
"ellipsis_inclusive_range_pattern" has been added which causes the
following warning to show up with rustc 1.24.

warning: unknown lint: `ellipsis_inclusive_range_patterns`
  --> /home/travis/build/OISF/suricata/suricata-5.0.0-dev/rust/src/lib.rs:18:10
   |
18 | #![allow(ellipsis_inclusive_range_patterns)]
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(unknown_lints)] on by default

Since there is no other way to fix this, the above warning shall stay.
We need to take care of modifying this if and when the support for 1.24
as MSRV is dropped.

5 years agowarnings: fixes integer sizes in format strings
Philippe Antoine [Tue, 4 Jun 2019 09:27:04 +0000 (11:27 +0200)] 
warnings: fixes integer sizes in format strings

Fixes #3009

5 years agoaf-packet: fix build on recent Linux kernels
Eric Leblond [Wed, 17 Jul 2019 10:35:12 +0000 (12:35 +0200)] 
af-packet: fix build on recent Linux kernels

6 years agodecoder/vxlan: disable by default 4018/head 4026/head
Shivani Bhardwaj [Fri, 5 Jul 2019 12:12:44 +0000 (17:42 +0530)] 
decoder/vxlan: disable by default

6 years agodecoder/vxlan: improvements and cleanups
Victor Julien [Wed, 26 Jun 2019 10:22:33 +0000 (12:22 +0200)] 
decoder/vxlan: improvements and cleanups

Implement port config handling. Also check both src port and dest
port for tunnels that only set the destination port to the VXLAN
port. At the point of the check we don't know the packet direction
yet.

Implement as Suricata tunnel similar to Teredo.

Cleanups.

6 years agodecoder/vxlan: initial implementation of decoder
Henrik Lund Kramshoej [Tue, 17 Jul 2018 05:37:12 +0000 (07:37 +0200)] 
decoder/vxlan: initial implementation of decoder

6 years agoappveyor: Remove enable-geoip from build script 4013/head
Shivani Bhardwaj [Thu, 4 Jul 2019 08:57:27 +0000 (14:27 +0530)] 
appveyor: Remove enable-geoip from build script

There is no GeoIP2 package for cygwin and the legacy format GeoIP has
been discontinued. This patch prevents appveyor to fail because of
unavailability of libmaxminddb GeoIP2 library.
References:
- https://support.maxmind.com/geolite-legacy-discontinuation-notice/
- https://cygwin.com/cgi-bin2/package-grep.cgi?grep=geoip&arch=x86_64

6 years agogeoip: fix unittests w/o db present
Victor Julien [Fri, 21 Jun 2019 19:40:20 +0000 (21:40 +0200)] 
geoip: fix unittests w/o db present

6 years agomem: avoid potential shadow vars with 'len' name
Victor Julien [Fri, 21 Jun 2019 13:50:36 +0000 (15:50 +0200)] 
mem: avoid potential shadow vars with 'len' name

6 years agomem: add SCStrndup() function to wrap strndup().
Bill Meeks [Fri, 21 Jun 2019 13:27:48 +0000 (09:27 -0400)] 
mem: add SCStrndup() function to wrap strndup().

6 years agodetect/geoip: migrate to GeoIP2 database format
Bill Meeks [Fri, 21 Jun 2019 13:26:01 +0000 (09:26 -0400)] 
detect/geoip: migrate to GeoIP2 database format

Issue #2765

6 years agorust: fix warnings about wrong type of comments
Victor Julien [Mon, 3 Jun 2019 07:47:23 +0000 (09:47 +0200)] 
rust: fix warnings about wrong type of comments

"rustdoc does not generate documentation for macro expansions"

6 years agorust: fix libc deprecation warnings for int types
Victor Julien [Mon, 3 Jun 2019 07:40:57 +0000 (09:40 +0200)] 
rust: fix libc deprecation warnings for int types

6 years agoikev2: clean up c glue code
Victor Julien [Fri, 31 May 2019 12:10:46 +0000 (14:10 +0200)] 
ikev2: clean up c glue code

6 years agotftp: c glue code cleanup
Victor Julien [Thu, 30 May 2019 19:54:28 +0000 (21:54 +0200)] 
tftp: c glue code cleanup

6 years agoikev2: remove excess new lines
Victor Julien [Thu, 30 May 2019 18:21:01 +0000 (20:21 +0200)] 
ikev2: remove excess new lines

6 years agotftp: properly implement tx handling
Victor Julien [Thu, 30 May 2019 18:20:33 +0000 (20:20 +0200)] 
tftp: properly implement tx handling

6 years agodetect/ssh: fix ssh.protoversion memory leak 3845/head
Victor Julien [Thu, 9 May 2019 10:11:29 +0000 (12:11 +0200)] 
detect/ssh: fix ssh.protoversion memory leak

6 years agodetect/ssh: mark old ssh keywords as deprecated
Victor Julien [Thu, 9 May 2019 10:06:50 +0000 (12:06 +0200)] 
detect/ssh: mark old ssh keywords as deprecated

Suggest alternative.

6 years agodetect/parse: add flag to indicate keyword is deprecated
Victor Julien [Thu, 9 May 2019 10:06:08 +0000 (12:06 +0200)] 
detect/parse: add flag to indicate keyword is deprecated

Issue warning when it is still used.

6 years agodetect: add verbosity of --list-keywords
Victor Julien [Tue, 27 Nov 2018 09:49:37 +0000 (10:49 +0100)] 
detect: add verbosity of --list-keywords

Add indicators of content modifier or sticky buffer, and also
allow registering an alternative to a keyword.

6 years agodetect: switch keyword flags u16
Victor Julien [Tue, 27 Nov 2018 09:03:48 +0000 (10:03 +0100)] 
detect: switch keyword flags u16

6 years agovalgrind: support hyperscan warning 3838/head
Victor Julien [Fri, 3 May 2019 05:13:00 +0000 (07:13 +0200)] 
valgrind: support hyperscan warning

Issue on Ubuntu 19.04.

==18655== Conditional jump or move depends on uninitialised value(s)
==18655==    at 0x5454603: hs_alloc_scratch (in /usr/lib/x86_64-linux-gnu/libhs.so.5.1.0)
==18655==    by 0x3D5C9A: SCHSPreparePatterns (util-mpm-hs.c:707)
==18655==    by 0x215FEC: DetectMpmPrepareBuiltinMpms (detect-engine-mpm.c:364)
==18655==    by 0x20813A: SigGroupBuild (detect-engine-build.c:1932)
==18655==    by 0x21287B: SigLoadSignatures (detect-engine-loader.c:366)
==18655==    by 0x35A702: LoadSignatures (suricata.c:2419)
==18655==    by 0x35B0DD: PostConfLoadedDetectSetup (suricata.c:2574)
==18655==    by 0x35C827: main (suricata.c:2986)

https://github.com/intel/hyperscan/issues/148

6 years agofilestore: fix dropping of unwanted files (Issue #2853)
magenbluten [Wed, 27 Feb 2019 09:14:17 +0000 (09:14 +0000)] 
filestore: fix dropping of unwanted files (Issue #2853)

6 years agofiles: open files with track id only
Victor Julien [Fri, 3 May 2019 10:10:14 +0000 (12:10 +0200)] 
files: open files with track id only

6 years agochangelog: update for 4.1.4 suricata-4.1.4
Victor Julien [Mon, 29 Apr 2019 14:29:29 +0000 (16:29 +0200)] 
changelog: update for 4.1.4

6 years agosmb/c: fix undefined behavior
Victor Julien [Tue, 2 Apr 2019 14:14:48 +0000 (16:14 +0200)] 
smb/c: fix undefined behavior

Reported-by: Sirko Höer -- Code Intelligence for DCSO.
6 years agonfs: fix integer underflow
Victor Julien [Tue, 2 Apr 2019 13:32:33 +0000 (15:32 +0200)] 
nfs: fix integer underflow

Fix int underflow that leads to Rust panic in NFS3 readdirplus
parsing.

Reported-by: Sirko Höer -- Code Intelligence for DCSO.
6 years agorunmodes: for test runmodes, clean up properly
Victor Julien [Mon, 29 Apr 2019 08:47:50 +0000 (10:47 +0200)] 
runmodes: for test runmodes, clean up properly

For conf test and engine analysis, clean up memory correctly.

This helps valgrind tests for leaks.

6 years agossl : SSLProbingParser overflow fix
Philippe Antoine [Wed, 27 Mar 2019 21:56:15 +0000 (22:56 +0100)] 
ssl : SSLProbingParser overflow fix

Found by fuzzing
Fixes ssl detection evasion by packet splitting

6 years agoparse/ip: fix potential oob write in ipv4 validation
Victor Julien [Mon, 15 Apr 2019 12:52:38 +0000 (14:52 +0200)] 
parse/ip: fix potential oob write in ipv4 validation

Found using AFL.

6 years agodhcp: verify client id len before parsing data
Jason Ish [Tue, 26 Mar 2019 22:46:27 +0000 (16:46 -0600)] 
dhcp: verify client id len before parsing data

Verify that the client id length is at least 2 per the DHCP
protocol rfc before parsing the data.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2902

6 years agorust/ftp: validate port components in passive reponse
Jason Ish [Tue, 26 Mar 2019 22:24:34 +0000 (16:24 -0600)] 
rust/ftp: validate port components in passive reponse

Make sure they are valid 8 bit integers before combining the
two parts into a u16 to prevent an overflow of the u16
return value.

Add unit tests to check parsing of invalid ports.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2904

6 years agompls: fix misaligned read
Jason Ish [Tue, 26 Mar 2019 22:28:17 +0000 (16:28 -0600)] 
mpls: fix misaligned read

Instead of casting the packet buffer to a uint32, memcpy it to
avoid misaligned read error, as caught by the undefined behavior
detector (ubsan).

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2903

6 years agorules: add mpls packet too small decoder rule
Jason Ish [Wed, 20 Mar 2019 12:45:49 +0000 (06:45 -0600)] 
rules: add mpls packet too small decoder rule

6 years agompls: check buffer length before peeking at next header
Jason Ish [Fri, 15 Mar 2019 23:13:00 +0000 (17:13 -0600)] 
mpls: check buffer length before peeking at next header

Check that we have enough bytes before peaking into the MPLS
packet payload.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2884

6 years agoethernet: fix next packet size on DCE packet
Jason Ish [Mon, 18 Mar 2019 06:47:30 +0000 (00:47 -0600)] 
ethernet: fix next packet size on DCE packet

Missing parans on the DCE length caused the length update
for the next call to DecodeEthernet to be wrong.

Tests added.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2887

6 years agossh: fix banner overflow issue
Victor Julien [Fri, 15 Mar 2019 13:01:40 +0000 (14:01 +0100)] 
ssh: fix banner overflow issue

Reported-by: Sirko Höer - Code Intelligence