Skip to content

fix(support-output): safely render dashboard values and decode Git streams — prevent injection and corrupted repository state - #770

Merged
unohee merged 1 commit into
mainfrom
swarm/AGT-3493-fix-support-output-safely-render-dashboa
Sep 28, 2026
Merged

unohee merged 1 commit into
mainfrom
swarm/AGT-3493-fix-support-output-safely-render-dashboa

Conversation

@unohee

@unohee unohee commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Salvaged from a draft left by a parked autonomous run (original body said "failed 4 times … very likely incomplete"). Re-applied onto current main (the branch was 177 commits behind) and verified.

What it does

  • src/support/dashboardHtml.ts: renders dashboard values through a sanitizer (safeCssClass, escapeHtml on hot-module names) so untrusted issue/PR text cannot break out of the markup.
  • src/support/gitTracker.ts: decodes git subprocess output as a stream (TextDecoder … { stream: true } / stdoutDecoder) so multibyte output is not split at chunk boundaries.

Verification (on current main)

  • npx tsc --noEmit → clean
  • npx vitest run src/support/dashboardHtml.test.ts src/support/gitTracker.test.ts → 24 passed
  • Pre-commit (oxlint + type check + file sizes) → passed
  • Confirmed unique vs main: no matching patch-id in main history; main still uses data.toString() and the raw inline-style span.

Notes

  • Rebased onto origin/main; package-lock.json untouched.

…reams (AGT-3493)

Salvaged from draft PR #770: re-applied onto current main (was 177 commits
behind). Sanitizes dashboard-rendered values and decodes git subprocess
output as a stream so multibyte output is not split.
@unohee
unohee force-pushed the swarm/AGT-3493-fix-support-output-safely-render-dashboa branch from 6d9b82f to 56f3fa7 Compare September 28, 2026 05:38
@unohee
unohee marked this pull request as ready for review September 28, 2026 05:39
@unohee
unohee merged commit f89f07b into main Sep 28, 2026
7 checks passed
@unohee
unohee deleted the swarm/AGT-3493-fix-support-output-safely-render-dashboa branch September 28, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant