From 44a803798fa7b56e53f19d883ac0f42c9c37598a Mon Sep 17 00:00:00 2001 From: liquidsec Date: Tue, 16 Jun 2026 22:20:31 -0400 Subject: [PATCH 1/2] Harden pickle unpickler in webbrute_shortnames Restrict CustomUnpickler.find_class to only allow MinimalWordPredictor instead of falling through to the default find_class, which permits arbitrary class instantiation. --- bbot/modules/webbrute_shortnames.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbot/modules/webbrute_shortnames.py b/bbot/modules/webbrute_shortnames.py index 73ddb9521f..c4cecdcaba 100644 --- a/bbot/modules/webbrute_shortnames.py +++ b/bbot/modules/webbrute_shortnames.py @@ -124,7 +124,7 @@ class CustomUnpickler(pickle.Unpickler): def find_class(self, module, name): if name == "MinimalWordPredictor": return MinimalWordPredictor - return super().find_class(module, name) + raise pickle.UnpicklingError(f"Forbidden class: {module}.{name}") self.info("Loading shortname prediction models, could take a while if not cached") endpoint_model = await self.helpers.wordlist( From ed9f6a4afe61f6be4ef8ded4008d37f02510e680 Mon Sep 17 00:00:00 2001 From: liquidsec Date: Tue, 16 Jun 2026 23:05:30 -0400 Subject: [PATCH 2/2] Allow numpy classes in shortnames pickle unpickler --- bbot/modules/webbrute_shortnames.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bbot/modules/webbrute_shortnames.py b/bbot/modules/webbrute_shortnames.py index c4cecdcaba..0883c22d3c 100644 --- a/bbot/modules/webbrute_shortnames.py +++ b/bbot/modules/webbrute_shortnames.py @@ -124,6 +124,8 @@ class CustomUnpickler(pickle.Unpickler): def find_class(self, module, name): if name == "MinimalWordPredictor": return MinimalWordPredictor + if module.startswith("numpy"): + return super().find_class(module, name) raise pickle.UnpicklingError(f"Forbidden class: {module}.{name}") self.info("Loading shortname prediction models, could take a while if not cached")