Narrow sign exploit blacklist

This commit is contained in:
2026-04-06 17:32:56 -05:00
parent c94c29cb5f
commit fe4675d606
2 changed files with 5 additions and 52 deletions

View File

@@ -6,35 +6,10 @@ import net.minecraft.text.Text;
import net.minecraft.text.TextContent;
import net.minecraft.text.TranslatableTextContent;
import java.util.Locale;
public final class TextSanitizer {
private static final String[] VANILLA_TRANSLATION_PREFIXES = {
"advancement.",
"attribute.",
"block.minecraft.",
"chat.",
"commands.",
"death.",
"effect.minecraft.",
"enchantment.minecraft.",
"entity.minecraft.",
"gui.",
"item.minecraft.",
"itemGroup.",
"key.",
"menu.",
"options.",
"pack.",
"recipe.",
"resourcePack.",
"stat.minecraft.",
"subtitles.",
"tutorial."
};
private static final String[] BLACKLISTED_KEY_PARTS = {
"gey.glazed.",
"meteorline",
"meteorclient",
"metiorclient",
"itemscroller",
@@ -61,11 +36,11 @@ public final class TextSanitizer {
TextContent content = text.getContent();
if (content instanceof TranslatableTextContent translatable) {
return isBlacklistedKey(translatable.getKey()) || !isVanillaTranslationKey(translatable.getKey());
return isBlacklistedKey(translatable.getKey());
}
if (content instanceof KeybindTextContent keybind) {
return isBlacklistedKey(keybind.getKey()) || !isVanillaKeybindKey(keybind.getKey());
return isBlacklistedKey(keybind.getKey());
}
for (Text sibling : text.getSiblings()) {
@@ -110,34 +85,12 @@ public final class TextSanitizer {
}
}
private static boolean isVanillaTranslationKey(String key) {
if (key == null || key.isEmpty()) {
return false;
}
for (String prefix : VANILLA_TRANSLATION_PREFIXES) {
if (key.startsWith(prefix)) {
return true;
}
}
return key.contains(".minecraft.");
}
private static boolean isVanillaKeybindKey(String key) {
if (key == null || !key.startsWith("key.")) {
return false;
}
return key.indexOf('.', 4) < 0;
}
private static boolean isBlacklistedKey(String key) {
if (key == null || key.isEmpty()) {
return false;
}
String lower = key.toLowerCase(Locale.ROOT);
String lower = key.toLowerCase();
for (String part : BLACKLISTED_KEY_PARTS) {
if (lower.contains(part)) {
return true;

View File

@@ -79,7 +79,7 @@ public abstract class ClientConnectionMixin {
ExploitState.CapturedSignData captured = ExploitState.SIGNS.get(pos);
if (captured == null || !captured.isSuspicious()) {
SignLeakShieldTraceLog.info(
"Outgoing sign packet allowed: captured sign missing or vanilla-safe pos=%s front=%s capturedPresent=%s",
"Outgoing sign packet allowed: captured sign missing or not blacklisted pos=%s front=%s capturedPresent=%s",
pos,
signPacket.isFront(),
captured != null