Commit Graph

18061 Commits (841f2b21e652cacfa6c239486b767f61bfed89c4)
 

Author SHA1 Message Date
Victor Julien 20f14726e3 pop3: improve parsing
Improve multiline commands and SASL auth.

Work around missing support in crate for empty server challenge and SASL base64 data.

Ticket: #7709.
(cherry picked from commit acef961645)
5 months ago
Philippe Antoine 4b365af118 file: fix hash computation for small multipart files
Ticket: 8119

Fixes: f68e2f5537 ("files: append data on closing even with
FILE_NOSTORE")

(cherry picked from commit 8b9a779a16)
5 months ago
Pierre Chifflier d0e56b1b9d configure: fix binary crate name in hint message if bindgen is not found
(cherry picked from commit 459e2599c7)
5 months ago
Victor Julien 26d576d8fd thresholds: fix unittest compile warning
In file included from decode.h:33,
                 from host.h:27,
                 from util-threshold-config.c:34:
util-threshold-config.c: In function 'SCThresholdConfInitContext':
util-debug.h:260:5: warning: '%s' directive argument is null [-Wformat-overflow=]
  260 |     SCLogErr(SC_LOG_WARNING, __FILE__, __FUNCTION__, __LINE__, _sc_module, __VA_ARGS__)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util-threshold-config.c:190:9: note: in expansion of macro 'SCLogWarning'
  190 |         SCLogWarning("Error loading threshold configuration from %s", filename);
      |         ^~~~~~~~~~~~
util-threshold-config.c:190:66: note: format string is defined here
  190 |         SCLogWarning("Error loading threshold configuration from %s", filename);
      |                                                                  ^~

(cherry picked from commit 3a0f4dde07)
5 months ago
Victor Julien 3f88e5c64c unix-socket/hostbits: fix ipv6 address parsing
In `add-hostbit`, `remove-hostbit` and `list-hostbit` commands, the IPv6
address parsing was not using the correct variable:

                 from /usr/include/dirent.h:25,
                 from suricata-common.h:73,
                 from runmode-unix-socket.c:18:
In function ‘inet_pton’,
    inlined from ‘UnixSocketHostbitAdd’ at runmode-unix-socket.c:1316:13:
/usr/include/x86_64-linux-gnu/bits/inet-fortified.h:56:10: warning: call to ‘__inet_pton_chk_warn’ declared with attribute warning: inet_pton called with a destination buffer size too small [-Wattribute-warning]
   56 |   return __glibc_fortify (inet_pton, __sz, sizeof (char),
      |          ^~~~~~~~~~~~~~~
In function ‘inet_pton’,
    inlined from ‘UnixSocketHostbitRemove’ at runmode-unix-socket.c:1403:13:
/usr/include/x86_64-linux-gnu/bits/inet-fortified.h:56:10: warning: call to ‘__inet_pton_chk_warn’ declared with attribute warning: inet_pton called with a destination buffer size too small [-Wattribute-warning]
   56 |   return __glibc_fortify (inet_pton, __sz, sizeof (char),
      |          ^~~~~~~~~~~~~~~
In function ‘inet_pton’,
    inlined from ‘UnixSocketHostbitList’ at runmode-unix-socket.c:1476:13:
/usr/include/x86_64-linux-gnu/bits/inet-fortified.h:56:10: warning: call to ‘__inet_pton_chk_warn’ declared with attribute warning: inet_pton called with a destination buffer size too small [-Wattribute-warning]
   56 |   return __glibc_fortify (inet_pton, __sz, sizeof (char),
      |          ^~~~~~~~~~~~~~~

Bug: #8102.
(cherry picked from commit 874a0e8d3d)
5 months ago
Philippe Antoine da8e37b2b8 fuzz/conf: bail out on long sequence of scalars
Ticket: 8105
(cherry picked from commit 9d164d8794)
5 months ago
Jeff Lucovsky dc2faaa895 nfs: Support EXCLUSIVE4_1 flag
Issue: 8006

Support the EXCLUSIVE4_1 create mode added to NFS 4.1

(cherry picked from commit e1bf5cb1f3)
5 months ago
Philippe Antoine f8f3cfd6d1 util/time: fix TimeDifferenceMicros microseconds computation
Ticket: 8073

Currently only used in pcap logging for flushing

(cherry picked from commit b21c93d789)
5 months ago
Jeff Lucovsky 9fa7756ba7 doc/luaxform: Remove init function from example
Issue: 8035

The `luaxform` transform doesn't support the `init` function. This
commit removes that from the example and clarifies how functions in the
Lua script are used.

(cherry picked from commit b02d9bb4f1)
5 months ago
Shivani Bhardwaj 2cfc2f4dc0 version: start development towards 8.0.3 5 months ago
Shivani Bhardwaj 79db7b1ad4 release: 8.0.2; update changelog 6 months ago
Juliana Fajardini 482e5eac92 output/alert: fix alert index access for verdict
The engine uses p.alerts.cnt as an index to access the packet alert that
has the `pass` action for the verdict.
For IDS/IPS mode, a `pass` will always be the last signature in the
alert queue. However, that position could be either `p.alerts.cnt` or
`p.alerts.cnt-1`, depending on whether the `pass` rule has the `alert`
keyword or not.
This patch fix corner-case scenarios of:
- accessing an index out of boundaries
- off-by-one access
Without changing how the engine increments the alerts.cnt, as this is
used in many places, and would be a more invasive change.
It checks the two different scenarios, plus the case when there is only
a single match as a silent `pass` rule.

Bug #8021
Bug #7630
6 months ago
Philippe Antoine efe7aeb145 output/http: log content-type like other headers
Ticket: 8056

Avoid stack allocation.
Do not handle null and ; especially

(cherry picked from commit b8411fcc8d)
6 months ago
Philippe Antoine 8999eb1f93 unix-socket: return after closing on too long
Avoids later use after free

Ticket: 8063
(cherry picked from commit acc051ac94)
6 months ago
Philippe Antoine ad446c9006 util/swf: move allocation from stack to heap
As it can overflow the stack

Ticket: 8055
(cherry picked from commit a84addb771)
6 months ago
Philippe Antoine 00f04daa3a htp: bound decompression
Ticket: 7980

Usage of Vec<u8> instead of Box<u8> gave the ability to callers
to grow the buffer (indefinitely)
This was regressed in 16fee33368

Additionnaly, use rust WriteZero instead of WouldBlock as a more
fitting error when cursor is full, as that error kind is the
one tested by callers.

(cherry picked from commit f2b6540c52)
6 months ago
Li Heng 002bd1f1ee snmp: can be set to detection-only
Realloc alp_ctx.ctxs when a dynamic alproto is registered and
g_alproto_max increases. So dynamic alproto can be treated as
real/normal ones. And app-layer switch can be set to any value
of no/deteciton-only/yes.

Ticket: 8000
(cherry picked from commit c141c55bc6)
6 months ago
Andreas Dolp 7dbae32eda python/Makefile.am: fix file permissions of python/suricata/config/defaults.py
The install command, by default, sets 0755 if -m is not specified, so the
file python/suricata/config/defaults.py will be marked as an executable,
though it isn't.

(cherry picked from commit fcbae97a1f)
6 months ago
Victor Julien d3aa4dd85e exception-policy: rename 'reject-both' to 'rejectboth'
To align it with the rule action.

(cherry picked from commit ec65fd430e)
6 months ago
Victor Julien 879561859b doc/userguide: document reject-both expection policy
Ticket: #5974.
(cherry picked from commit 0c4a8fd183)
6 months ago
Victor Julien 4905f38470 exception-policy: add 'reject-both' option
Allow rejecting both sides of a connection. Has the same support
as regular reject (which is essentially rejectsrc).

Ticket: #5974.
(cherry picked from commit acb769291a)
6 months ago
Philippe Antoine 647bfad14d output/jsonbuilder: helper function SCJbSetPrintAsciiString
To replace C PrintStringsToBuffer and avoid a stack alloc
+ copy

Ticket: 8004
(cherry picked from commit 7447651fa0)
6 months ago
Victor Julien d364b04a59 lua: remove luajit pushlstring workaround
81ee6f5aad ("lua: push correct length back through ScFlowvarGet, work around valgrind warning")
added a workaround for valgrind warnings in pushing a string buffer
into the lua state. This is no longer needed as tested with both
address sanitizer and valgrind.

(cherry picked from commit 52fd61dffd)
6 months ago
Jason Ish 88077adbe0 doc/devguide: document eve callback
Document the callback for adding additional data to EVE.

Ticket: #4708
(cherry picked from commit cdd4ea0f11)
6 months ago
Jason Ish 8de8019e03 doc/devguide: document eve file types
Ticket: #4708
(cherry picked from commit 9fffc09ad7)
6 months ago
Juliana Fajardini 183cd8a2d2 output/eve: fix typos
To accompany documentation work done in

Task #4708

(cherry picked from commit 6b75b937ff)
6 months ago
Jason Ish 8eb349e08d requirements.txt: update to suricata-update 1.3.7 6 months ago
Philippe Antoine 02ef2655f9 util/var: add NULL check in VarNameStoreRegister
And check return value in entropy keyword setup

(cherry picked from commit 854201703e)
6 months ago
Philippe Antoine c935f08cd9 detect: fix null deref with entropy keyword
Ticket: 7959

Usage of entropy with base64_data led to NULL dereference

(cherry picked from commit 6d703af505)
6 months ago
Jeff Lucovsky ee3900f92d detect/ip.src: Allow use with transforms
This commit registers ip.src/ip.dst properly so they can be used with
transforms.

Issue: 8015
(cherry picked from commit 7e0d6f4a1e)
6 months ago
Amir Boussejra f30989e8c9 flow-timeout: Use yaml config value for CAPTURE_BYPASSED flow
Instead of non configurable constant FLOW_BYPASSED_TIMEOUT

Ticket: #8014
(cherry picked from commit 56c8db6cb6)
6 months ago
Shivani Bhardwaj a6f9ca15b9 applayer/tls: do not free SAN for decoding error
SSL connp maintains all the state and certificate data that was
parsed/decoded successfully and it must retain that for later usage.
There should be just one place to free this object which is SSLStateFree
for both the directions. By freeing the connp data during parsing error,
there is room for memory errors.
This works so far because the field parsed after this cannot error out so
if there's an error parsing this, it anyway does not exist. However, this
is incorrect and leaves scope for mistakes.

Remove this extra free and treat SAN like all other TLS keywords.

Bug 7996

(cherry picked from commit b090fc61fd)
6 months ago
Lukas Sismis 64fa747b6a github-ci: build-test DPDK v23.11.x and v24.11.x
Ticket: 7978
(cherry picked from commit 7ca95eeec0)
6 months ago
Lukas Sismis 1f0b3dad24 github-ci: bump up tested DPDK versions
Ubuntu 20.04, distro suited at the time for 8.0.x, still contains
DPDK 19.11 in the pkg repository, so it keeps being build-tested as
opposed to the 9.0.x version.

(cherry picked from commit ee0b08692c)
6 months ago
Lukas Sismis 7c08dea05c dpdk: supress a warning of the bond function
DPDK Bonding API has been changed in DPDK version 23.11 where
the old *slave* API was marked as deprecated and the new *member*
API was marked as experimental.
This was unfortunately executed by marking both API variants
at the same time. The deprecated version is removed from the follow
up versions while the experimental version will become stable
in the next DPDK releases. This is based on a policy in DPDK where
an API change needs to merged in main for 1 stable release before
removing the experimental flag.

In DPDK 24.11 this has been fixed and warning supression is not
added.

Ticket: 7990
(cherry picked from commit 27383f878d)
6 months ago
Lukas Sismis 5b8f14a67f dpdk: fix the CPU exclude logic
The exclude function incorrectly performs a XOR operation. While it
works when the worker cores occupy all cores, it is not the correct
operation. For example, when a core is affined to only management
and not worker threads, the XOR operation affines it to the worker set.
(1 XOR 0 -> 1, where in fact the desired outcome is 0)

Ticket: 7976
(cherry picked from commit 8f63094744)
6 months ago
Victor Julien 84c3fdc5f4 doc/userguide: add rule hooks to protocol doc
Ticket #7662.

(cherry picked from commit be5c83ed53)
6 months ago
Victor Julien da9d0fbad6 doc/userguide: add xbits tx scope support
Ticket #7680.

(cherry picked from commit 480e664b4c)
6 months ago
Jeff Lucovsky a1f5c67211 doc/output: Highlight ethertype value change
Issue: 8007

Highlight the change to how ether_type values are displayed. Previously,
they were displayed in network order as a decimal value.

They are now displayed in host order as a decimal value.

(cherry picked from commit 16d124cfda)
6 months ago
Jeff Lucovsky e8261f4c55 output: Display ethertype properly
Ethertype values are now converted from network format to host format
before display occurs. Displayed values are now in hex instead of
integers.

Without this change, ethertype values such as 0xfbb7 are
displayed in decimal as: 47099 (0xb7fb).

The actual value is 64439 (0xfbb7); all logged ether_type values
will be displayed in host order in decimal format. This example
will log the ether type as 64439

Issue: 7855
(cherry picked from commit 0af7793410)
6 months ago
Victor Julien 24b5bee821 pcap-log: fix bpf-filter not set for multi mode
Bug: #8002.
(cherry picked from commit 2f633be1a9)
6 months ago
Jason Ish 7e3b646707 ci: remove cargo update test
Being the stable branch, cargo update doesn't make much sense unless we
have a specific reason to update a crate. The audit check has been
left, which will alert us to crates that may need an update.
6 months ago
Jason Ish a4f722fca0 doc/userguide: add a known issues page
The idea of this page is to track known issues on a release branch
that we do not plan to fix.
6 months ago
Jason Ish 35464150de ike: don't log duplicate attributes
Track what attributes have been logged and skip over duplicate
attributes to avoid having duplicate fields in the JSON object, which
is invalid JSON.

This is lossy, subsequent attributes are lost.

Ticket: #7923
6 months ago
Jason Ish 7e6084e44f ike/detect: info log message should be debug
(cherry picked from commit b543e28402)
6 months ago
Philippe Antoine 77057e1cd8 http2: add INTERNAL_ERROR for http2.error_code keyword 6 months ago
Philippe Antoine 77d5c7c324 http2: fix parsing of goaway frames
There was a last stream id before the error code
As per section 6.8 of RFC 7540

Ticket: 7991
(cherry picked from commit 9a4a29e218)
6 months ago
Andreas Dolp 3e071d73c6 doc: fix typo duplicate 'of'
Thanks to catenacyber

(cherry picked from commit 37d748d441)
6 months ago
Andreas Dolp 58c46937ee doc: fix typo /var/run/suricata in file permissions docs.
(cherry picked from commit 375b5dd306)
6 months ago
Andreas Dolp c92eb0131a doc: fix typo and missing newline in rules/ssh_keywords.
(cherry picked from commit cc590b54c7)
6 months ago