Skip to content

Add exception handling to NetManager#6523

Open
mastermiller01 wants to merge 4 commits intospace-wizards:masterfrom
mastermiller01:patch-4
Open

Add exception handling to NetManager#6523
mastermiller01 wants to merge 4 commits intospace-wizards:masterfrom
mastermiller01:patch-4

Conversation

@mastermiller01
Copy link
Copy Markdown
Contributor

@mastermiller01 mastermiller01 commented Apr 9, 2026

When a client sends a malformed packet that (for any unforseeable reason, not just decryption) might throw an exception, currently it goes almost completely unhandled.
This PR changes it to catch and log the error, then kick the client and have an event for content to do admin alert, etc. with the channel after it's been kicked.

I have tested this with a well-behaved client and nothing bad happens to it.

@mastermiller01

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@moonheart08 moonheart08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a fix. Malformed packets should be rejected without exceptions being thrown and the client disconnected. Exceptions, admin alerts, logs, etc waste CPU time and give denial of service attempts extra beef.

If you or someone else has crash logs demonstrating a problem here, please DM it to me on discord @moonykay and I'll resolve this correctly.

@mastermiller01
Copy link
Copy Markdown
Contributor Author

This PR does not throw any exceptions.
To also use it for a DOS attack you'd have to constantly reconnect which is insanely obvious.
Blindly hoping that exceptions never happen without language support is a joke and is bound to repeat itself in the future as more things change.

@JohnJJohn
Copy link
Copy Markdown
Contributor

Is this gonna be merged any time soon? Both goob and trauma were getting ddossed because of this, traumas already merged this in their own robust toolbox but it would be far better if it was merged on the actual one

@moonheart08
Copy link
Copy Markdown
Contributor

Is this gonna be merged any time soon? Both goob and trauma were getting ddossed because of this, traumas already merged this in their own robust toolbox but it would be far better if it was merged on the actual one

Are goob and trauma using the actual fix, or are they experiencing something new and novel they should be reporting? Because not reporting problems is precisely why I'm not a fan of this fix.

@JohnJJohn
Copy link
Copy Markdown
Contributor

Are goob and trauma using the actual fix, or are they experiencing something new and novel they should be reporting? Because not reporting problems is precisely why I'm not a fan of this fix.

Trauma is using this fix and the ddos has stopped and is experiencing no abnormalities, goob doesn't have this and was getting ddossed a few days ago.....

@moonheart08
Copy link
Copy Markdown
Contributor

Are goob and trauma using the actual fix, or are they experiencing something new and novel they should be reporting? Because not reporting problems is precisely why I'm not a fan of this fix.

Trauma is using this fix and the ddos has stopped and is experiencing no abnormalities, goob doesn't have this and was getting ddossed a few days ago.....

Is trauma using this fix, or the upstream fix. Because that's my question. Obviously this works, but my point is it doesn't fix the underlying issue. The engine is not a "well it works :)" environment.

@PJB3005 PJB3005 added A: Game Networking Networking for primary game traffic Priority: 2-Important labels May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: Game Networking Networking for primary game traffic Priority: 2-Important

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants