From 020afc9e9913027e5891b3abccc094c7bde3d16d Mon Sep 17 00:00:00 2001 From: Luna <90072930+LunaWasFlaggedAgain@users.noreply.github.com> Date: Mon, 29 May 2023 20:32:04 -0300 Subject: [PATCH] Fix component extra empty array exploit (#83) --- ...-component-extra-empty-array-exploit.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patches/server/0053-Fix-component-extra-empty-array-exploit.patch diff --git a/patches/server/0053-Fix-component-extra-empty-array-exploit.patch b/patches/server/0053-Fix-component-extra-empty-array-exploit.patch new file mode 100644 index 0000000..a9172ec --- /dev/null +++ b/patches/server/0053-Fix-component-extra-empty-array-exploit.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luna +Date: Mon, 29 May 2023 19:47:48 -0300 +Subject: [PATCH] Fix component extra empty array exploit + + +diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java +index e6d733fc3a4acdb3fd91b5644285854943a02761..68d7739e44dc31ddf3f3c4fca4b3b7095060ac52 100644 +--- a/src/main/java/net/minecraft/network/chat/Component.java ++++ b/src/main/java/net/minecraft/network/chat/Component.java +@@ -248,6 +248,12 @@ public interface Component extends Message, FormattedText, Iterable { + } else if (!jsonelement.isJsonObject()) { + if (jsonelement.isJsonArray()) { + JsonArray jsonarray = jsonelement.getAsJsonArray(); ++ // Scissors start ++ if (jsonarray.size() <= 0) { ++ throw new JsonParseException("Unexpected empty array of components"); ++ } ++ // Scissors end ++ + MutableComponent ichatmutablecomponent = null; + Iterator iterator = jsonarray.iterator(); +