Nested empty arrays in the extra component crashes the game in ways that can be very easily exploited
Explanation
The "extra" component was introduced in 1.7 to help make text components more customizable and flexible. However, a bug was introduced in the process in which supplying an empty array within the "extra" component array would, through a jungle of serialization, throw a NullPointerException when attempting to process the component. In multiple circumstances, this can crash the game or cause chunks with block entities containing the bugged component to fail to save. This bug has lingered in the component system starting in versions 1.7.2 to the latest version, 1.20.1.
In some cases, this exploit is also capable of causing chunks and even entities to completely fail to save.
Steps to reproduce
Method 1:
- Load a world that you don't care about
- Use this command:
/give @p black_shulker_box{BlockEntityTag:{CustomName:'{"text":"","extra":[[]]}'}}
- Place the shulker box (on the server side, the chunk will never be able to save once the shulker box has been placed)
- Open the shulker box
Method 2:
- Load a world that you don't care about
- Use this command:
/give @p minecraft:black_shulker_box{display:{Name:'{"text":"","extra":[[]]}'}}
- Attempt to hover over the item in your inventory or switch to the inventory slot containing the item
Method 3:
- Load a world that you don't care about
- Use this command:
/give @p minecraft:camel_spawn_egg{EntityTag:{CustomName:'{"text":"","extra":[[]]}'}}
- Place the spawn egg (this will crash the server so badly it fails to save the entity that you just created)
Method 4:
- Load a world that you don't care about
- Use this command:
/team add lol {"text":"","extra":[[]]}
- Pause the game
Method 5:
- Load a world that you don't care about
- Use this command:
/give @p command_block{BlockEntityTag:{CustomName:'{"text":"","extra":[[]]}',Command:"say hi"}}
- Place the command block (on the server side, the chunk will never be able to save once this has been placed)
- Power the command block with a torch or lever
2023-06-25, 03:51 AM
2024-04-26, 09:23 AM
2024-04-26, 09:23 AM
1
3
block-entity, chunk, component, crash, entity, extra, npe, nullpointerexception