Repository navigation
Escape DEL and C1 control characters in client logs - #2488
Merged
Merged
Conversation
Layer: 1-escape-control-chars
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Client log text could carry DEL and C1 control characters that pino leaves raw, letting a terminal or log viewer reinterpret an entry.
User-facing: none
escapeControlCharactersinlogging.tsrewrites U+007F–U+009F as\uXXXX. Pino's JSON serialization already escapes newlines and the other C0 characters, so those and backslashes are untouched. The length cap, 400 and 415 behavior are unchanged.Evidence
Before: DEL and C1 characters reached the log entry as raw bytes.
After:
app.test.tssends U+007F, U+0080, U+0085 and U+009F and asserts\u007f,\u0080,\u0085,\u009f, plus a mixed message and a case that plain text, backslashes and newlines pass through.Verified live:
curlagainst a locally running proxy; no raw 0x7f or C1 bytes in the log output.Merge Danger
Door: two-way
Impact: log text only
Related
🤖 Written by an AI agent on my behalf.