-
Notifications
You must be signed in to change notification settings - Fork 57
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
Protections can ban mods for ban/redact events #200
Comments
Oh, good point. Would you be interested in working on fixing this? |
I don't think I can. I'm not familiar with the codebase and also am not really a JS/TS programmer (although I can pretty much read the code). Also it looks like there is a nontrivial build/test setup and I'm not really prepared to engage with that. I took a look and it looks like the current system doesn't actually have any mechanism for checking the roles/permissions of users at all (only for the bot itself, to ensure that it can do its work). Is that correct? |
Yeah, it bans for any kind of events, Workaround (if you trust your mods)
Now the bot isn't able to ban your mods. In case the protection gets triggered, it will throw a bunch of errors:
The ban will not happen because the bot does not have the needed powerlevel to do that. Not optimal, but a temporary fix. |
It is not allowed by the state resolution, so it's likely @BrenBarn had a lower powerlevel than the bot. |
Yes, in the scenario BrenBarn described, this is true. The bot had a powerlevel of 100, and BrenBarn had a powerlevel of 50. What I was describing was a different scenario with the same outcome but under a false assumption. I was assuming the test-user triggering BasicFloodingProtection had the same powerlevel as the bot (powerlevel 100) in the room we tested in and the bot was able to ban the user. But after reviewing the logs, this was not the case. The powerlevel change happened after the user was banned, not before. After recreating the scenario, as it was intended, I was unable to replicate what I claimed before:
I run the (new) test with three kinds of events:
The bot is not a homeserver admin and the test-user's and bot's accounts do not belong to the same homeserver. As a result:
|
I still think it would be a good idea (at least as an option) to prevent the bot from banning users with a certain power level. You might want to have mods in the room who can do some things (like kick/ban/redact) but not high-level admin actions (like changing the power level of other users), and you don't want those mods to get banned. One way to do it would be to have the bot check the power level of the user it's about to ban, and not ban users who have sufficient power to ban other users. |
This, i believe this is the cleanest solution. |
this is a clean and simple solution, though i don't know if mjolnir passively holds enough state to know what someone's power level is without costly API calls. i'll try to figure this out |
It strikes me that a generic "ignore" list would be useful anyway (e.g. to add bots that look spammy but are alright), which could then be added to/removed from through rules (e.g. a power level change) as an additional feature. The list would be much easier to implement and would provide a bunch of functionality. I note that an "ignore" list was also asked for in #321, for an entirely different purpose. |
prior art on this; IRC anti-spam tooling ignores messages from people with even superficial access; e.g. give a bot a power level of 1 if you want it spared from automated spam checks |
I was super excited about I mean, it's great, and really, really useful (actually, thanks to the people who made/run it ), but until this issue gets resolved, it will also be the victim of the flooding protection, every time. We can't give Workaround
|
|
(that anti-scam bot probably should get a rate limit to not react on every message in a wave but wait to the end and then react) |
Hopefully fixed by #544 |
It appears that the flood protection does not check to determine who is sending the event and/or what type of event it is. This means that if a room mod sends redact or ban events "manually" (e.g., via their client, without going through Mjolnir), the bot may ban them for "spamming".
Steps to reproduce the behavior:
Be a mod in a room. Have some other users send a bunch of messages. Then go into the Element side panel and ban the users and/or redact their messages. If you do this too many times too quickly, you will get banned by the bot.
Expected behavior
The automated protections should never ban mods or admins from the room.
Probably also admin-type events like bans or redactions should not "count" for purposes of determining whether a user is "flooding". Might need to think about what event types should count. (We probably want to protect against things like a user spamming by repeatedly changing their display name or whatever.)
The text was updated successfully, but these errors were encountered: