From 71804a2e65826ae8b0b1ca05e78663886d6dfa04 Mon Sep 17 00:00:00 2001 From: Luna <90072930+LunaWasFlaggedAgain@users.noreply.github.com> Date: Mon, 11 Jul 2022 17:15:03 -0300 Subject: [PATCH] Validate block entity tag query positions (#42) --- ...ate-block-entity-tag-query-positions.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/server/0041-Validate-block-entity-tag-query-positions.patch diff --git a/patches/server/0041-Validate-block-entity-tag-query-positions.patch b/patches/server/0041-Validate-block-entity-tag-query-positions.patch new file mode 100644 index 0000000..ffb96e7 --- /dev/null +++ b/patches/server/0041-Validate-block-entity-tag-query-positions.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luna +Date: Mon, 11 Jul 2022 17:10:17 -0300 +Subject: [PATCH] Validate block entity tag query positions + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index d6aa46443b0ec9b02259222d8ee9a7ff0cec4ae7..dd80826c8ce1a9bb479eea383d84b71c8756a341 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -1252,7 +1252,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + @Override + public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) { + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); +- if (this.player.hasPermissions(2)) { ++ if (this.player.hasPermissions(2) && Level.isInSpawnableBounds(packet.getPos())) { // Scissors - Validate block entity tag query positions + BlockEntity tileentity = this.player.getLevel().getBlockEntity(packet.getPos()); + CompoundTag nbttagcompound = tileentity != null ? tileentity.save(new CompoundTag()) : null; +