{"id":"GHSA-5jfw-35xp-5m42","aliases":["GHSA-5jfw-35xp-5m42"],"related":[],"kind":"vulnerability","state":"published","title":"Buffer length underflow in LoginPacket causing unchecked exceptions to be thrown","summary":"### Impact\n`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.\n\nIn the context of PocketMine-MP, this leads to a server crash when the vulnerability is exploited.\n\n### Patches\ne3fce7632b94e83fd6a518a87dcaf6a11681c4ac\n\n### Workarounds\nThis can be worked around by registering a custom `LoginPacket` implementation into `PacketPool` which overrides [this code](https://github.com/pmmp/BedrockProtocol/blob/47532c95ea37d5f0365b23f734d70d943ff95295/src/LoginPacket.php#L54) to patch it.\n\n### For more information\n* Email us at [team@pmmp.io](mailto:team@pmmp.io)","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### Impact\n`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.\n\nIn the context of PocketMine-MP, this leads to a server crash when the vulnerability is exploited.\n\n### Patches\ne3fce7632b94e83fd6a518a87dcaf6a11681c4ac\n\n### Workarounds\nThis can be worked around by registering a custom `LoginPacket` implementation into `PacketPool` which overrides [this code](https://github.com/pmmp/BedrockProtocol/blob/47532c95ea37d5f0365b23f734d70d943ff95295/src/LoginPacket.php#L54) to patch it.\n\n### For more information\n* Email us at [team@pmmp.io](mailto:team@pmmp.io)","format":"markdown","source":"ghsa"}],"published":"2022-04-05T17:53:22.000Z","modified":"2024-12-05T05:39:20.852Z","severity":{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-124"],"affected":[{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"8.0.2"}],"ecosystem":"Packagist","package":"pocketmine/bedrock-protocol","purl":"pkg:composer/pocketmine/bedrock-protocol","source":"ghsa"}],"references":[{"url":"https://github.com/pmmp/BedrockProtocol/security/advisories/GHSA-5jfw-35xp-5m42","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pmmp/BedrockProtocol/commit/e3fce7632b94e83fd6a518a87dcaf6a11681c4ac","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pmmp/BedrockProtocol","tags":["package"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5jfw-35xp-5m42","url":"https://github.com/advisories/GHSA-5jfw-35xp-5m42","licence":"CC-BY-4.0","modified":"2024-12-05T05:39:20.852Z"}],"updatedAt":"2026-11-25T22:56:31.203Z"}