Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS01amZ3LTM1eHAtNW00Ms04jQ

Buffer length underflow in LoginPacket causing unchecked exceptions to be thrown

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

Permalink: https://github.com/advisories/GHSA-5jfw-35xp-5m42
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS01amZ3LTM1eHAtNW00Ms04jQ
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: over 2 years ago
Updated: almost 2 years ago


CVSS Score: 7.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Identifiers: GHSA-5jfw-35xp-5m42
References: Repository: https://github.com/pmmp/BedrockProtocol
Blast Radius: 15.3

Affected Packages

packagist:pocketmine/bedrock-protocol
Dependent packages: 4
Dependent repositories: 110
Downloads: 290,421 total
Affected Version Ranges: < 8.0.2
Fixed in: 8.0.2
All affected versions: 1.0.0, 1.1.0, 2.0.0, 3.0.0, 3.0.1, 3.0.2, 4.0.0, 4.0.1, 5.0.0, 5.1.0, 5.1.1, 5.1.2, 5.1.3, 6.0.0, 7.0.0, 7.1.0, 7.2.0, 7.3.0, 7.3.1, 8.0.0, 8.0.1
All unaffected versions: 8.0.2, 9.0.0, 9.0.1, 9.0.2, 10.0.0, 10.0.1, 11.0.0, 11.0.1, 11.0.2, 11.0.3, 11.0.4, 12.0.0, 12.1.0, 12.2.0, 13.0.0, 14.0.0, 15.0.0, 16.0.0, 17.0.0, 17.1.0, 18.0.0, 18.1.0, 18.2.0, 19.0.0, 19.1.0, 19.2.0, 19.3.0, 20.0.0, 20.1.0, 20.1.1, 20.1.2, 21.0.0, 21.0.1, 22.0.0, 23.0.0, 23.0.1, 23.0.2, 23.0.3, 23.0.4, 24.0.0, 25.0.0, 26.0.0, 27.0.0, 27.0.1, 27.0.2, 28.0.0, 28.0.1, 29.0.0, 30.0.0, 31.0.0, 32.0.0, 32.1.0, 32.2.0, 33.0.0, 34.0.0