From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: 0x22 <0x22@futureclient.net> Date: Thu, 26 Apr 2018 04:41:11 -0400 Subject: [PATCH] Fix exploit that allowed colored signs to be created diff --git a/src/main/java/net/minecraft/SharedConstants.java b/src/main/java/net/minecraft/SharedConstants.java index a70c3d25930e7414fc9e897de8d2e0c12f11c0e4..04b8783417bbcd826d6d1c302551fbad9c48bd01 100644 --- a/src/main/java/net/minecraft/SharedConstants.java +++ b/src/main/java/net/minecraft/SharedConstants.java @@ -20,6 +20,7 @@ public class SharedConstants { return chr != 167 && chr >= ' ' && chr != 127; } + public static String filterAllowedChatCharacters(String input) { return filterText(input); } // Paper - OBFHELPER public static String filterText(String s) { StringBuilder stringbuilder = new StringBuilder(); char[] achar = s.toCharArray(); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 8d0c44b6c2c99d5161c5d4b79209b79ff6db75e4..fb36aa08cd2fbe3f7262dccb8cf0f7cae55aea9c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2786,7 +2786,7 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener { List lines = new java.util.ArrayList<>(); for (int i = 0; i < list.size(); ++i) { - lines.add(net.kyori.adventure.text.Component.text(list.get(i))); + lines.add(net.kyori.adventure.text.Component.text(SharedConstants.filterAllowedChatCharacters(list.get(i)))); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created. } SignChangeEvent event = new SignChangeEvent(org.bukkit.craftbukkit.block.CraftBlock.at(worldserver, blockposition), this.getPlayer(), lines); this.craftServer.getPluginManager().callEvent(event);