Skip to content

Filter out disallowed control chars#14057

Merged
lynxplay merged 1 commit into
PaperMC:mainfrom
HaHaWTH:fix/filter-control-chars
Jul 25, 2026
Merged

Filter out disallowed control chars#14057
lynxplay merged 1 commit into
PaperMC:mainfrom
HaHaWTH:fix/filter-control-chars

Conversation

@HaHaWTH

@HaHaWTH HaHaWTH commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Filtering disallowed chat characters before adding the command to the suggestion click event, prevents component serialization from failing on malformed console input and crashing the server instantly.

To Reproduce

  1. Launch the server
  2. Type any unicode control chars or § in the console
  3. Press enter and server crashed

Crash report

Stacktrace
Description: Exception in server tick loop

java.lang.RuntimeException: Failed to encode Minecraft Component: empty[style={color=gray,clickEvent=SuggestCommand[command=/§]}, siblings=[literal{§}[style={color=red,underlined}], translation{key='command.context.here', args=[]}[style={color=red,italic}]]]; Disallowed chat character: '§'
	at io.papermc.paper.adventure.WrapperAwareSerializer.lambda$deserialize$0(WrapperAwareSerializer.java:28)
	at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287)
	at io.papermc.paper.adventure.WrapperAwareSerializer.deserialize(WrapperAwareSerializer.java:28)
	at io.papermc.paper.adventure.WrapperAwareSerializer.deserialize(WrapperAwareSerializer.java:13)
	at io.papermc.paper.adventure.PaperAdventure.asAdventure(PaperAdventure.java:175)
	at net.minecraft.commands.Commands.finishParsing(Commands.java:446)
	at net.minecraft.commands.Commands.performCommand(Commands.java:374)
	at net.minecraft.commands.Commands.performCommand(Commands.java:366)
	at net.minecraft.commands.Commands.performPrefixedCommand(Commands.java:357)
	at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:574)
	at net.minecraft.server.dedicated.DedicatedServer.tickConnection(DedicatedServer.java:530)
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1838)
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1621)
	at net.minecraft.server.dedicated.DedicatedServer.tickServer(DedicatedServer.java:404)
	at net.minecraft.server.MinecraftServer.processPacketsAndTick(MinecraftServer.java:1679)
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1349)
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:303)
	at java.base/java.lang.Thread.run(Thread.java:1474)

@HaHaWTH
HaHaWTH requested a review from a team as a code owner July 12, 2026 17:59
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Jul 12, 2026
@papermc-projects papermc-projects Bot moved this from Awaiting review to Full approval in Paper PR Queue Jul 25, 2026
@lynxplay
lynxplay merged commit 013d163 into PaperMC:main Jul 25, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Full approval to Merged in Paper PR Queue Jul 25, 2026
@HaHaWTH
HaHaWTH deleted the fix/filter-control-chars branch July 25, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

2 participants