]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
dns: add test with response with data length 0 2630/head
authorPhilippe Antoine <pantoine@oisf.net>
Wed, 27 Aug 2025 20:42:57 +0000 (22:42 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 28 Aug 2025 20:28:13 +0000 (22:28 +0200)
Ticket: 7574

tests/dns/dns-answer-emptydata/README.md [new file with mode: 0644]
tests/dns/dns-answer-emptydata/input.pcap [new file with mode: 0644]
tests/dns/dns-answer-emptydata/test.rules [new file with mode: 0644]
tests/dns/dns-answer-emptydata/test.yaml [new file with mode: 0644]

diff --git a/tests/dns/dns-answer-emptydata/README.md b/tests/dns/dns-answer-emptydata/README.md
new file mode 100644 (file)
index 0000000..2f0b0e8
--- /dev/null
@@ -0,0 +1,5 @@
+Test that we do not fail parsing on DNS answer with Data Length 0 `dns.resp.len == 0`
+
+Ticket: https://redmine.openinfosecfoundation.org/issues/7574
+
+Pcap from ticket
diff --git a/tests/dns/dns-answer-emptydata/input.pcap b/tests/dns/dns-answer-emptydata/input.pcap
new file mode 100644 (file)
index 0000000..7a57bc2
Binary files /dev/null and b/tests/dns/dns-answer-emptydata/input.pcap differ
diff --git a/tests/dns/dns-answer-emptydata/test.rules b/tests/dns/dns-answer-emptydata/test.rules
new file mode 100644 (file)
index 0000000..a6cb2a2
--- /dev/null
@@ -0,0 +1,2 @@
+alert dns any any -> any any (msg:"SURICATA DNS malformed request data"; flow:to_server; app-layer-event:dns.malformed_data; classtype:protocol-command-decode; sid:2240002; rev:2;)
+alert dns any any -> any any (msg:"SURICATA DNS malformed response data"; flow:to_client; app-layer-event:dns.malformed_data; classtype:protocol-command-decode; sid:2240003; rev:2;)
diff --git a/tests/dns/dns-answer-emptydata/test.yaml b/tests/dns/dns-answer-emptydata/test.yaml
new file mode 100644 (file)
index 0000000..cf28e97
--- /dev/null
@@ -0,0 +1,9 @@
+checks:
+  - filter:
+      count: 2
+      match:
+        event_type: dns
+  - filter:
+      count: 0
+      match:
+        event_type: alert