]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
base64_data: reject fast_pattern use
authorShivani Bhardwaj <shivani@oisf.net>
Thu, 14 Mar 2024 10:43:55 +0000 (16:13 +0530)
committerVictor Julien <victor@inliniac.net>
Tue, 14 May 2024 16:00:17 +0000 (18:00 +0200)
If a rule has fast_pattern on base64_data, it is anyway not applied, so,
consider any such rules invalid.

Bug 5220

src/detect-fast-pattern.c

index 6748186727c9f7847077f890c8d3994608636a27..52a7466551409724582869d91c5dd961f6f34162 100644 (file)
@@ -272,6 +272,10 @@ static int DetectFastPatternSetup(DetectEngineCtx *de_ctx, Signature *s, const c
                 }
             }
         }
+        if (SigMatchListSMBelongsTo(s, pm) == DETECT_SM_LIST_BASE64_DATA) {
+            SCLogError("fast_pattern cannot be used with base64_data");
+            goto error;
+        }
         cd->flags |= DETECT_CONTENT_FAST_PATTERN;
         return 0;
     }