Skip to content

Presence of non-blacklisted URL bypasses all other filters

Moderate
ChrisLovering published GHSA-j8c3-8x46-8pp6 Nov 5, 2021

Package

bot (Python Discord)

Affected versions

<69fdd3649e2f9a646b97e445bc4d5440440e5890

Patched versions

>67390298852513d13e0213870e50fb3cff1424e0

Description

When a non-blacklisted URL and an otherwise triggering filter token is included in the same message (for example, https://pydis.com and ) the token filter does not trigger. This means that by including any non-blacklisted URL moderation filters can be bypassed.

Credit to @Akarys42 for this following brief

Reason

The following lines seem to be the culprit

# Make sure it's not a URL
if URL_RE.search(text):
return False, None

Those lines cause the _has_watch_regex_match function to exit early if the message contains a url. This three years old line has been dragged through four commits, and it's utility seems to not have been questioned. It has only become an issue once we made the regex filter before the domain one, 10 months ago.

Bug history

Severity

Moderate

CVE ID

CVE-2021-41250

Weaknesses

No CWEs

Credits