Skip to content

Unauthenticated sessions take up player slots, preventing players from joining

Moderate
dktapps published GHSA-474q-9hgp-hcvx Dec 30, 2022

Package

composer pocketmine/pocketmine-mp (Composer)

Affected versions

4.12.2

Patched versions

4.12.3

Description

Impact

PocketMine-MP currently does not limit the maximum number of unauthenticated sessions. Max player count is checked only when PlayerPreLoginEvent is reached. No problems so far.

On a 100-player server, an attacker can create 110 sessions, and never send the LoginPacket. These sessions won't be kicked as explained above (until a 10-second login timeout is reached). However, since these unauthenticated sessions are included for the max-players check, this means that any real player who sends a LoginPacket is immediately disconnected.

The solution to this is fairly simple: only include sessions in the max-players check which themselves have already passed a max-players check, i.e. sessions which have sent a LoginPacket. (Note that this is NOT the same as count(getOnlinePlayers()), as getOnlinePlayers() only includes connections for which a Player has been created.)

Patches

This problem has been fixed by 59be901.

Workarounds

A possible workaround is to increase the max player count of your server. This isn't a great solution, but it helps to mitigate the problem by making it harder to fill all the player slots. You can also un-cancel PlayerPreLoginEvent if the reason is SERVER_FULL (but beware of using getOnlinePlayers() for a replacement check, as this will allow your max-players to be exceeded in some cases).

Severity

Moderate

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
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

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:L/PR:N/UI:N/S:U/C:N/I:N/A:L

CVE ID

No known CVE

Weaknesses

No CWEs

Credits