Commit Graph

19346 Commits (main)
 

Author SHA1 Message Date
Victor Julien d81be73ba3 htp: remove duplicate entries in the event table 2 weeks ago
Philippe Antoine 17dc065326 ci: check uint keywords with their size
So, that if a keyword advertises uint16, it can indeed parse
a uint16 and is not just a uint8
2 weeks ago
Philippe Antoine 399ee1e360 ci: check multi uint keywords
Ticket: 7929
2 weeks ago
Philippe Antoine 3b994e807d detect/mqtt: bitflags do not support multi integer
Ticket: 7929

As both syntaxes share comma as delimiter
2 weeks ago
Philippe Antoine 9bf9d53c42 detect/sctp: sctp.chunk_type does not support multi integer
Ticket: 7929

As it supports prefilter
2 weeks ago
Philippe Antoine 06855cd832 detect/nfs: nfs_procedure does not support multi integer
Ticket: 7929
2 weeks ago
Philippe Antoine 4649bb3838 detect/file: filesize does not support multi integer
Ticket: 7929
2 weeks ago
Philippe Antoine cb0ecb1722 detect/krb5: msg_type is not a multi integer
Ticket: 7929

There is only one msg_type by tx
2 weeks ago
Philippe Antoine be4c036071 detect/enip: status are not multi integers
Ticket: 7929
2 weeks ago
Philippe Antoine e08a19a88a detect/enip: cip_class and cip_instance are now a multi-integer
Ticket: 7929

One commit as they share the same code
2 weeks ago
Philippe Antoine 0bdfe3f571 detect/enip: cip_attribute keyword is now a multi-integer
Ticket: 7929
2 weeks ago
Jeff Lucovsky 5af13e3eb0 rdp: mark transactions single-directional
Mark the direction into RDP transactions at creation time,
so the tx carries SKIP_INSPECT for the direction it is
never seen in, matching DHCP and the other single-direction
parsers. This lets cleanup free completed transactions and
stops a tx from being inspected (and alerting) twice, once per
direction.

RDP bounds its transactions to connection setup and stops
parsing once bypass_parsing is set.

Issue: 8621
2 weeks ago
Jeff Lucovsky 3f86c56c80 dhcp: mark transactions single-directional to fix tx leak
DHCP is a stateless parser where each datagram is its own standalone,
single-direction transaction. It was creating transactions with
AppLayerTxData::new(), which leaves both SKIP_INSPECT bits clear, so the
engine treats every tx as still needing inspection in both directions.

For a flow that only ever carries one direction (broadcast DHCP, or a
relay seeing one side), the never-observed direction's inspect bit can
never be set, so AppLayerParserTransactionsCleanup() never frees the tx.
The per-flow transaction Vec then grows without bound and every packet
re-scans the whole list, giving O(n^2) CPU and unbounded memory on a
busy DHCP aggregation point.

Use AppLayerTxData::for_direction() like every other stateless parser
(DNS, SNMP, NTP, IKE, KRB5, MQTT, QUIC, SIP, WebSocket, bittorrent-dht)
so the tx carries SKIP_INSPECT for the direction it will never be seen
in. This lets cleanup free completed transactions and also stops the tx
from being inspected (and alerting) twice, once per direction.

Issue: 8621
2 weeks ago
Philippe Antoine a6fcbb1ab7 flow: factorize duplicated code for hashing 2 weeks ago
Philippe Antoine fe728d97d8 flow: use livedev for ftp-hash
Completes commit 7e725c650d

autofp-scheduler with value ftp-hash ends up using
FlowGetIpPairProtoHash which ignores the ports for ftp-looking
flows so that the ftp and ftp-data flow get processed by the
same thread.

As for the other cases, we want to use every other parameter
to compute the flow hash, inclusing the live device
2 weeks ago
Philippe Antoine f4388d45c6 ebpf: remove unused macro 2 weeks ago
Philippe Antoine 2ee4ef0ec5 features: add EBPF as a feature
for SV to run tests based on the presence of this feature
2 weeks ago
Philippe Antoine ee9b48493b ebpf: factorize duplicated code for key setting 2 weeks ago
Philippe Antoine 09f0851043 detect/krb5: fix doc about cname and sname keywords
These keywords match only in to_client direction,
even if the fields are logged in both directions
2 weeks ago
Philippe Antoine a81031591e detect/krb5: move krb5.ticket_encryption to rust
Ticket: 8648
2 weeks ago
Philippe Antoine 8f0dbc0b63 detect/krb5: move krb5.cname and krb5.sname to rust
Ticket: 8648
2 weeks ago
Philippe Antoine 3327cf42f0 detect/krb5: move krb5_err_code to rust
Ticket: 8648

Make it a generic integer on the way
2 weeks ago
Jason Ish e560db9d1f ftp: don't match unset ftp.dynamic_port
Treat dyn_port 0 as an absent value so numeric comparisons do not
match FTP transactions without a negotiated data port.

Ticket: #8392
2 weeks ago
Jason Ish dd600d0860 ftp: mark ftp.reply as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish c6ec50ab6f ftp: mark ftp.command_data as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish 1f30641a83 ftp: mark ftpbounce as firewall supported
Ticket: 8392
2 weeks ago
Jason Ish 974241aa50 ftp: mark ftp.reply_received as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish f59960d42b ftp: support STOU data transfers
Support STOU on the FTP data channel.

With STOU a filename is optional. If no filname is provided, use
"<stou>". The server does respond with the filename to use, but there
can be a race condition in getting this filename and setting up file
storage before data starts flowing.

Ticket: #8664
2 weeks ago
Jason Ish e65bf4c905 ftp: support APPE data transfers
Support the APPE (append) command on the ftp data channel. Like STOR,
APPE uploads file content on the data channel.

Ticket: #8664
2 weeks ago
Jason Ish 5856ced29c ftp: support LIST and MLSD data channels
Support LIST and MLSD on the ftp data channel.

Ticket: #8664
2 weeks ago
Jason Ish be94ab952a ftp: register ftp.mode at response_complete
Also mark as supported by the firewall.

Ticket: #8392
2 weeks ago
Jason Ish fc1546e25e ftp: register ftp.completion_code at response_complete
Ticket: #8392
2 weeks ago
Jason Ish 1b289daea3 ftp: support nlst on the data channel
Ticket: #8664
2 weeks ago
Jason Ish 6bc2969b8d ftp: mark ftpdata_command as firewall supported 2 weeks ago
Jason Ish f93268e531 ftp: mark ftp.dynamic_port as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish 41cad78506 ftp: register ftp.dynamic_port at response completion
Register ftp.dynamic_port at the FTP transaction completion progress
instead of progress 0. This allows ftp.dynamic_port to be used in
ftp:response_complete.

Ticket: #8392
2 weeks ago
Jason Ish 0d566f90ce ftp: mark ftp.command as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish a6ce31d50d ftp: register ftp.command_data at request completion
Register ftp.command_data with the FTP request completion progress so it
can be used by firewall rules on the ftp:request_complete hook.

Ticket: #8392
2 weeks ago
Jason Ish bf63c574d3 ftp: register ftp.command buffer at request completion
Register ftp.command with the FTP request completion progress so it can
be used by firewall rules on the ftp:request_complete hook.

Ticket: #8392
2 weeks ago
Philippe Antoine f56501215f detect/file: reorder struct fields to reduce padding
and make scan-build happy
2 weeks ago
Philippe Antoine 89dbce1b46 detect: convert tx_progress to uint8_t 2 weeks ago
Jeff Lucovsky 30d4edf9eb detect: revert 2eede11195
Revert issue 8619 fix in favor of a more general change that
sets INSPECTED_T{S,C} correctly on passed flows. This makes clean no
longer need the FLOW_ACTION_PASS special case to free those
transactions.

Issue: 8621
3 weeks ago
Jeff Lucovsky 006e21c1cc app-layer: fix inverted tx inspected flag check
Issue: 8628

AppLayerParserSetTransactionInspectId() had an inverted guard when
tagging completed transactions as inspected: it set the INSPECTED flag
only on txs that already had it, so a finished tx was never newly
marked.

On a normal flow DetectRunTx() sets the same flag and masks the
mistake. On a passed flow -- a `pass` rule or a pass-the-flow exception
policy -- detection is skipped and this function is the only thing that
marks txs inspected. With the inverted guard the transactions are never
flagged, AppLayerParserTransactionsCleanup() never frees them, and the
per-flow transaction list grows without bound while each packet
re-scans it, giving O(n^2) cleanup cost.

This is an unintended regression from 834378ff88.
3 weeks ago
Juliana Fajardini 9cd778b33a doc: requirements for rtd aren't changed
Python's naming conflict shouldn't affect the read the docs requirements
file, so don't rename that one.
3 weeks ago
Philippe Antoine d9fae18432 swf: prevents overflow with bad config value
Ticket: 8642

Do not allocate too much by using the config value, when the flash
file does not require that much data anyways
3 weeks ago
Philippe Antoine 52490b8c26 ftp: do not error the flow on file before port
Ticket: 8659

If a client sends a SOTR/RETR command before doing a PASV/PORT
command, ther server may reply
425 Use PORT or PASV first.\r\n
and allow the client to continue sendinf other commands

So, Suricata should not put the whole flow into error, it just
sets an event, and continues to parse further
3 weeks ago
Jason Ish 26cf56bf54 github-ci: consolidate new authors check into a single workflow
Replace the two-workflow pattern (authors.yml + authors-done.yml) with a
single pull_request_target workflow.

I'm not sure this was possible when this job was originally created, but
apparently it is now.
3 weeks ago
Philippe Antoine f092d07f6d decode/sctp: chunk_cnt can be a u16
Ticket: 8661
3 weeks ago
Philippe Antoine 3ca2ed25a3 detect/datajson: check json objects are string as expected
Ticket: 8624
3 weeks ago
Jeff Lucovsky 2eefb1910d doc/fixup: Fixup usages of container-example
There are several places where transform-related container-example helper wasn't
formatting rules properly.
3 weeks ago