Project

General

Profile

Actions

Bug #7326

closed

http: FN with prefilter if the first of multi buffer did not match

Added by Philippe Antoine 2 months ago. Updated 16 days ago.

Status:
Closed
Priority:
Normal
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

Found while working on #5576

Rules should match the same whatever their fast_pattern is, but

alert http any any -> any any ( sid: 2; http.stat_code; content: "200"; fast_pattern; http.response_header; content: "first";)
alert http any any -> any any ( sid: 3; http.stat_code; content: "200"; http.response_header; content: "first"; fast_pattern;)

will have the first one matching and not the second one with
import socket
import time

HOST = "127.0.0.1"  # Standard loopback interface address (localhost)
PORT = 8001  # Port to listen on (non-privileged ports are > 1023)

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.bind((HOST, PORT))
    s.listen()
    conn, addr = s.accept()
    with conn:
        print(f"Connected by {addr}")
        while True:
            data = conn.recv(1024)
            if not data:
                break
            conn.sendall(b"HTTP/1.0 200 OK\nServer: custom\n")
            conn.sendall(b"Header1: first\n")
            time.sleep(1)
            conn.sendall(b"Content-type: text\n")
            conn.sendall(b"X-first: secret\n")
            conn.sendall(b"Content-Length: 14\n\n")
            time.sleep(1)
            conn.sendall(b"see you later!")


Subtasks 1 (0 open1 closed)

Bug #7327: http: FN with prefilter if the first of multi buffer did not match (7.0.x backport)ClosedPhilippe AntoineActions

Related issues 1 (1 open0 closed)

Related to Suricata - Bug #5576: Dataset is setting data despite the signature being a complete matchIn ReviewPhilippe AntoineActions
Actions #1

Updated by OISF Ticketbot 2 months ago

  • Subtask #7327 added
Actions #2

Updated by OISF Ticketbot 2 months ago

  • Label deleted (Needs backport to 7.0)
Actions #3

Updated by Philippe Antoine 2 months ago

  • Related to Bug #5576: Dataset is setting data despite the signature being a complete match added
Actions #5

Updated by Philippe Antoine 2 months ago

  • Subject changed from detect/multi-buffer/prefilter: false negative if the first packet does not have all occurences to detect/multi-buffer/prefilter: false negative if the first packet does not have all occurences with http.request_header
  • Status changed from New to In Review
  • Assignee changed from OISF Dev to Philippe Antoine
Actions #6

Updated by Philippe Antoine about 2 months ago

  • Status changed from In Review to Closed
Actions #7

Updated by Juliana Fajardini Reichow 16 days ago

  • Subject changed from detect/multi-buffer/prefilter: false negative if the first packet does not have all occurences with http.request_header to http: FN with prefilter if the first of multi buffer did not match
Actions

Also available in: Atom PDF