GHSA-f9jp-856v-8642: 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.
References
Code Behaviors & Features
Detect and mitigate GHSA-f9jp-856v-8642 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →