GHSA-f9jp-856v-8642: PocketMine-MP: Player entities can still die and drop items in flaggedForDespawn state
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.
Published Apr 6, 2026
Affected packages
pocketmine/pocketmine-mp
- Ecosystem
- Composer (PHP)
- Affected
- < 5.39.2
- Fixed in
- 5.39.2
- Check
composer show pocketmine/pocketmine-mp
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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:
- Player A and Player B stand next to each other.
- Player A initiates the disconnect sequence (e.g., clicking "Disconnect" or "Exit to Menu").
- Immediately after Player A triggers the disconnect (within a split-second window), Player B must attack and kill Player A.
- Player A's character dies server-side, and their inventory drops on the ground.
- Player B collects the dropped items.
- Player A logs back into the server.
- Result: Player A still possesses the original items in their inventory, while Player B holds the dropped copies.
Patches
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.
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.
Credited to kostamax27, dktapps.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesGHSA-pg53-p7qp-65cv
PocketMine-MP has potential memory/network vulnerability from repeated ResourcePackClientResponsePacket packets
low2.3Oct 29, 2026GHSA-xp4f-g2cm-rhg7
PocketMine-MP has LogDoS by many junk properties in client data JWT in LoginPacket
medium6.9Apr 15, 2026GHSA-788v-5pfp-93ff
PocketMine-MP: JSON decoding of unlimited size large arrays/objects in ModalFormResponse Handling
high7.1Apr 6, 2026GHSA-7hmv-4j2j-pp6f
PocketMine-MP: Network amplification vulnerability with `ActorEventPacket`
medium4.3Apr 6, 2026GHSA-h6rj-3m53-887h
PocketMine-MP: LogDoS by large complex unknown property logging in clientData in LoginPacket
high7.5Apr 6, 2026GHSA-fqqv-56h5-f57g
PocketMine-MP `ResourcePackDataInfoPacket` amplification vulnerability due to lack of resource pack sequence status checking
high8.7Sep 2, 2025
