/

CVE-2024-58381

Severity:

HIGH RISK

(7.5)

Unsafe Deserialization (CWE-502) in PocketMine Login

CVE-2024-58381

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Denial of Service

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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

Sources

SourceLink
github.comgithub.com/pmmp/PocketMine-MP/commit/6872661fd03649cc7a8762c41c16e9ee5a4de1c9
github.comgithub.com/pmmp/PocketMine-MP/commit/b96a209f9e8b76b899a0d0918493cd87eb3c02a7
github.comgithub.com/pmmp/PocketMine-MP/security/advisories/GHSA-h6j3-j35f-v2x7
vulncheck.comvulncheck.com/advisories/pocketmine-mp-before-5.11.1-denial-of-service-via-loginpacket

Frequently asked

questions

Yes. Exploitation may be possible remotely when an attacker can reach the server's login-processing endpoint and submit malformed JSON.

Generally, login processing occurs before successful authentication, so the key requirement is network access to the relevant service rather than an established account. Deployment-specific access controls may narrow this scope.

Enforce strict JSON type and schema validation before object construction or property access, and handle rejected input without allowing uncaught exceptions to terminate the server.

Use boundary validation, test malformed and unexpected JSON types, apply rate limits to unauthenticated endpoints, and monitor for parsing failures and repeated server crashes.

Find out what's already
exploitable in your codebase.