Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented network encryption #2343

Merged
merged 6 commits into from
Jul 31, 2018
Merged

Implemented network encryption #2343

merged 6 commits into from
Jul 31, 2018

Conversation

dktapps
Copy link
Member

@dktapps dktapps commented Jul 29, 2018

Introduction

This has long been a missing part of PocketMine-MP's network security.

Network encryption was introduced in the pre-0.15.0 Realms alpha. It is used to prevent leakage of sensitive data and also to enforce validity of XBL login.

This is something I put off implementing for a long time because I didn't see it as necessary, it was difficult to do previously (due to the necessity to change various API to make it possible), and also incurs a performance hit.

However, some community members (generally proxy hackers) have discovered that it is possible to capture a pre-signed login from other sessions and replay it in a later session, passing authentication. This is known as a session stealing attack, like those which occurred on PC.

Session stealing attacks are possible because the client is not required to provide proof of ownership of the ECC keys used to sign the login.

Encryption fills in the missing piece of this jigsaw, making XBL authentication now completely secure unless one's account is hacked.

For those who don't know, historically login plugins like SimpleAuth were used prior to the implementation of XBL authentication. These kinds of plugins are still used by some server owners who were aware of the above session stealing attacks, but these are also insecure. SimpleAuth, for example, requires a player to type a password into chat, which can be stolen by MITM attack because it is sent across an unencrypted connection in cleartext!

Changes

Behavioural changes

  • Network encryption is now implemented and enabled by default. This has a performance cost, but this is the cost of security.
  • The pocketmine.yml option network.enable-encryption has been added, and is enabled by default. This can be disabled if you care more about performance than these kinds of attacks.

The impact of these changes on performance has not been fully measured yet - this is a TODO.

Dependency changes

Dependencies have been added for the following:

Backwards compatibility

This does not pose any backwards compatibility issues for plugins by itself, although it requires prior changes that do break API.

Furthermore, I anticipate that this will break the tools of most proxy hackers, which I don't think many server owners will be terribly bothered about. Server owners might even be thankful 🙃

Follow-up

Consider moving more of this code into extensions, since it is rather performance sensitive.

Tests

Has been tested with a range of clients.

@dktapps dktapps added Category: Core Related to internal functionality Priority: High PR: Contribution Category: Network Related to the internal network architecture labels Jul 29, 2018
@dktapps dktapps merged commit 2bf6764 into master Jul 31, 2018
@dktapps dktapps deleted the network-encryption branch July 31, 2018 14:54
@dktapps dktapps added this to the 4.0 milestone May 11, 2021
@dktapps dktapps added Type: Enhancement Contributes features or other improvements to PocketMine-MP and removed Type: Contribution labels Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Category: Network Related to the internal network architecture Priority: High Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant