From 8708d254a2d2e1b6241febe1990a0075f9871e9d Mon Sep 17 00:00:00 2001 From: Moritz Raabe Date: Thu, 2 Jul 2020 22:26:18 +0200 Subject: [PATCH] only allow supported scopes --- capa/rules.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/capa/rules.py b/capa/rules.py index a616172e..72926d92 100644 --- a/capa/rules.py +++ b/capa/rules.py @@ -535,6 +535,9 @@ class Rule(object): if isinstance(statements[0], capa.engine.Subscope): raise InvalidRule("top level statement may not be a subscope") + if scope not in SUPPORTED_FEATURES.keys(): + raise InvalidRule("{:s} is not a supported scope".format(scope)) + return cls(name, scope, build_statements(statements[0], scope), d["rule"]["meta"], s) @classmethod