SpigotMC / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
https://www.spigotmc.org/go/bungeecord
Other
1.56k stars 1.1k forks source link

Implement Disconnect Spam / Rate limit for commands #3424

Open uRyanxD opened 1 year ago

uRyanxD commented 1 year ago

Bungeecord version

latest

Server version

all (Server version doesn't matter for this issue)

Client version

all (Client version doesn't matter for this issue)

Bungeecord plugins

None

The bug

I don't know much about this "exploit", I found out from LPX's Discord (anticrash plugin) apparently spamming bungee-commands can crash the proxy

Information extracted from the LPX discord: PROXY COMMAND SPAM Problem: You can spam proxy commands without any cooldown Versions: BungeeCord and other forks, Velocity Fixes: Put a proxy command limiter such as BetterSecurity Video: https://youtu.be/Ue_T5Zh1Hgk (nice one to SmogClient and @Null)

Log output (links)

I don't have logs, lpx discord is this: https://discord.gg/sPwM2ZE (I found the information about the vulnerability in the #vulnerabilities channel)

Checking

Outfluencer commented 1 year ago

First of all you can't crash the server by spamming commands, you could make one netty thread lag that is executing you commands. Second, by sending that much commands you could create a simple firewall to fix this by dropping too much traffic as nothing should lag if you're not sendin 10000 commands or more a second. And my last thoughts are about why it is lagging, i think its maybe lagging cause chatcomponent genreation when sending the no permission message or the /bungee output so we could add a cache for string to components

md-5 commented 1 year ago

On the last point I think the issue is more slow plugin commands

xism4 commented 1 year ago

On the last point I think the issue is more slow plugin commands

BungeeCord commands such as /bungee could be cached to prevent problems.

md-5 commented 1 year ago

BungeeCord commands such as /bungee could be cached to prevent problems.

But they're not the problem. Also https://github.com/SpigotMC/BungeeCord/blob/master/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java