]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
11 days agoapplayer/tls: do not free SAN for decoding error 14145/head 14195/head
Shivani Bhardwaj [Sat, 11 Oct 2025 08:45:37 +0000 (14:15 +0530)] 
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 b090fc61fd11a90113c0d8793b2ef97b6e273068)

2 weeks agogithub-ci: build-test DPDK v23.11.x and v24.11.x 14122/head
Lukas Sismis [Sun, 3 Nov 2024 19:04:25 +0000 (20:04 +0100)] 
github-ci: build-test DPDK v23.11.x and v24.11.x

Ticket: 7978
(cherry picked from commit 7ca95eeec059d751c6c42292441b6bd08413f0af)

2 weeks agogithub-ci: bump up tested DPDK versions
Lukas Sismis [Sun, 3 Nov 2024 19:09:55 +0000 (20:09 +0100)] 
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 ee0b08692cf3ea1aae3bb694f7e738630e2979ac)

2 weeks agodpdk: supress a warning of the bond function
Lukas Sismis [Sun, 8 Sep 2024 20:46:01 +0000 (22:46 +0200)] 
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 27383f878d20c9cacc74d2382c9e957072b92759)

2 weeks agodpdk: fix the CPU exclude logic
Lukas Sismis [Sun, 7 Apr 2024 20:04:06 +0000 (22:04 +0200)] 
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 8f6309474431e6ecee5b62387d1ae4559e627f97)

2 weeks agodoc/userguide: add rule hooks to protocol doc
Victor Julien [Thu, 18 Sep 2025 10:48:38 +0000 (12:48 +0200)] 
doc/userguide: add rule hooks to protocol doc

Ticket #7662.

(cherry picked from commit be5c83ed53bcc2df1620df36d49365d3d49a1708)

2 weeks agodoc/userguide: add xbits tx scope support
Victor Julien [Tue, 23 Sep 2025 12:22:57 +0000 (14:22 +0200)] 
doc/userguide: add xbits tx scope support

Ticket #7680.

(cherry picked from commit 480e664b4caf34efe8cf9cc883756528bc069760)

2 weeks agodoc/output: Highlight ethertype value change 14107/head
Jeff Lucovsky [Sun, 5 Oct 2025 13:33:14 +0000 (09:33 -0400)] 
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 16d124cfda2ce46bbba81beabfd4a6ea27daca43)

2 weeks agooutput: Display ethertype properly
Jeff Lucovsky [Fri, 3 Oct 2025 14:18:03 +0000 (10:18 -0400)] 
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 0af77934100df64c8d050cc162cd133344c19838)

2 weeks agopcap-log: fix bpf-filter not set for multi mode 14089/head
Victor Julien [Thu, 16 Oct 2025 11:08:19 +0000 (13:08 +0200)] 
pcap-log: fix bpf-filter not set for multi mode

Bug: #8002.
(cherry picked from commit 2f633be1a9771cac055688693e9367c444d4000e)

2 weeks agoci: remove cargo update test 14082/head
Jason Ish [Sun, 19 Oct 2025 01:00:51 +0000 (19:00 -0600)] 
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.

2 weeks agodoc/userguide: add a known issues page 14073/head 14074/head
Jason Ish [Thu, 16 Oct 2025 22:52:27 +0000 (16:52 -0600)] 
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.

3 weeks agoike: don't log duplicate attributes
Jason Ish [Thu, 16 Oct 2025 22:42:45 +0000 (16:42 -0600)] 
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

3 weeks agoike/detect: info log message should be debug
Jason Ish [Thu, 25 Sep 2025 17:02:08 +0000 (11:02 -0600)] 
ike/detect: info log message should be debug

(cherry picked from commit b543e28402971f74dfd338d4598ee28bba340578)

3 weeks agohttp2: add INTERNAL_ERROR for http2.error_code keyword 14039/head
Philippe Antoine [Wed, 15 Oct 2025 18:25:45 +0000 (20:25 +0200)] 
http2: add INTERNAL_ERROR for http2.error_code keyword

3 weeks agohttp2: fix parsing of goaway frames
Philippe Antoine [Thu, 9 Oct 2025 18:32:00 +0000 (20:32 +0200)] 
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 9a4a29e2189fbd8e5bf47d00b0bcdecaf2aa7d04)

3 weeks agodoc: fix typo duplicate 'of'
Andreas Dolp [Wed, 17 Sep 2025 19:18:18 +0000 (21:18 +0200)] 
doc: fix typo duplicate 'of'

Thanks to catenacyber

(cherry picked from commit 37d748d44182d387ccf0b6a66eae84a7b1e2844a)

3 weeks agodoc: fix typo /var/run/suricata in file permissions docs.
Andreas Dolp [Tue, 16 Sep 2025 18:22:57 +0000 (20:22 +0200)] 
doc: fix typo /var/run/suricata in file permissions docs.

(cherry picked from commit 375b5dd3067beb83b70e725c305a0dc08ee79efa)

3 weeks agodoc: fix typo and missing newline in rules/ssh_keywords.
Andreas Dolp [Sat, 17 Sep 2022 09:16:03 +0000 (11:16 +0200)] 
doc: fix typo and missing newline in rules/ssh_keywords.

(cherry picked from commit cc590b54c748174c07d88e0e3846601c28e934a5)

3 weeks agodoc: fix doc syntax error in rate_filter example.
Andreas Dolp [Tue, 2 Aug 2022 09:35:22 +0000 (11:35 +0200)] 
doc: fix doc syntax error in rate_filter example.

(cherry picked from commit 228abb7da094523a07952d18c6899b4cf95e7129)

3 weeks agodpdk: fix assignment of pkt_mempools to ldev
Adam Kiripolsky [Wed, 3 Sep 2025 12:12:45 +0000 (14:12 +0200)] 
dpdk: fix assignment of pkt_mempools to ldev

Removed loop around assignment of pkt_mempools
to ldev_instance->dpdk_vars as it is not needed anymore.

Ticket: 7879
(cherry picked from commit 5a4d280461ace9dc835ea277a822a41f43e50984)

3 weeks agoscripts: setup app layer rustfmt mod.rs last
Philippe Antoine [Fri, 26 Sep 2025 12:03:39 +0000 (14:03 +0200)] 
scripts: setup app layer rustfmt mod.rs last

Otherwise rustfmt complains that parser.rs does not exist yet

(cherry picked from commit f7f8fbc116d76d7ec7d8e80e2a46222f10118a51)

3 weeks agodetect/content: don't leak replace memory
Victor Julien [Sat, 11 Oct 2025 05:40:50 +0000 (07:40 +0200)] 
detect/content: don't leak replace memory

Replace keyword updates a prior content with a heap allocation of the
pattern the content should be replaced with. Make sure this is freed as
well.

Bug: #7997.
(cherry picked from commit ce9c7a024efe74656e7b054a5fb93718901ae7f3)

3 weeks agooutput: fix long logline test
Victor Julien [Sat, 11 Oct 2025 18:06:24 +0000 (20:06 +0200)] 
output: fix long logline test

Fixes: 023a2fe9ab1f ("unittests: fix format-truncation warning")
(cherry picked from commit b7650a45fa935d9b204490eceac98a535663b8ff)

3 weeks agounittests: disable LogCustomFormatTest01 for MinGW
Victor Julien [Wed, 8 Oct 2025 12:12:55 +0000 (14:12 +0200)] 
unittests: disable LogCustomFormatTest01 for MinGW

Test was previously not run so it was missed that it fails.

(cherry picked from commit c8cb029de9fd9e03f81f83286d0f0afa25c9b7ec)

3 weeks agounittests: don't leak memory with --list-unittests
Victor Julien [Mon, 6 Oct 2025 09:45:36 +0000 (11:45 +0200)] 
unittests: don't leak memory with --list-unittests

(cherry picked from commit 57d1f20dfaa8144c6938cb7487f5ceaaf57181ef)

3 weeks agodetect/files: support protocols only over udp
Philippe Antoine [Mon, 22 Sep 2025 13:41:39 +0000 (15:41 +0200)] 
detect/files: support protocols only over udp

Ticket: 7973

Files were supported on both TCP and UDP. But file detection keywords
such as file.data made signatures loading fail if the signature
was using an app-layer protocol that enabled on udp only, even
if the signatures could run smoothly.

(cherry picked from commit c99e15934104bee6a68258770736fb6e481cf5a6)

4 weeks agodecoder/vxlan: fix VXLAN port detection per RFC 7348 14001/head
Fupeng Zhao [Tue, 24 Jun 2025 06:27:26 +0000 (14:27 +0800)] 
decoder/vxlan: fix VXLAN port detection per RFC 7348

Simplify DecodeVXLANEnabledForPort() to only check destination port
to avoids false positives when identifying VXLAN traffic.

Per RFC 7348 ยง5, VXLAN identification is based solely on the outer UDP
destination port (4789), regardless of inner packet direction. The
outer UDP source port is used for load balancing via inner packet
hash and should not be considered for VXLAN detection. This ensures
correct VXLAN identification for all encapsulated traffic patterns.

Checking both source and destination ports could incorrectly classify
non-VXLAN UDP traffic as VXLAN when the source port happens to be 4789,
leading to false positives in VXLAN detection and potential decode errors.

(cherry picked from commit 7a04a032b9387c85321a24a4105700c288aee5e6)

4 weeks agodoc/install: fix minor typo 13981/head
Juliana Fajardini [Tue, 7 Oct 2025 14:18:22 +0000 (11:18 -0300)] 
doc/install: fix minor typo

4 weeks agodoc: remove outdated GITGUIDE
Juliana Fajardini [Tue, 7 Oct 2025 14:18:10 +0000 (11:18 -0300)] 
doc: remove outdated GITGUIDE

4 weeks agomime: retain some stateful data for quoted-printable 13976/head
Philippe Antoine [Mon, 29 Sep 2025 13:11:41 +0000 (15:11 +0200)] 
mime: retain some stateful data for quoted-printable

In case a sequence like =3D is split over 2 calls to SCSmtpMimeParseLine

Ticket: 7950
(cherry picked from commit 56e08c9134236ed851ccab3430219ca60354b455)

5 weeks agoci/mt: Include MT tests in CI workflows 13942/head 13962/head
Jeff Lucovsky [Tue, 30 Sep 2025 12:27:15 +0000 (08:27 -0400)] 
ci/mt: Include MT tests in CI workflows

Add the MT live tests to the CI workflow.

(cherry picked from commit 846eb44a9de96134202e12e6f0384161a0ac431f)

5 weeks agomt/ci: Add MT live test
Jeff Lucovsky [Sat, 27 Sep 2025 12:00:15 +0000 (08:00 -0400)] 
mt/ci: Add MT live test

Add MT live test capability:
- multi-tenant.sh: harness that sets up and steps through MT steps
- suricata-mt.yaml: Adds MT capability to Suricata
- tenant-1.yaml: Per-tenant configuration file

(cherry picked from commit 51c9609c7c7d56082b8f5939c2f4bf11cfb99613)

5 weeks agogithub-actions: add validate cherry-pick line check 13917/head
Victor Julien [Fri, 26 Sep 2025 18:41:22 +0000 (20:41 +0200)] 
github-actions: add validate cherry-pick line check

6 weeks agolua: fix null dereference in tx HTTP accessor functions 13912/head
Cheng Longfei [Wed, 30 Jul 2025 05:50:01 +0000 (13:50 +0800)] 
lua: fix null dereference in tx HTTP accessor functions

Fix crashes in Lua when calling tx:response_line(), tx:request_line(),
tx:request_uri_raw(), or tx:request_host() on incomplete or malformed
HTTP transactions.

These functions return bstr pointers which may be NULL. Add NULL
checks before calling bstr_ptr() and bstr_len() to avoid segfaults.

Ticket: #7829
(cherry picked from commit 9fb33bbaf6902cf4f0498b52330e2bb85cba974c)

7 weeks agodoc: really enforce more the completeness of json schema 13863/head
Philippe Antoine [Sun, 14 Sep 2025 19:50:12 +0000 (21:50 +0200)] 
doc: really enforce more the completeness of json schema

Completes commit f1f32a39eebe16dbedf9189714772a5915e83f3f

End better describe exception_policy

7 weeks agogithub-actions: bump codecov/codecov-action from 5.5.0 to 5.5.1
dependabot[bot] [Wed, 17 Sep 2025 02:18:37 +0000 (02:18 +0000)] 
github-actions: bump codecov/codecov-action from 5.5.0 to 5.5.1

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.0 to 5.5.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/fdcc8476540edceab3de004e990f80d881c6cc00...5a1091511ad55cbe89839c7260b706298ca349f7)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
7 weeks agogithub-actions: bump actions/github-script from 7.0.1 to 8.0.0
dependabot[bot] [Wed, 17 Sep 2025 02:18:37 +0000 (02:18 +0000)] 
github-actions: bump actions/github-script from 7.0.1 to 8.0.0

Bumps [actions/github-script](https://github.com/actions/github-script) from 7.0.1 to 8.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/60a0d83039c74a4aee543508d2ffcb1c3799cdea...ed597411d8f924073f98dfc5c65a23a2325f34cd)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
7 weeks agogithub-actions: bump github/codeql-action from 3.30.0 to 3.30.3
dependabot[bot] [Wed, 17 Sep 2025 01:29:11 +0000 (01:29 +0000)] 
github-actions: bump github/codeql-action from 3.30.0 to 3.30.3

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.0 to 3.30.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.30.0...v3.30.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
7 weeks agoversion: start development towards 8.0.2 13862/head
Shivani Bhardwaj [Wed, 17 Sep 2025 03:53:34 +0000 (09:23 +0530)] 
version: start development towards 8.0.2

7 weeks agodoc: adjust for master to main rename 13857/head 13860/head
Victor Julien [Tue, 16 Sep 2025 15:20:56 +0000 (17:20 +0200)] 
doc: adjust for master to main rename

7 weeks agoclang-format: adjust for master to main rename 13855/head
Victor Julien [Tue, 16 Sep 2025 13:09:50 +0000 (15:09 +0200)] 
clang-format: adjust for master to main rename

7 weeks agogithub-action: adjust for master to main rename
Victor Julien [Tue, 16 Sep 2025 13:07:51 +0000 (15:07 +0200)] 
github-action: adjust for master to main rename

7 weeks agorelease: 8.0.1; update changelog suricata-8.0.1
Jason Ish [Tue, 16 Sep 2025 00:55:42 +0000 (18:55 -0600)] 
release: 8.0.1; update changelog

7 weeks agodetect/mpm: prevent format string truncation warnings
Jason Ish [Mon, 15 Sep 2025 22:01:37 +0000 (16:01 -0600)] 
detect/mpm: prevent format string truncation warnings

- Declare the profiling name variable once we know the actual size allowed
for the name instead of before. Prevents an snprintf truncation warning.

- Account for the null byte when calculating how much space is left to
avoid an snprintf format string truncation warning.

7 weeks agodetect/mpm: improve profiling name for frame/pkt buffers
Victor Julien [Fri, 12 Sep 2025 12:41:05 +0000 (14:41 +0200)] 
detect/mpm: improve profiling name for frame/pkt buffers

7 weeks agodetect/mpm: improve profiling name creation
Victor Julien [Fri, 12 Sep 2025 12:21:36 +0000 (14:21 +0200)] 
detect/mpm: improve profiling name creation

The (p)name is used in profiling and will now always have the full id.

Ticket: #7861.

7 weeks agomisc: harden string shortener
Victor Julien [Fri, 12 Sep 2025 12:20:31 +0000 (14:20 +0200)] 
misc: harden string shortener

Ticket: #7861.

7 weeks agodetect/tls: fix null deref with subjectaltname
Philippe Antoine [Wed, 3 Sep 2025 20:07:27 +0000 (22:07 +0200)] 
detect/tls: fix null deref with subjectaltname

Ticket: 7881

7 weeks agodetect/entropy: Ensure entropy matcher has flow
Jeff Lucovsky [Tue, 12 Aug 2025 12:13:56 +0000 (08:13 -0400)] 
detect/entropy: Ensure entropy matcher has flow

Make sure that the flow is available to the entropy matcher so it can
handle content that's not anchored to a sticky buffer.

Issue: 7838

7 weeks agodoc/userguide: add ips chapter; add concept 13846/head
Victor Julien [Thu, 3 Jul 2025 13:31:51 +0000 (15:31 +0200)] 
doc/userguide: add ips chapter; add concept

Move setup guides into the new chapter as well.

Explain `stream.inline` logic.

Ticket: #5513.
Ticket: #6284.

7 weeks agodoc: upgrade note about keyword tls.cert_subject
Philippe Antoine [Tue, 9 Sep 2025 12:44:16 +0000 (14:44 +0200)] 
doc: upgrade note about keyword tls.cert_subject

Following commit 5379b52af2df9eb2911fc4655d5db5defcecb863
rules that use multiple times the keyword tls.cert_subject
will result in

Warning: detect: duplicate instance for tls.cert_subject

These rules likely meant to use a multi-buffer which is not the
case for tls.cert_subject (even if it was documented so).

Ticket: 7890

This is put in a new section of upgrade notes for
upgrading to 8.0.1

7 weeks agodoc/rules/index: keep rule types doc near the end 13843/head
Juliana Fajardini [Fri, 20 Jun 2025 02:33:39 +0000 (23:33 -0300)] 
doc/rules/index: keep rule types doc near the end

As this chapter is more meta than about rule keywords, keep it by the
end of the index, to have some semantic separation from the other
sections.

7 weeks agouserguide: document how suricata processes rules
Juliana Fajardini [Thu, 21 Jul 2022 20:44:59 +0000 (17:44 -0300)] 
userguide: document how suricata processes rules

Added a page that explains how rules are prioritized by Suri, as well
as what main different types of inspection happen and what elements are
involved when ordering rules.

Task #5449

7 weeks agounix-socket: address scan-build warning
Victor Julien [Wed, 10 Sep 2025 14:06:11 +0000 (16:06 +0200)] 
unix-socket: address scan-build warning

  CC       unix-manager.o
unix-manager.c:258:13: warning: Use of memory after it is freed [unix.Malloc]
  258 |         if (item->fd == fd) {
      |             ^~~~~~~~
1 warning generated.

7 weeks agounix-socket: fix memory leak on client disconnect
Victor Julien [Wed, 10 Sep 2025 11:35:51 +0000 (13:35 +0200)] 
unix-socket: fix memory leak on client disconnect

If a client loses the connection during a reload it initiated there is
a small memory leak.

Bug: #7891.

7 weeks agoci: check json schema sets always additionalProperties
Philippe Antoine [Mon, 8 Sep 2025 19:05:33 +0000 (21:05 +0200)] 
ci: check json schema sets always additionalProperties

Even if it is set to true.
Avoids forgetting adding fields and thinking it is tested

7 weeks agodoc: complete json schema with integer keywords
Philippe Antoine [Mon, 8 Sep 2025 17:07:16 +0000 (19:07 +0200)] 
doc: complete json schema with integer keywords

7 weeks agodoc: enforce more the completenes of json schema
Philippe Antoine [Mon, 8 Sep 2025 17:33:13 +0000 (19:33 +0200)] 
doc: enforce more the completenes of json schema

see jq 'paths( objects | (.type == "object" and (has("additionalProperties") | not) )) | join(".")' etc/schema.json

fix and complete bittorrent on the way

7 weeks agodoc/ldap: complete json schema
Philippe Antoine [Mon, 8 Sep 2025 10:16:44 +0000 (12:16 +0200)] 
doc/ldap: complete json schema

7 weeks agodoc: add doc on internals of inspection of raw data
Shivani Bhardwaj [Fri, 20 Jun 2025 09:57:27 +0000 (15:27 +0530)] 
doc: add doc on internals of inspection of raw data

Explain briefly the internals of inspection of raw data in the following order:
- Stream Engine
- Stream reassembly
- Role of Detection Engine and Applayer Parsers
- High level communication between Stream and Detection Engine
- Relevant suricata.yaml settings

alongwith some diagrams.

Ticket 4351

8 weeks agodoc: make firewall table names consistent 13817/head
Shivani Bhardwaj [Fri, 5 Sep 2025 10:25:39 +0000 (15:55 +0530)] 
doc: make firewall table names consistent

8 weeks agodoc: add more info to firewall design
Shivani Bhardwaj [Fri, 5 Sep 2025 10:21:56 +0000 (15:51 +0530)] 
doc: add more info to firewall design

Add information about:
- available tables, default policies and rule ordering
- Packet layer and applayer tables and hooks
- engine analysis output
- commandline options available
- how to load firewall rules

Also, reorganize sections and content to assist the definitions.

8 weeks agodetect: remove redundant fw rule path log
Shivani Bhardwaj [Fri, 5 Sep 2025 10:17:46 +0000 (15:47 +0530)] 
detect: remove redundant fw rule path log

8 weeks agostream: workaround scan-build warnings
Victor Julien [Wed, 3 Sep 2025 16:38:11 +0000 (18:38 +0200)] 
stream: workaround scan-build warnings

stream-tcp.c:1938:16: warning: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'tail') [core.NullDereference]
 1938 |     tail->next = old_head;
      |     ~~~~       ^
1 warning generated.

stream-tcp.c:1982:5: warning: Potential leak of memory pointed to by 'q' [unix.Malloc]
 1982 |     ssn->queue_len++;
      |     ^~~
1 warning generated.

8 weeks agostream: add more liberal timestamp behavior in 3WHS
Victor Julien [Mon, 1 Sep 2025 12:51:56 +0000 (14:51 +0200)] 
stream: add more liberal timestamp behavior in 3WHS

RFC 7323 forbids a server to respond with a timestamp option in the
SYN/ACK when the SYN didn't have a timestamp option:

   A TCP MAY send the TSopt in an initial <SYN> segment (i.e., segment
   containing a SYN bit and no ACK bit), and MAY send a TSopt in
   <SYN,ACK> only if it received a TSopt in the initial <SYN> segment
   for the connection.

   Once TSopt has been successfully negotiated, that is both <SYN> and
   <SYN,ACK> contain TSopt, the TSopt MUST be sent in every non-<RST>
   segment for the duration of the connection, and SHOULD be sent in an
   <RST> segment (see Section 5.2 for details).

However, in the real world this pattern happens on benign traffic. This
would lead to missing logs and detection, and in IPS mode such sessions
would be blocked.

This patch allows this pattern when the `stream.liberal-timestamps` is
enabled (enabled by default).

Bug #4702.

8 weeks agostream: improve SYN and SYN/ACK retransmission handling
Victor Julien [Wed, 20 Aug 2025 10:43:27 +0000 (12:43 +0200)] 
stream: improve SYN and SYN/ACK retransmission handling

Take SEQ and ACK into account for more scenarios.

SYN on SYN_SENT

In this case the SYN packets with different SEQ and other properties are
queued up. Each packet updates the ssn to reflect the last packet to
come in. The old ssn data is added to a TcpStateQueue entry in
TcpSession::queue. If the max queue length is exceeded, the oldest entry
is evicted. The queue is actually a single linked list, where the list
head reflects the oldest entry.

SYN/ACK on SYN_SENT

In this case the first check is if the SYN/ACK matches the session. If
it doesn't, the queue is checked to see if there SYN's stored. If one is
found that matches, it is used and the session is updated to reflect
that.

SYN/ACK on SYN_RECV

SYN/ACK resent on the SYN_RECV state. In this case the ssn is updated
from the current packet. The old settings are stored in a TcpStateQueue
entry in the TcpSession::queue.

ACK on SYN_RECV

Checks any stored SYN/ACKs before checking the session. If a queued
SYN/ACK was sound, the session is updated to match it.

Ticket: #3844.
Ticket: #7657.

8 weeks agostream: avoid ineffective state bump in TFO
Victor Julien [Fri, 22 Aug 2025 14:30:29 +0000 (16:30 +0200)] 
stream: avoid ineffective state bump in TFO

Do not set session state to established, as it is unconditionally
overwritten to syn_recv afterwards.

8 weeks agostream: minor improvement to timestamp debug messages
Victor Julien [Mon, 1 Sep 2025 12:51:49 +0000 (14:51 +0200)] 
stream: minor improvement to timestamp debug messages

Add pcap_cnt for easier debugging.

8 weeks agoci: do not run undefined for clusterfuzzlite
Philippe Antoine [Thu, 4 Sep 2025 08:45:14 +0000 (10:45 +0200)] 
ci: do not run undefined for clusterfuzzlite

as it takes too long to build

8 weeks agoci: log data at various clusterfuzzlite steps
Philippe Antoine [Thu, 4 Sep 2025 07:57:24 +0000 (09:57 +0200)] 
ci: log data at various clusterfuzzlite steps

to investigate slowness of build

8 weeks agoci: clusterfuzzlite does not need to clone libhtp
Philippe Antoine [Thu, 4 Sep 2025 07:44:38 +0000 (09:44 +0200)] 
ci: clusterfuzzlite does not need to clone libhtp

as suricata is using libhtp-rs now

8 weeks agoci: remove unnecessary packages from clusterfuzzlite
Philippe Antoine [Thu, 4 Sep 2025 07:43:38 +0000 (09:43 +0200)] 
ci: remove unnecessary packages from clusterfuzzlite

as they were only used on oss-fuzz to build the corpus, and here
we reuse oss-fuzz public corpus

8 weeks agodoc/fileinfo: Document fileinfo context/usage
Jeff Lucovsky [Fri, 25 Jul 2025 14:04:37 +0000 (10:04 -0400)] 
doc/fileinfo: Document fileinfo context/usage

Issue: 6498

8 weeks agodoc: Add upgrade note for ppp changes
Thomas Winter [Mon, 1 Sep 2025 00:45:56 +0000 (12:45 +1200)] 
doc: Add upgrade note for ppp changes

8 weeks agodecode/pppoe: CDPCP as a known protocol
Thomas Winter [Wed, 23 Jul 2025 23:58:31 +0000 (11:58 +1200)] 
decode/pppoe: CDPCP as a known protocol

Cisco Discovery Protocol Control Protocol may be sent over pppoe.
We should allow it to help network functions.

8 weeks agodecode/pppoe: Don't mark expected PPP protos as unsupported
Thomas Winter [Wed, 9 Apr 2025 03:17:08 +0000 (15:17 +1200)] 
decode/pppoe: Don't mark expected PPP protos as unsupported

After upgrading from 7.0.6 to 7.0.8, regular ppp packets are getting
dropped when ppp rules in decoder-events.rules were set as drop.
This was caused by commit a8f35806 ("detect: fix decoder only events").
Previously these rules would not be alerted or dropped.

It turns out several PPP protocols in a switch statement were falling
into the PPP_UNSUP_PROTO case. This has always been the case, I assume
the intention was that they don't get further inspected for size and
other decode errors hence unsupported.
But really some of the protocols are fundamentally required for a PPP
connection to take place.

Change some types that we know should be allowed to pass this.

Ticket: 7651

8 weeks agodecode/pppoe: Run clang-format
Thomas Winter [Mon, 21 Jul 2025 23:38:39 +0000 (11:38 +1200)] 
decode/pppoe: Run clang-format

These files have existing problems which prevent patches from
passing the format check on them.

2 months agogithub-ci: pass CARGO and RUSTC to S-V 13797/head
Jason Ish [Wed, 3 Sep 2025 15:14:43 +0000 (09:14 -0600)] 
github-ci: pass CARGO and RUSTC to S-V

S-V needs cargo to build the EVE validator.

2 months agorust: respect RUSTC and CARGO env vars like CC
Jason Ish [Tue, 2 Sep 2025 16:21:35 +0000 (10:21 -0600)] 
rust: respect RUSTC and CARGO env vars like CC

To support alternative cargo and rustc programs (such as cargo-1.82),
respect CARGO and RUSTC environment variables during ./configure much
like CC.

RUSTFMT is also respected as that is required for the tests, and Cargo
can't figure this out like it can for rustc (perhaps a bug in the
packaging).

For cbindgen, we have also have to make sure the cargo environment
variable is set for each invocation.

To build with Ubuntu's Rust 1.82 packaging:

  CARGO=cargo-1.82 RUSTC=rustc-1.82 RUSTDOC=rustdoc-1.82 \
      ./configure

Note that setting RUSTDOC is only required for commands like "make
check" to pass.

Ticket: #7877

2 months agorust: bindgen requires rustfmt
Jason Ish [Wed, 3 Sep 2025 14:57:48 +0000 (08:57 -0600)] 
rust: bindgen requires rustfmt

Bindgen will use rustfmt after generating the bindings, but this will
fail if rustfmt is not installed. Only run bindgen if rustfmt is
installed.

2 months agodetect/tls: tls.cert_subject is not a multi-buffer
Philippe Antoine [Tue, 26 Aug 2025 19:34:19 +0000 (21:34 +0200)] 
detect/tls: tls.cert_subject is not a multi-buffer

Ticket: 7867

2 months agodoc: complete list of multi-buffers
Philippe Antoine [Tue, 26 Aug 2025 19:31:41 +0000 (21:31 +0200)] 
doc: complete list of multi-buffers

Ticket: 7867

2 months agorust: update tracing-subscriber 13792/head
Jason Ish [Tue, 2 Sep 2025 15:39:20 +0000 (09:39 -0600)] 
rust: update tracing-subscriber

Address https://rustsec.org/advisories/RUSTSEC-2025-0055.

2 months agorust: pin time crate to 0.3.41
Jason Ish [Tue, 2 Sep 2025 15:35:58 +0000 (09:35 -0600)] 
rust: pin time crate to 0.3.41

0.3.42 introduces dependencies that require Rust 1.81.

2 months agogithub-actions: bump actions/download-artifact from 4.3.0 to 5.0.0
dependabot[bot] [Tue, 2 Sep 2025 13:05:38 +0000 (13:05 +0000)] 
github-actions: bump actions/download-artifact from 4.3.0 to 5.0.0

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.3.0 to 5.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/d3f86a106a0bac45b974a628896c90dbdf5c8093...634f93cb2916e3fdff6788551b99b062d0335ce0)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agogithub-actions: bump codecov/codecov-action from 5.4.3 to 5.5.0
dependabot[bot] [Tue, 2 Sep 2025 12:45:21 +0000 (12:45 +0000)] 
github-actions: bump codecov/codecov-action from 5.4.3 to 5.5.0

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.3 to 5.5.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/18283e04ce6e62d37312384ff67231eb8fd56d24...fdcc8476540edceab3de004e990f80d881c6cc00)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agogithub-actions: bump actions/checkout from 4 to 5
dependabot[bot] [Tue, 2 Sep 2025 12:45:06 +0000 (12:45 +0000)] 
github-actions: bump actions/checkout from 4 to 5

Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agogithub-actions: bump github/codeql-action from 3.29.5 to 3.30.0
dependabot[bot] [Tue, 2 Sep 2025 11:49:09 +0000 (11:49 +0000)] 
github-actions: bump github/codeql-action from 3.29.5 to 3.30.0

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.5 to 3.30.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.29.5...v3.30.0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoschema: document stats.detect counters
Juliana Fajardini [Fri, 11 Jul 2025 17:57:19 +0000 (14:57 -0300)] 
schema: document stats.detect counters

... that were missing.

Task #7795

2 months agohtp: use transactions right get function 13772/head
Philippe Antoine [Mon, 7 Jul 2025 20:25:13 +0000 (22:25 +0200)] 
htp: use transactions right get function

Not the VecDeque one

Ticket: 7803

2 months agodetect/dsize: define offset in edge case
Philippe Antoine [Mon, 7 Jul 2025 19:25:16 +0000 (21:25 +0200)] 
detect/dsize: define offset in edge case

Ticket: 7802

2 months agooutput/alert-debug: do not return on app-layer
Philippe Antoine [Fri, 29 Aug 2025 11:18:04 +0000 (13:18 +0200)] 
output/alert-debug: do not return on app-layer

just continue, so that we call aft->file_ctx->Write

Ticket: 4178

2 months agodoc/devguide: section with conceptualized steps for adding app-layer
Philippe Antoine [Thu, 26 Jun 2025 13:54:00 +0000 (15:54 +0200)] 
doc/devguide: section with conceptualized steps for adding app-layer

Ticket: 6840

2 months agoschema/description: capitalize initial letters 13767/head
Juliana Fajardini [Tue, 26 Aug 2025 21:30:39 +0000 (18:30 -0300)] 
schema/description: capitalize initial letters

For existing descriptions that weren't like that, yet.

2 months agoschema: add descriptions for flow stats counters
Juliana Fajardini [Fri, 8 Aug 2025 15:42:38 +0000 (12:42 -0300)] 
schema: add descriptions for flow stats counters

Task #7794

2 months agodoc/lualib: fix wrong tuple section markdown in flowlib
Tommy Wang [Tue, 26 Aug 2025 13:15:25 +0000 (21:15 +0800)] 
doc/lualib: fix wrong tuple section markdown in flowlib

Sections had wrong levels due to wrong markdown.

2 months agodoc/lualib: fix flow timestamps return value order
Tommy Wang [Sat, 23 Aug 2025 00:50:22 +0000 (08:50 +0800)] 
doc/lualib: fix flow timestamps return value order

Task #7854

2 months agostream: remove incorrect defensive check
Shivani Bhardwaj [Thu, 28 Aug 2025 02:36:44 +0000 (08:06 +0530)] 
stream: remove incorrect defensive check

As a part of the commit d096b98 a defensive check was added stating that
the stream must have EOF flag set if it is in TCP_CLOSING state or
above. However, this led to a false positive reported by oss-fuzz whose
analysis showed that this does not hold true for TCP_CLOSING state. It
does hold true only for TCP_CLOSED or if packet has PKT_PSEUDO_STREAM_END
set.
TCP_CLOSING state correspond to an established flow hence the correct
course of action is to remove the assertion.

Bug 7636

Co-authored-by: Philippe Antoine <pantoine@oisf.net>
2 months agodetect/integers: support kibibyte unit
Philippe Antoine [Wed, 27 Aug 2025 19:14:24 +0000 (21:14 +0200)] 
detect/integers: support kibibyte unit

Ticket: 7869