]> git.ipfire.org Git - thirdparty/suricata.git/commit
dns: truncate names larger than 1025 characters
authorJason Ish <jason.ish@oisf.net>
Thu, 31 Oct 2024 21:40:40 +0000 (15:40 -0600)
committerVictor Julien <vjulien@oisf.net>
Wed, 11 Dec 2024 05:49:35 +0000 (06:49 +0100)
commit3a5671739f5b25e5dd973a74ca5fd8ea40e1ae2d
tree0fe6d1e1de26f89c7db4b281a2d4e308144c6533
parent9a53ec43b13f0039a083950511a18bf6f408e432
dns: truncate names larger than 1025 characters

Once a name has gone over 1025 chars it will be truncated to 1025
chars and no more labels will be added to it, however the name will
continue to be parsed up to the label limit in attempt to find the end
so parsing can continue.

This introduces a new struct, DNSName which contains the name and any
flags which indicate any name parsing errors which should not error
out parsing the complete message, for example, infinite recursion
after some labels are parsed can continue, or truncation of name where
compression was used so we know the start of the next data to be
parsed.

This limits the logged DNS messages from being over our maximum size
of 10Mb in the case of really long names.

Ticket: #7280
rust/src/dns/dns.rs
rust/src/dns/log.rs
rust/src/dns/lua.rs
rust/src/dns/parser.rs