Skip to content

Commit

Permalink
tests: adds a test for http2 with userinfo in uri
Browse files Browse the repository at this point in the history
Ticket: #6426
  • Loading branch information
catenacyber authored and victorjulien committed Nov 16, 2023
1 parent 91882fc commit 9fa1ab5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/http2-userinfo-authority/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Description

Test http2 event for mismatch between authority and host

# PCAP

The pcap comes from https://redmine.openinfosecfoundation.org/issues/6425
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/http2-userinfo-authority/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert http2 any any -> any any (msg:"SURICATA HTTP2 authority host mismatch"; flow:established,to_server; http.request_header; content:":authority: "; startswith; content: "@"; pcre: /:authority: ([^:]*:[^@]*)@/,flow:http2_userinfo; sid:1; rev:1;)
alert http2 any any -> any any (msg:"SURICATA HTTP2 authority host mismatch"; flow:established,to_server; app-layer-event:http2.userinfo_in_uri; sid:2; rev:1;)
18 changes: 18 additions & 0 deletions tests/http2-userinfo-authority/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
requires:
min-version: 6.0.0

# disables checksum verification
args:
- -k none --set app-layer.protocols.http2.enabled=true

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2

0 comments on commit 9fa1ab5

Please sign in to comment.