From 1a08d2f77ddabea3fa78a75bdaa676b2ae509ee4 Mon Sep 17 00:00:00 2001 From: Johnathan <39648915+TrebledJ@users.noreply.github.com> Date: Tue, 5 May 2026 01:00:45 +0800 Subject: [PATCH] fix: guard against chaotic chaos responses resolves #2879 --- bbot/modules/chaos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bbot/modules/chaos.py b/bbot/modules/chaos.py index 9c4255e542..0feb42d64d 100644 --- a/bbot/modules/chaos.py +++ b/bbot/modules/chaos.py @@ -34,6 +34,10 @@ async def parse_results(self, r, query): domain = j.get("domain", "") if domain: subdomains = j.get("subdomains", []) + if len(subdomains) > 10000: + # In extremely rare cases, Chaos API returns a gigaton of subdomains. + # If that happens, we simply treat the domain as a wildcard. + subdomains = ["*"] for s in subdomains: s = s.lower().strip(".*") subdomains_set.add(s)