Commit Graph

19382 Commits (6b8c482012024c7ddc9939b257dd79c7ebecffbf)
 

Author SHA1 Message Date
Jason Ish 6b8c482012 github-ci: break ubuntu/debian script into 2 scripts
Debian 13 ships Rust 1.85 by default, Ubuntu requires installing a
specific patch to get newer then 1.75. So to support a newer MSRV,
these operating systems need different examples.
4 weeks ago
Jason Ish 05882e7be0 github-ci: cleanups to almalinux minimal build
Don't install extra repo's in the script, do it in CI. These are covered
by the documentation as they vary depending on the version and variant.
4 weeks ago
Shivani Bhardwaj bc4c06481c detect/flowbits: store iid and sid in analyzer
sid is much more useful for logging and debugging.
4 weeks ago
Shivani Bhardwaj 83d52582b1 detect/flowbits: fix sid misnomer in analyzer arrays
Analyzer arrays store internal IDs of the signature for an easy lookup
later from the DetectEngineCtx. However, the storage arrays were
inappropriately named as sid arrays. Make it coherent.

Bring Analyzer structs and fns to the header for later use in a wider
context.
4 weeks ago
Denis Balashov 8e551f2860 util/file: add unit test for inspect window overflow
Ticket: 8678

With an inspect window of 0xAAAAAAAB the `window * 3` guard wrapped to 1
in uint32_t arithmetic, so it passed for a 64 byte file and
content_inspected was set to `file->size - window`, an underflow.
4 weeks ago
Denis Balashov f3910d557d util/file: fix integer overflow in inspect window comparison
Ticket: 8678

In FilePruneFile() `window * 3` was computed in uint32_t arithmetic.
The guard exists to ensure `file->size > window`, so on wrap around
`file->size - window` underflows and content_inspected is set to a
bogus value, breaking file inspection.

Make window uint64_t so the multiplication cannot wrap.
4 weeks ago
Shivani Bhardwaj 2eb0b60b83 smb/log: map dcerpc uuid, opnum to service names
With this patch, the logged uuids will also have corresponding
stringified service names. The requests that will have an opnum will
have a corresponding stringified procedure name.

Feature 2727
Feature 8523
4 weeks ago
Shivani Bhardwaj d77f73d9a6 dcerpc/log: map uuid, opnum to service and procedure
Log the service and procedure names corresponding to a UUID and opnum
for each DCERPC event where it's available.

Feature 2727
Feature 8523
4 weeks ago
Shivani Bhardwaj 35d28272b2 dcerpc: add interface-service name data
This data directly comes from Zeek @d11a8750. It was scriptually
converted to NDJSON ingestible to Suricata using serde and serde_json.
The script used for this conversion lives in
scripts/extract_dce_rpc_interfaces.py.

Part of this data within Zeek codebase comes from the MITRE BZAR
project. Hence, the LICENSE file alongwith this data consists of both
the licenses: Zeek and BZAR.

Feature 2727
Feature 8523
4 weeks ago
Shivani Bhardwaj cee102c76d rust: add serde and serde_json as dependencies
Feature 2727
Feature 8523
4 weeks ago
Jason Ish 57ae57152c smtp: assign response frames to owning transaction
SMTPGetLine assigned response frames to the current transaction even when a
queued reply belonged to an older transaction.

Use the queued command owner so frame EVE output and frame-based detection
receive the correct transaction id.

Includes some re-org to avoid prototypes for static functions.

Ticket: #8741
1 month ago
Jason Ish 60e0df6530 smtp: recover from invalid BDAT command syntax
A BDAT command that failed to parse, such as "BDAT 5 X", returned -1,
disabling SMTP parsing for the rest of the flow. A server may reject the
command and continue the session, leaving following messages
uninspected.

Instead raise a decoder event and queue the command as an ordinary
command.

Ticket: #8741
1 month ago
Jason Ish ec0fec1a37 smtp: complete BDAT transactions at LAST
Track the BDAT LAST marker so the final chunk and its reply complete the
transaction in each direction, preventing a following MAIL FROM from
being merged into the previous transaction.

Ticket: #8741
1 month ago
Jason Ish 2676d1bc83 smtp: move transaction completion helpers
Simply makes the follow diff a little easier to read.
1 month ago
Stephen Donnelly a37b75a8ba dag: check rlen is a valid length
Ticket: 8797

Add check to rlen value read from ERF record to avoid potential infinite loop, must be >= dag_record_length (16).

Similar check exists in source_erf_file already.
1 month ago
Jason Ish 7827f357b5 github-ci: suppress RUSTSEC-2026-0253
RUSTSEC-2026-0253 in the lru crate requires that items we put in the
lru have a drop implementation that may panic, and we catch
that panic. The current items we put in the lru cache do not have a drop
implementation, and we treat panic's as fatal so will not run into the
issue presented in RUSTSEC-2026-0253.
1 month ago
Dmitry Uryvchikov d2497790f9 detect-engine-mpm: change transforms->cnt to uint8_t 1 month ago
Stephen Donnelly 03bc717877 dag: wrong stats registration causes compilation errors with --enable-dag
Bug: 8812
1 month ago
Uwez Khan 38b4ad79a3 decode/ipv6: bound hop-by-hop option to the option area
The TLV loop for the IPv6 hop-by-hop and destination option headers
gates each option on (offset + 1 + ip6_optlen) > optslen. An option is
two header bytes (type, length) plus ip6_optlen data bytes, so its data
ends at offset + 1 + ip6_optlen and the bound has to be
offset + 2 + ip6_optlen.

Before: an option that declares its data running one byte past the
option area is accepted, and the Router Alert / Jumbo / Home Address
memcpy then copies sizeof(value) bytes ending one byte past the area;
when the header sits at the tail of the IPv6 payload that read goes
past the payload.

After: the option is rejected with IPV6_EXTHDR_INVALID_OPTLEN, matching
how the IPv4 option loop already bounds a full option against the
remaining length. The check stays next to the read so each option type
does not need its own guard.

Ticket: #8817.
1 month ago
Victor Julien dde0d7295b tls: improve client/server hello parsing loops
Bug: #8795.
1 month ago
Philippe Antoine 46880985ef http2: find content-encoding without case-sensitivity
See RFC 9110 8.4.1

> All content codings are case-insensitive

Ticket: 8760
1 month ago
Philippe Antoine 425b9c6777 ftp/expectation: fix ippair leak
Ticket: 5204

ippair use_cnt increased by AppLayerExpectationCreate calling
IPPairGetIPPairFromHash was never decreased
1 month ago
Philippe Antoine dee0f03db4 detect/modbus: move modbus keyword to rust
Ticket: 3195
1 month ago
Philippe Antoine 3e70a79ed2 detect/nfs: move nfs.version to rust
Ticket: 3195
1 month ago
Philippe Antoine e976db7261 detect/template: remove template2
Ticket: 7278

Its usage was removed in 512bbe4de8
1 month ago
Philippe Antoine d0cc39c79a rfb/jsonschema: add missing field
Ticket: 6478
1 month ago
dependabot[bot] 060808f36e github-actions: bump ossf/scorecard-action from 2.4.3 to 2.4.4
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.3 to 2.4.4.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](4eaacf0543...2d1146689b)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
1 month ago
dependabot[bot] 279317327c github-actions: bump github/codeql-action from 4.36.2 to 4.37.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.36.2 to 4.37.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.36.2...v4.37.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
1 month ago
dependabot[bot] c6164c6ef1 github-actions: bump github/codeql-action/upload-sarif
Bumps [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) from 1f34ec16430d82636d18716acc7aaa6d843b35a9 to 1cd4d01d58f636bbdbffbfd3c121b3446d07e9f3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1f34ec1643...1cd4d01d58)

---
updated-dependencies:
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 1cd4d01d58f636bbdbffbfd3c121b3446d07e9f3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
1 month ago
dependabot[bot] bc04ca0f00 github-actions: bump actions/checkout from 7.0.0 to 7.0.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v7...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
1 month ago
dependabot[bot] 050290b636 github-actions: bump vmactions/freebsd-vm from 1.5.0 to 1.5.2
Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.5.0 to 1.5.2.
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](5a72679103...77ed28d336)

---
updated-dependencies:
- dependency-name: vmactions/freebsd-vm
  dependency-version: 1.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
1 month ago
Jeff Lucovsky e7f1692a5c defrag: fix defrag.memuse counter reporting memcap
Populate defrag.memuse from DefragTrackerGetMemuse() rather than
DefragTrackerGetMemcap(), so it reports actual usage, not the cap.

Issue: 8752
1 month ago
Jason Ish 62fdb771b0 smtp: check transaction before to-client completion
Make sure the transaction still exists before completing it in the
to-client direction. A pipelined RSET reply may already have completed and
freed it while a later end-of-DATA marker still refers to it.

Found by OSS-Fuzz testcase 5498180758994944.

Bug #8739.
1 month ago
Shivani Bhardwaj 9afab955c3 conf: disable flowbits.max-per-signature by default 1 month ago
Jason Ish b364f28387 github-ci: update RUST_VERSION_KNOWN
To 1.97 as that is where we are clippy clean to.
2 months ago
Jason Ish e9b08dbb2d rust: clippy fixups for 1.97
Mostly provided by clippy --fix, and one `.to_string()` removal where
not needed.
2 months ago
Victor Julien 8455efd9ac app-layer: add substate support to list hooks
Add substates to the --list-app-layer-hooks option.
2 months ago
Victor Julien 8a5e8c63b2 detect: strict validation of buffers
Make sure that every buffer in a signature is actually used in the
setup of the engines. Reject sigs that are locked to a certain substate
and use buffers that require another.
2 months ago
Victor Julien 89baff01c9 output/tx: allow registering logging at substate
Register HTTP/2 and DOH2 this way.
2 months ago
Victor Julien a824d97d71 detect: use sub state to select inspect engines
When building the per signature app_inspect list, only add engines
that match the sub state specified in the hook.
2 months ago
Victor Julien c5d4a250b5 detect/firewall: avoid passing state match for policy 2 months ago
Victor Julien 9a294bf73b app-layer: check if protocol is enabled for sub state callbacks 2 months ago
Victor Julien f545f06cf2 doh2: do not enable parser if http2 is disabled
DOH2 depends on HTTP/2, so it makes no sense to enable it separately.

It would also put the sub state handling in a weird state, as the DOH2
side reuses the registered HTTP/2 callbacks.
2 months ago
Victor Julien cf216b6309 http2: rename state *start to *started
This is to make the hook use names consistent with the default
hooks and other protocols.
2 months ago
Victor Julien f8f28c6f6f detect: sync prefilter and app inspect alproto logic
In firewall mode the alproto logic when building prefilter and rule
engines is strict, but was out of sync between prefilter and rule app
inspect engines.

For SIGNATURE_HOOK_TYPE_APP rules the logic is strict, with an exception
for HTTP/2 and DOH2. DOH2 is not a full protocol implementation, but
rather HTTP/2 with a different alproto.

Fixes: d64954a873 ("detect: don't register unrelated inspect engines")
2 months ago
Victor Julien 56d9670af7 eve/alert: log sub state progress values 2 months ago
Victor Julien f02a427059 eve/alert: clean up state logging 2 months ago
Victor Julien 110e74642e detect/firewall: harden policy lookup logic 2 months ago
Victor Julien cfc98aeeaf detect: add debug validation checks to assert assumptions 2 months ago
Victor Julien 7517ba9f98 detect: give clear errors for http2 w/o substate
http2 states were not yet supported even if the built-in states could
already work. Clearly error out on a hook w/o substate.
2 months ago