KoalaBotUK / KoalaBot

🐨 All in one Discord bot for student societies & communities
https://KoalaBot.uk
MIT License
11 stars 8 forks source link

Fix injection vulnerability with multiple emails #408

Closed hydrowan closed 1 year ago

hydrowan commented 1 year ago

Summary

When a user verifies with the bot they are prompted to provide an email address to verify they belong to the domain the bot has been set up with. The bot detects if the domain is present, but does not filter out multiple emails. It is possible to 'inject' your own random email followed by a comma and a fake institutional email to gain access to any server.

I have tried to be as unintrusive as possible with a fix, but do not have the ability to test these changes. Please note this adds the requirement for regular expressions.

Checklist