mojira.dev
MC-1433

UDP Query Protocol does not properly unpack/pack integers, session IDs are not returned correctly

The query protocol in the Minecraft server has an I/O bug that is dependent upon the default charset used in the host system. Currently, integers are unpacked via code equivalent to the following: http://pastebin.com/raw.php?i=pNRJgzyB

This is unreliable, and will not properly unpack the integer into bytes. As a result, the Minecraft server will not always send back the proper session ID. Session IDs are sent back properly for the first 128 numbers on most charsets, but after that point the bug occurs.

We discovered this bug while writing software that polls information from over 20,000 Minecraft servers simultaneously for our website, Minestatus. It sure caused us quite a headache! We have implemented our own workaround that allows us to properly update all of our servers by generating session IDs that will come back correctly, but it was not simple. We recommend the following methods be used instead to unpack/pack integers/bytes: http://pastebin.com/raw.php?i=eeX59pHz

These two methods will guarantee that all session IDs will be unpacked and packed properly.
Thank you for your time.

Environment

All environments.

Comments 3

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

I am no longer able to reproduce the problem, seems to be resolved.

Thanks for the update.

migrated

(Unassigned)

Unconfirmed

query, server

Minecraft 1.4.2

Minecraft 1.4.7

Retrieved