Summary
PocketMine-MP mishandles malformed JSON in LoginPacket processing, allowing scalar JSON values to produce incompletely initialized objects. A remote attacker who can reach the server's login endpoint may send crafted data that leaves required properties unset and crashes the server.
Affected context
The vulnerability occurs in PocketMine-MP deployments that process network LoginPacket messages and convert JSON data into application objects without sufficiently enforcing the expected structure. It becomes risky when the login service is reachable by an untrusted or semi-trusted client and malformed scalar JSON values are accepted where structured objects are expected.
Exploit preconditions
- Attack surface: Network-accessible LoginPacket processing
- Required access: Ability to connect to the PocketMine-MP login service; authentication may not be required
- Trigger point: JSON parsing and object initialization during login handling
- Why exploitation is possible: Scalar JSON input can result in missing required object properties, which are later accessed without adequate initialization or validation
Why this happens
The underlying bug is an unsafe deserialization and validation pattern in which JSON values are converted into application objects before their type, structure, and required properties are fully verified. Accepting scalar JSON types where structured objects are expected can create partially initialized objects, and later property access may raise an unhandled error that terminates or destabilizes the server. This behavior maps to CWE-502: Deserialization of Untrusted Data.
Potential impact
- Remote attackers may crash the PocketMine-MP server
- Game sessions and connected clients could be disconnected
- Server availability may be reduced through repeated requests
- Operators may incur recovery and monitoring overhead
General mitigation guidance
Mitigation generally focuses on making network deserialization type-safe and failure-resistant.
Common defensive patterns include:
- Accepting only the expected JSON object types for LoginPacket fields
- Validating required properties before constructing or using application objects
- Rejecting malformed input through controlled error handling rather than uncaught exceptions
- Applying connection-level rate limits and abuse controls to login processing
- Running the server with only the privileges and network exposure it requires
- Treating all client-supplied JSON as untrusted regardless of the surrounding protocol
How teams detect issues like this
Organizations can detect related issues through:
- Static analysis for unchecked property access after JSON parsing
- Code review checks for deserialization without explicit type and schema validation
- Tests covering scalar, null, missing-field, and malformed JSON values in login handlers
- Runtime monitoring for repeated login parsing exceptions, abnormal disconnects, and unexpected server restarts
- Policy enforcement requiring bounded input validation and controlled exception handling at network boundaries
- Automated security review tools that identify unsafe deserialization and insufficient input validation patterns

