You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Escape service-supplied text in ts cache purge output #1562
ts cache purge writes text it receives from the service straight to the terminal. A compromised or misconfigured service can embed terminal control sequences (ANSI escapes, carriage returns) that rewrite or hide the operator's output.
Two places in crates/trusted-server-cli/src/commands/cache/purge.rs are affected:
the success path writes the raw response_body (writeln!(out, "{response_body}"), around line 70);
the failure path appends response_body.trim() to the purge failed: {status}{hint} error (around lines 83-86).
ts keys (PR #1500) already escapes service text with escape_terminal_text from ad_templates/output.rs; ts cache purge should do the same.
Done when
Both purge output paths pass service-supplied text through escape_terminal_text.
Regression tests feed a body containing \u{1b} and \r on success and failure and assert neither reaches the rendered output.
Activity