SECURITY: Fix mediawiki merging accounts

Mediawiki turns any number of _ into whitespace, so Foo__Bar and
Foo_Bar and Foo_Bar_ would be mapped to the same account, leading to
account takeover.
master
Gabriel Pérez-Cerezo 2020-02-24 13:43:11 +01:00
parent 65ff7842ba
commit 77f7a30167
1 changed files with 10 additions and 0 deletions

View File

@ -14,3 +14,13 @@ if http then
dofile(MP .. "/webmail.lua")
mail.webmail_init(http, webmail_url, webmail_key)
end
minetest.register_on_prejoinplayer(function(name, ip)
if minetest.player_exists(name) then
return
end
if name:match("_") then
return "For security reasons, underscores are banned on this server. Please choose another username!"
end
end)