Project

General

Profile

Actions

Bug #9257

open
VJ VJ

firewall: a rule without a fast pattern decides on incomplete data of the tx's current state

Bug #9257: firewall: a rule without a fast pattern decides on incomplete data of the tx's current state

Added by Victor Julien 5 days ago. Updated 5 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

Description

In firewall mode, a firewall rule without a fast pattern (for example only http.host; pcre:"/good\.example/";) decides on incomplete data of the transaction's current state.

While the transaction is at the rule's hook and that state is not complete yet, for instance HTTP/1 request headers spread over several TCP segments, the rule's buffer is missing or partial. Its miss is treated as final:

  • an allow-list rule misses, and the hook's default policy drops a benign request;
  • a drop rule followed by a contentless accept:flow rule at the same hook is bypassed: the accept decides when the transaction enters the hook, before the drop rule can see its data.

Rules with a fast pattern are not affected in this way: a miss while the fast pattern's state is still in progress is not final.

The verdict depends on how the sender segments the request.

Steps to reproduce

Firewall rules, plus accept:hook rules for the other request and response states:

accept:hook,alert http1:request_headers any any -> any any (http.host; pcre:"/good\.example/"; sid:102;)

Send GET /ok HTTP/1.1 with Host: good.example, with the request headers split across two TCP segments inside the Host header.

Expected behaviour

The request is accepted, as it is when the headers arrive in one segment.

Actual behaviour

The flow is dropped by the request_headers default policy.

With drop:flow on http.host; pcre:"/evil\.example/"; followed by a contentless accept:flow at request_headers, a split request for evil.example is accepted.

Seen on 8.0.7 and the main branch.


Subtasks 1 (1 open — 0 closed)

Bug #9258: firewall: a rule without a fast pattern decides on incomplete data of the tx's current state (8.0.x backport)AssignedVictor JulienActions

OT Updated by OISF Ticketbot 5 days ago Actions #1

  • Subtask #9258 added

OT Updated by OISF Ticketbot 5 days ago Actions #2

  • Label deleted (Needs backport to 8.0)
Actions

Also available in: PDF Atom