nickserv/chanserv: reject look-alike / mixed-script registration names (homoglyph impersonation guard)
All checks were successful
CI / check (push) Successful in 3m56s
All checks were successful
CI / check (push) Successful in 3m56s
This commit is contained in:
parent
03f9c2d3bd
commit
c2b70f5004
3 changed files with 110 additions and 0 deletions
|
|
@ -131,6 +131,12 @@ impl Service for ChanServ {
|
|||
ctx.notice(me, from.uid, format!("\x02{chan}\x02 can't be registered: {reason}"));
|
||||
return;
|
||||
}
|
||||
// Refuse a look-alike / mixed-script channel name (e.g. a Cyrillic
|
||||
// homoglyph of a real channel).
|
||||
if let Some(reason) = echo_api::confusable_reason(chan) {
|
||||
ctx.notice(me, from.uid, reason);
|
||||
return;
|
||||
}
|
||||
match db.register_channel(chan, account) {
|
||||
Ok(()) => {
|
||||
ctx.channel_mode(me, chan, "+r"); // mark the channel registered
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue