Advisory

GHSA-5jfw-35xp-5m42

Also known as: None

Summary

Buffer length underflow in LoginPacket causing unchecked exceptions to be thrown

Details

Impact
LoginPacket uses BinaryStream->getLInt() to read the lengths of JSON payloads it wants to decode. Unfortunately, BinaryStream->getLInt() returns a signed integer, meaning that a malicious client can craft a packet with a large uint32 value for payload buffer size (which would be interpreted as a negative signed int32), causing BinaryStream->get() to throw an exception.

In the context of PocketMine-MP, this leads to a server crash when the vulnerability is exploited.

Patches
e3fce7632b94e83fd6a518a87dcaf6a11681c4ac

Workarounds
This can be worked around by registering a custom LoginPacket implementation into PacketPool which overrides this code to patch it.

For more information

Severity

High Basis: The source's own band: HIGH

Dates

Published
2022-04-05 17:53 UTC
Modified
2024-12-05 05:39 UTC

Affected packages and fixes

pocketmine/bedrock-protocol

Packagist · All systems

Affected

  • introduced 0, fixed 8.0.2 (ecosystem)

Fixed versions

8.0.2

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