Summary
PocketMine-MP: Player entities can still die and drop items in flaggedForDespawn state
When an entity dies, the entity is flagged for despawn, but remains in the World's entity table, meaning it's still accessible by doing World->getEntity($entityId) and other methods. The same is true of a player when quitting the server.
When a network packet arrives from a client to attack an entity, the handler fetches the entity using World->getEntity($entityId) without any checks if the entity is already marked for despawning. Depending on the timing, the entity in question might already be in the flagged-for-despawn state when the action is processed. This means that the death handler for the entity might be run multiple times, causing loot and XP to be dropped multiple times, among other potential side effects.
Reproducing steps
To reproduce this vulnerability, two clients (Player A and Player B) are required.
Prerequisites:
- Player A (Victim): Must have the valuable items to be duplicated in their inventory and 1 HP (to ensure instant death).
- Player B (Attacker): Must be equipped with a weapon capable of dealing at least 1 damage.
Steps:
1. Player A and Player B stand next to each other.
2. Player A initiates the disconnect sequence (e.g., clicking "Disconnect" or "Exit to Menu").
3. Immediately after Player A triggers the disconnect (within a split-second window), Player B must attack and kill Player A.
4. Player A's character dies server-side, and their inventory drops on the ground.
5. Player B collects the dropped items.
6. Player A logs back into the server.
7. Result: Player A still possesses the original items in their inventory, while Player B holds the dropped copies.
Workarounds
Plugins can mitigate this issue on older versions by handling EntityDamageByEntityEvent, checking if the victim entity is flagged for despawn, and if so, cancelling the event.
Impact
GHSA-F9JP-856V-8642 has a CVSS score of 3.7 (Low). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.39.2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The issue was fixed in https://github.com/pmmp/PocketMine-MP/commit/c0719b76b18f2508143134e79bc9f1aa39109683 by adding checks for flagged-for-despawn entities in several affected locations.
While a cleaner fix would be to have World's various entity accessing methods exclude flagged-for-despawn entities, this was deemed too risky for 5.x as it would require significant internal changes.
Frequently Asked Questions
- What is GHSA-F9JP-856V-8642? GHSA-F9JP-856V-8642 is a low-severity security vulnerability in pocketmine/pocketmine-mp (composer), affecting versions < 5.39.2. It is fixed in 5.39.2.
- How severe is GHSA-F9JP-856V-8642? GHSA-F9JP-856V-8642 has a CVSS score of 3.7 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of pocketmine/pocketmine-mp are affected by GHSA-F9JP-856V-8642? pocketmine/pocketmine-mp (composer) versions < 5.39.2 is affected.
- Is there a fix for GHSA-F9JP-856V-8642? Yes. GHSA-F9JP-856V-8642 is fixed in 5.39.2. Upgrade to this version or later.
- Is GHSA-F9JP-856V-8642 exploitable, and should I be worried? Whether GHSA-F9JP-856V-8642 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-F9JP-856V-8642 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-F9JP-856V-8642? Upgrade
pocketmine/pocketmine-mpto 5.39.2 or later.