Advisory

GHSA-wjfq-88q2-r34j

Also known as: CVE-2022-51014

Summary

Unhandled exception when decoding form response JSON

Details

Impact
When handling form responses from the client (ModalFormResponsePacket), the Minecraft Windows client may send weird JSON that json_decode() can't understand. A workaround for this is implemented in InGamePacketHandler::stupid_json_decode().

An InvalidArgumentException is thrown by this function when it fails to fix an error found in the JSON, which is not caught by the caller. This leads to a server crash.

Patches
56fe71d939c38fe14e18a31a673a9331bcc0e4ca

Workarounds
A plugin may handle DataPacketReceiveEvent, capture ModalFormResponsePacket and run the provided JSON through stupid_json_decode.

Note that this requires copying the body of the function to a plugin, since the function is currently private.

For more information
If you have any questions or comments about this advisory:

Severity

High Basis: The source's own band: HIGH

Dates

Published
2022-01-21 23:02 UTC
Modified
2026-09-08 12:38 UTC

Affected packages and fixes

pocketmine/pocketmine-mp

Packagist · All systems

Affected

  • introduced 4.0.0, fixed 4.0.7 (ecosystem)

Fixed versions

4.0.7

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences