Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new invite regex allows invites to other servers #2547

Open
onerandomusername opened this issue Apr 18, 2023 · 1 comment
Open

new invite regex allows invites to other servers #2547

onerandomusername opened this issue Apr 18, 2023 · 1 comment
Labels
a: filters Related to message filters: (antimalware, antispam, filtering, token_remover) p: 2 - normal Normal Priority t: bug Something isn't working

Comments

@onerandomusername
Copy link
Contributor

onerandomusername commented Apr 18, 2023

#2522 opens some regressions in the invite filter which allow users to send invites in the server that go to other servers. This is due to how discord fetches invites, and how the invite parser now works.

This was originally fixed by #2173 and is a new regression.

A simple example is as follows:

@mbaruh
Copy link
Member

mbaruh commented Apr 18, 2023

The simplest solution to this is probably to limit the trimming only to non-word characters at the end of the string, meaning

r"(?:[^a-zA-Z0-9/].*)?" # Ignoring anything that may come after an invalid character.
can be changed to [^a-zA-Z0-9/]* (untested).

We can do this specifically for the whitelist and keep the blacklist trimming as-is, but this is probably an unnecessary resolution.

EDIT: This will also mean that the pattern should be matched instead of searched.

@mbaruh mbaruh added t: bug Something isn't working a: filters Related to message filters: (antimalware, antispam, filtering, token_remover) p: 2 - normal Normal Priority labels Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: filters Related to message filters: (antimalware, antispam, filtering, token_remover) p: 2 - normal Normal Priority t: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants