Limit max size of subscription codec#13943
Open
HaHaWTH wants to merge 1 commit into
Open
Conversation
Contributor
|
I think we should set the value in the configuration settings and disable it by default |
Contributor
Author
Could you clarify when this limit would need to be disabled or changed? The current vanilla debug subscription count is 16, so 64 seems safe above the expected value while still preventing abusive decode sizes. I am not sure Paper's global configuration is guaranteed to be loaded before this codec is initialized. |
Member
|
Given this is a debug feature, I believe having it limited by default is fine. General making exploit fixes opt-in somewhat defeats their purpose imo |
Member
|
Thank you for your PR! Yeah, this does not need to be configurable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a maximum size limit to the
ServerboundDebugSubscriptionRequestPacketcodec.Debug subscription packets are known to be abused by hack clients, in local testing, one client was able to fully occupy at least one Netty IO thread on a high-end system without triggering Paper's packet limiter.
Fix
Requests containing more than 64 subscriptions are now rejected and disconnect the client with a DecoderException to avoid excessive CPU usage and memory alloc.
The max size should be changed once Mojang adds more subscriptions in DebugSubscriptions. (currently the total count of subscriptions is 16 tho)