]> 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 <victor@inliniac.net>
Fri, 19 Apr 2024 18:51:23 +0000 (20:51 +0200)
Ticket: 6948

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

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;
 }