mojira.dev
MC-249893

Authlib: MinecraftSessionService#fillProfileProperties doesn't check if server returns an error

When sending a request to session server with invalid UUID, it would return a JSON object with error messages, e.g. https://sessionserver.mojang.com/session/minecraft/profile/0000000000000000000901fcec0bde59

{
  "path": "/session/minecraft/profile/0000000000000000000901fcec0bde59",
  "errorMessage": "Not a valid UUID: 0000000000000000000901fcec0bde59",
  "developerMessage": "Not a valid UUID: 0000000000000000000901fcec0bde59"
}

This makes calling

Minecraft.getInstance().getMinecraftSessionService().fillProfileProperties(new GameProfile(uuid, null), true);

crashes the game because it return a GameProfile with both uuid and name null.

Background

I make a mod that shows the owner of a pet if you look at it, it works fine for vanilla server, but when it used in a Geyser server, it would use a different UUID format for bedrock player, making this issue happen.

Comments 1

The method in question is removed in authlib 5.0.46, included in 23w31a. Therefore, this bug is fixed in 23w31a.

deirn

(Unassigned)

Plausible

Platform

Normal

Networking

1.18.2

23w31a

Retrieved