fix: sanitize untrusted terminal output to prevent escape sequence injection#240
Draft
bukinoshita wants to merge 1 commit intomainfrom
Draft
fix: sanitize untrusted terminal output to prevent escape sequence injection#240bukinoshita wants to merge 1 commit intomainfrom
bukinoshita wants to merge 1 commit intomainfrom
Conversation
…jection Add safeTerminalText utility that strips ANSI/VT control sequences and dangerous C0 control characters from untrusted data before rendering to the terminal in interactive mode. Applied to: - webhooks listen: sanitize type, resourceId, and detail from webhook payloads - table renderer: sanitize all cell contents in renderTable - All get commands: sanitize API-returned fields in interactive output - emails receiving listen: sanitize inbound email fields JSON/pipe mode is unaffected since it uses JSON.stringify which escapes control bytes. Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
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 by cubic
Sanitizes all untrusted interactive CLI output to block ANSI/OSC escape sequence injection (BU-650). Adds a shared
safeTerminalTexthelper and applies it across webhooks, emails receiving, tables, and all interactive get commands.safeTerminalTextto strip ANSI/VT and dangerous control chars (keeps tabs/newlines).webhooks listen(type/resourceId/detail), table renderer (all cells),emails receiving listen, and allgetcommands.Written for commit 5f04f30. Summary will update on new commits.