Skip to content

Port over LCEMP's RCE Patches#1023

Merged
codeHusky merged 4 commits intomainfrom
fix/lcemp-rce-fix
Mar 9, 2026
Merged

Port over LCEMP's RCE Patches#1023
codeHusky merged 4 commits intomainfrom
fix/lcemp-rce-fix

Conversation

@codeHusky
Copy link
Collaborator

@codeHusky codeHusky commented Mar 9, 2026

Description

Introduces various packet parsing safety checks based on LCEMP/LCEMP@d017bfc. Note that this RCE is due to faults in the code from 4JStudios and not due to code from LCEMP.

Changes

Root Cause

Various components do not handle improperly defined sizes/lengthsproperly. While most of the existing code is fairly safe (such as the ByteArrayIO classes), limits can be defined that exceed anything reasonable in malicious packets that could cause clients / servers to improperly decode / encode the data.

New Behavior

Packets with invalid length values will now silently fail rather than doing potentially unsafe, unchecked operations. Similar fixes were applied to components on the receiving end of these packets, like inventory systems.

Fix Implementation

Various maximum length checks and value maximum checks were introduced in relevant places in the code. LCEMP's ByteArrayIO related classes were also copied over since they have a few additions / improvements we didn't have

AI Use Disclosure

No AI was used, this was manually patched in from the LCEMP commit

Note

It would be wise to have the client immediately disconnect when these protocol violations occur. Cleanup should be done soon to handle this properly (immediate disconnect, report it to console, notify player of protocol violation) rather than failing silently like this.

@codeHusky codeHusky marked this pull request as ready for review March 9, 2026 10:32
@codeHusky codeHusky merged commit bda3b10 into main Mar 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant