GHSA-f9jp-856v-8642: PocketMine-MP Player Entities Can Still Die Vulnerability

LOW
CVSS 3.7
CWE-664
Published
Advisory Summary

GHSA-f9jp-856v-8642 is a LOW (CVSS 3.7) player entities can still die vulnerability (CWE-664: Improper Control of a Resource Through its Lifetime) affecting PocketMine-MP libraries in the Packagist ecosystem. The issue involves player entities can still die and drop items in flaggedfordespawn state. Remediation is available by upgrading affected packages to version 5.39.2.

GHSA-f9jp-856v-8642 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f9jp-856v-8642
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-664: Improper Control of a Resource Through its Lifetime
Affected Product PocketMine-MP
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-f9jp-856v-8642

To remediate this vulnerability, upgrade all affected PocketMine-MP dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pocketmine/pocketmine-mp fixed: 5.39.2
Upgrade pocketmine/pocketmine-mp to 5.39.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for pocketmine/pocketmine-mp

How to Check if You Are Affected

To determine whether your application is affected by GHSA-f9jp-856v-8642, inspect your project dependencies for PocketMine-MP:

inspect dependencies for pocketmine/pocketmine-mp

Analyze the terminal output to locate any version of PocketMine-MP in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.39.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-664: Improper Control of a Resource Through its Lifetime, where the product does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release. In PocketMine-MP, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 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.

GHSA-f9jp-856v-8642 Affected PocketMine-MP Versions

1 component(s)
Fixed Versions:
5.39.2
Product / Package Ecosystem Affected Versions Fixed Version
pocketmine/pocketmine-mp
Packagist
< 5.39.2
5.39.2

References

Frequently Asked Questions

What is GHSA-f9jp-856v-8642?
GHSA-f9jp-856v-8642 is a security vulnerability in PocketMine-MP involving Player entities can still die and drop items in flaggedForDespawn state under CWE-664: Improper Control of a Resource Through its Lifetime.
Which PocketMine-MP versions are affected?
Affected versions include releases prior to 5.39.2 across affected packages: pocketmine/pocketmine-mp.
What version fixes GHSA-f9jp-856v-8642?
Upgrading to 5.39.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pocketmine/pocketmine-mp affected?
Yes, pocketmine/pocketmine-mp is affected in releases prior to 5.39.2. Upgrade your dependency to 5.39.2 or later.
What is the CVSS score of GHSA-f9jp-856v-8642?
GHSA-f9jp-856v-8642 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-f9jp-856v-8642?
GHSA-f9jp-856v-8642 is classified under CWE-664: 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.).
How can I check Packagist dependencies for GHSA-f9jp-856v-8642?
Run the dependency tree command: 'inspect dependencies for pocketmine/pocketmine-mp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f9jp-856v-8642",
  "modified" : "2026-04-06T22:54:14Z",
  "published" : "2026-04-06T22:54:14Z",
  "aliases" : [ ],
  "summary" : "PocketMine-MP: Player entities can still die and drop items in flaggedForDespawn state",
  "details" : "### Summary\nWhen 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.\n\nWhen 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.\n\n### Reproducing steps\nTo reproduce this vulnerability, two clients (Player A and Player B) are required.\n\nPrerequisites:\n    - Player A (Victim): Must have the valuable items to be duplicated in their inventory and 1 HP (to ensure instant death).\n    - Player B (Attacker): Must be equipped with a weapon capable of dealing at least 1 damage.\n\nSteps:\n    1. Player A and Player B stand next to each other.\n    2. Player A initiates the disconnect sequence (e.g., clicking \"Disconnect\" or \"Exit to Menu\").\n    3. Immediately after Player A triggers the disconnect (within a split-second window), Player B must attack and kill Player A.\n    4. Player A's character dies server-side, and their inventory drops on the ground.\n    5. Player B collects the dropped items.\n    6. Player A logs back into the server.\n    7. Result: Player A still possesses the original items in their inventory, while Player B holds the dropped copies.\n\n### Patches\nThe issue was fixed in https://github.com/pmmp/PocketMine-MP/commit/c0719b76b18f2508143134e79bc9f1aa39109683 by adding checks for flagged-for-despawn entities in several affected locations.\n\nWhile 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.\n\n### Workarounds\nPlugins 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "pocketmine/pocketmine-mp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.39.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pmmp/PocketMine-MP/security/advisories/GHSA-f9jp-856v-8642"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pmmp/PocketMine-MP/commit/c0719b76b18f2508143134e79bc9f1aa39109683"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pmmp/PocketMine-MP"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-664" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-06T22:54:14Z",
    "nvd_published_at" : null
  }
}