Malformed Json in NBT tag of a spawn_egg used in a dispenser makes the server crash (JsonSyntaxException, MalformedJsonException)
A player on my server managed to make my server crash (1.15.2, Spigot) exploiting a bug that I managed to reproduce on vanilla Minecraft (see attached crash reports).
The bug
The player was in creative mode, he used a creeper_spawn_egg with some NBT (see screenshot), that he put in a dispenser and activated it with a redstone signal (lever, button, or whatever). This action crashes the server and generate a crash report that you can see attached.
This bug is also reproductible in single player, making Minecraft crash completely.
How to reproduce
- Give yourself this creeper egg :
- /give @p minecraft:creeper_spawn_egg{EntityTag:{CustomName:"NotJson",CustomNameVisible:1}} 1
- Put the egg in a dispenser.
- Activate that dispenser with a lever.
- The server will crash and a crash report will be generated