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

Newline antispam filter potentially handles actual rendered lines of formatting incorrectly #3037

Open
thatbirdguythatuknownot opened this issue Apr 30, 2024 · 4 comments
Labels
a: filters Related to message filters: (antimalware, antispam, filtering, token_remover) s: planning Discussing details t: enhancement Changes or improvements to existing features

Comments

@thatbirdguythatuknownot
Copy link

thatbirdguythatuknownot commented Apr 30, 2024

Due to a recent incident, it is very important to note the need to special-case codeblocks' newline count for the antispam filter.
image
It is important to note that, as shown in the image, a codeblock renders about 2 extra lines worth of space compared to a regular text line. It is also recommended to special-case headers, as they make text a lot larger than usual (although I haven't computed it yet).

@ChrisLovering
Copy link
Member

There's quite a lot of features of this bot that interact with codeblocks, so this issue doesn't give us much to go off of for potentially fixing what you believe to be incorrect.

Could you specify where we should special case this count?

It might be easier if you provide reproduction steps, what the expected behaviour is, and what the current behaviour is.

If you believe this is an exploitable bug and shouldn't be discussed publicly, please follow our security notice

@thatbirdguythatuknownot
Copy link
Author

thatbirdguythatuknownot commented Apr 30, 2024

There was recently an incident with spam in #python-discussion where a user sent a lot of backticks that turned into codeblocks that flooded the chat. I think the relevant code is here.

@ChrisLovering
Copy link
Member

ChrisLovering commented Apr 30, 2024

So just to be clear then, this issue is related to the new lines filter potentially not working correctly for messages with backticks?

If so, could you update the original description & title to reflect that?

@thatbirdguythatuknownot
Copy link
Author

Yup.

@thatbirdguythatuknownot thatbirdguythatuknownot changed the title Newline count special-casing Newline antispam filter potentially handles actual rendered lines of formatting incorrectly Apr 30, 2024
@mbaruh mbaruh added s: planning Discussing details a: filters Related to message filters: (antimalware, antispam, filtering, token_remover) t: enhancement Changes or improvements to existing features labels Jul 5, 2024
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) s: planning Discussing details t: enhancement Changes or improvements to existing features
Projects
None yet
Development

No branches or pull requests

3 participants