]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
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
6 years agosmtp: rset command resets bdat chunks length
Philippe Antoine [Thu, 18 Apr 2019 14:04:50 +0000 (16:04 +0200)] 
smtp: rset command resets bdat chunks length

Fixes #1860

6 years agoalert/unified2: remove useless packed attributes
Victor Julien [Fri, 29 Mar 2019 13:44:36 +0000 (14:44 +0100)] 
alert/unified2: remove useless packed attributes

6 years agodecode: remove useless packed attributes
Victor Julien [Fri, 29 Mar 2019 13:44:15 +0000 (14:44 +0100)] 
decode: remove useless packed attributes

6 years agoopenbsd: fix rust linking
Victor Julien [Sat, 13 Apr 2019 13:34:49 +0000 (15:34 +0200)] 
openbsd: fix rust linking

6 years agodetect/http-client-body: convert to inspect api v2 3757/head
Victor Julien [Thu, 13 Dec 2018 10:29:15 +0000 (11:29 +0100)] 
detect/http-client-body: convert to inspect api v2

6 years agodetect/http-client-body: code cleanups and test cleanups
Victor Julien [Thu, 13 Dec 2018 06:59:20 +0000 (07:59 +0100)] 
detect/http-client-body: code cleanups and test cleanups

6 years agosmb1: fix NT create andx records filename parsing
Victor Julien [Fri, 22 Mar 2019 10:57:52 +0000 (11:57 +0100)] 
smb1: fix NT create andx records filename parsing

Use file name parsing routines that take unicode into account
and consider padding bytes as well.

6 years agosmb: fix NT create filename parsing
Wesley van der Ree [Thu, 21 Mar 2019 13:48:18 +0000 (14:48 +0100)] 
smb: fix NT create filename parsing

parse_smb_create_andx_request_record skipped 1 byte too much before
the filename.

Fixes: #2894
6 years agoapp-layer/pd: set offset and depth in mpm
Victor Julien [Fri, 22 Mar 2019 19:19:31 +0000 (20:19 +0100)] 
app-layer/pd: set offset and depth in mpm

6 years agopcap-log: Don't leak memory in LZ4 error paths
Max Fillinger [Mon, 11 Mar 2019 09:51:00 +0000 (10:51 +0100)] 
pcap-log: Don't leak memory in LZ4 error paths

6 years agoAvoid use-after-free during pid file cleanup.
Alexander Bluhm [Mon, 18 Mar 2019 13:06:39 +0000 (14:06 +0100)] 
Avoid use-after-free during pid file cleanup.

In case the pid file is given in the config file, the file name is
stored in volatile memory.  Removal of the pid file happens after
cleanup of config memory.  Create a copy of the name which will be
freed after the pid file has been removed.

6 years agoapp-layer/pd: free memory
Victor Julien [Thu, 21 Mar 2019 11:06:07 +0000 (12:06 +0100)] 
app-layer/pd: free memory

6 years agodetect: remove BUG_ON from packet path
Victor Julien [Mon, 18 Mar 2019 09:35:45 +0000 (10:35 +0100)] 
detect: remove BUG_ON from packet path

6 years agodetect: fix match array reset
Victor Julien [Mon, 18 Mar 2019 09:34:03 +0000 (10:34 +0100)] 
detect: fix match array reset

Fix match array reset depending on prefilter matches for the
current run. If there were none, the match array of the previous
packet was used. This could lead to inspection of rules from the
wrong rule group.

6 years agoapp-layer/profile: fix udp protocol detection profiling
Victor Julien [Sat, 16 Mar 2019 17:04:16 +0000 (18:04 +0100)] 
app-layer/profile: fix udp protocol detection profiling

6 years agoFix memory leak with TOS handling
Jeff Lucovsky [Sat, 9 Mar 2019 15:28:27 +0000 (07:28 -0800)] 
Fix memory leak with TOS handling

Use `pcre_copy_substring` to avoid memory allocations when parsing
TOS values.

6 years agopfring: update bpf error handling to be consistent
jason taylor [Thu, 14 Mar 2019 00:41:00 +0000 (20:41 -0400)] 
pfring: update bpf error handling to be consistent

* updated bpf error handling to be consistent with af-packet
* minor internal doc updates

Signed-off-by: jason taylor <jtfas90@gmail.com>
6 years agodetect-iprep: fix memory leaks
Giuseppe Longo [Sat, 9 Mar 2019 21:36:03 +0000 (22:36 +0100)] 
detect-iprep: fix memory leaks

Loading rules with iprep keyword cause
memory leaks due to missing frees.

Direct leak of 8 byte(s) in 4 object(s) allocated from:
    #0 0x7f81c862bd28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28)
    #1 0x7f81c6afea69 in pcre_get_substring (/lib/x86_64-linux-gnu/libpcre.so.3+0x27a69)
    #2 0x43206f7420676e68  (<unknown module>)

SUMMARY: AddressSanitizer: 8 byte(s) leaked in 4 allocation(s).

6 years agoflow-bypass: set thread name to FB
Eric Leblond [Wed, 6 Mar 2019 13:41:47 +0000 (14:41 +0100)] 
flow-bypass: set thread name to FB

6 years agosuricata.yaml: fix name of encryption-handling var
Eric Leblond [Thu, 12 Jul 2018 19:28:20 +0000 (21:28 +0200)] 
suricata.yaml: fix name of encryption-handling var