Skip to content

Sanitize agent provenance output in the experts command (GHSA-ccf9-h2wr-2rj3) - #3249

Closed
Stavin13 wants to merge 2 commits into
entireio:mainfrom
Stavin13:fix/experts-render-sanitize
Closed

Stavin13 wants to merge 2 commits into
entireio:mainfrom
Stavin13:fix/experts-render-sanitize

Conversation

@Stavin13

@Stavin13 Stavin13 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

wrong thing everything needed is emailed over

These renderers print checkpoint metadata and session state outside the
tokens reports covered by tokens_sanitize_test.go: the attribution why
line, session info, restored-session display and session ID validation.
Encode the contract that escape sequences, OSC payloads and bidi
controls never reach the terminal, and reject C1 control characters and
bidi runes in ValidateSessionID at write time — the same advisory class
as GHSA-ccf9-h2wr-2rj3.

Signed-off-by: stavinfernandes <stavinfernandes2098@gmail.com>
The experts command renders agent-provenance data in two render modes
(text renderExpertsWithStyles, interactive expertsTUIModel.View) and
neither sanitized it. The provenance fields — agent labels, session
IDs, branches, skills, tool mix, MCP server names, matched files —
aggregate checkpoint metadata, which GHSA-ccf9-h2wr-2rj3 establishes as
attacker-craftable via push access to the checkpoints ref: the same
vulnerability class as the tokens renderer fix (entireio#3221), in a command
that advisory did not cover.

Every provenance field now passes through sanitizeExpertsForTerminal at
the render boundary — the text renderer sanitizes its own input and the
TUI model sanitizes in its constructor, following the merged pattern
where each renderer covers its callers rather than relying on them.
--json keeps raw values by contract; the JSON encoder escapes control
characters itself.

Signed-off-by: stavinfernandes <stavinfernandes2098@gmail.com>
@Stavin13
Stavin13 requested a review from a team as a code owner November 30, 2026 06:21
@Stavin13

Copy link
Copy Markdown
Contributor Author

Withdrawing this PR for now.

@Stavin13 Stavin13 closed this Nov 30, 2026
@Stavin13
Stavin13 deleted the fix/experts-render-sanitize branch November 30, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant