RustSeverity: MediumStatus: Published
Stored cross-site scripting when opening untrusted traces in the ACP trace viewer
Opening a .jsons recording in agent-client-protocol-trace-viewer inserts the from and to component names into the SVG diagram as markup rather than plain text, so a recording with attacker-controlled names can run JavaScript in the viewer page (CWE-79). This affects versions >= 0.11.0, <= 5.4.0; the maintainer patched it in 5.5.0 with pull request 514, and the published advisory credits ucsurf.
Impact
agent-client-protocol-trace-viewer has a stored cross-site scripting vulnerability (CWE-79). When a user opens a .jsons recording, the viewer inserts the from and to component names into its SVG diagram as markup rather than plain text. A recording with attacker-controlled component names can cause JavaScript to run in the viewer page when the recording is displayed.
The viewer listens only on 127.0.0.1. The page and its read-only /events endpoint share an origin. Script running in the page can read the trace currently being served and change what the user sees. The trace may contain prompts, file contents, and other protocol payloads. This finding does not establish host command execution, arbitrary local file access, or modification of the underlying recording.
The standalone viewer and agent-client-protocol-conductor --serve use the same renderer. The conductor generates its own component names, but protocol peers can supply method names, which affected versions truncate without escaping. Script execution through the truncated method name alone has not been demonstrated. Recording a trace without displaying it does not trigger the issue.
Affected versions and fix
All 27 published versions of agent-client-protocol-trace-viewer, from 0.11.0 through 5.4.0 inclusive, contain the affected renderer.
The maintainer fixed this in 5.5.0. Pull request 514, merged as 8ac65cf, escapes component names and truncated message labels before inserting them into the diagram. It also displays load-error messages as plain text rather than interpreting them as HTML.
Workarounds
Until a build contains the fix, inspect untrusted .jsons recordings in a plain-text editor rather than the trace viewer. Live viewing with --serve has the same issue when protocol peers are untrusted. Trace capture can still be used without opening the viewer.
Timeline
- Found
- Reported via private vulnerability report
- Advisory published
- Entry last updated
Machine-readable: JSON · Markdown · ID security/rust/agentclientprotocol__rust-sdk/2026-11-21-trace-viewer-stored-xss
If this work is useful to you, you can support it on Buy Me a Coffee.