]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/http-server-body: avoid FP on toserver direction
authorPhilippe Antoine <pantoine@oisf.net>
Wed, 17 Apr 2024 11:39:39 +0000 (13:39 +0200)
committerVictor Julien <vjulien@oisf.net>
Sat, 20 Apr 2024 06:50:00 +0000 (08:50 +0200)
Ticket: 6948

http.response_body keyword did not enforce a direction, and thus
could match on files sent with POST requests

(cherry picked from commit e6895b835a76a96a18c5e9c33f46c89687eceab9)

src/detect-http-server-body.c

index 98f0ec581e9488c3f02b0cdb343938af8f389488..28833a8a75bf1dd04ff560bc9253214faddf1aef 100644 (file)
@@ -124,6 +124,9 @@ static int DetectHttpServerBodySetupSticky(DetectEngineCtx *de_ctx, Signature *s
         return -1;
     if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0)
         return -1;
+    // file data is on both directions, but we only take the one to client here
+    s->flags |= SIG_FLAG_TOCLIENT;
+    s->flags &= ~SIG_FLAG_TOSERVER;
     return 0;
 }