Skip to content

PocketMine-MP: Player entities can still die and drop items in flaggedForDespawn state

Low severity GitHub Reviewed Published Apr 4, 2026 in pmmp/PocketMine-MP • Updated Apr 6, 2026

Package

composer pocketmine/pocketmine-mp (Composer)

Affected versions

< 5.39.2

Patched versions

5.39.2

Description

Summary

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.

Patches

The issue was fixed in pmmp/PocketMine-MP@c0719b7 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.

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.

References

@dktapps dktapps published to pmmp/PocketMine-MP Apr 4, 2026
Published to the GitHub Advisory Database Apr 6, 2026
Reviewed Apr 6, 2026
Last updated Apr 6, 2026

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

EPSS score

Weaknesses

Improper Control of a Resource Through its Lifetime

The product does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release. Learn more on MITRE.

CVE ID

No known CVE

GHSA ID

GHSA-f9jp-856v-8642

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.