Skip to content

Escape terminal control characters in command output - #2905

Open
fnando wants to merge 2 commits into
mainfrom
escape-c1-json
Open

fnando wants to merge 2 commits into
mainfrom
escape-c1-json

Conversation

@fnando

@fnando fnando commented Dec 1, 2026

Copy link
Copy Markdown
Member

What

Escape terminal control characters in all command output, whether it comes from the chain or from a server. JSON output now also escapes C1 controls (U+0080..U+009F). A clippy lint stops new direct serde_json::to_string calls.

Why

serde_json leaves C1 controls unescaped, so on-chain strings could send CSI/OSC sequences to terminals that act on them (xterm.js/VS Code, VTE, WezTerm, xterm). For example, an attacker could rewrite stellar events output to fake a token transfer, or overwrite the clipboard.

Known limitations

A serde_json::Value printed through Display isn't caught by the lint. #2811 and #2903 cover the remaining network and attestation fields.

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Dec 1, 2026
@fnando fnando self-assigned this Dec 2, 2026
@fnando
fnando requested review from a team and leighmcculloch December 2, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

1 participant