nickserv/chanserv: reject look-alike / mixed-script registration names (homoglyph impersonation guard)
All checks were successful
CI / check (push) Successful in 3m56s

This commit is contained in:
Jean Chevronnet 2026-07-19 00:02:44 +00:00
parent 03f9c2d3bd
commit c2b70f5004
No known key found for this signature in database
3 changed files with 110 additions and 0 deletions

View file

@ -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