Skip to content

fix: bind dashboard to loopback and escape HTML in trace rendering#27

Merged
OgeonX-Ai merged 1 commit into
masterfrom
fix/dashboard-loopback-xss
Jul 8, 2026
Merged

fix: bind dashboard to loopback and escape HTML in trace rendering#27
OgeonX-Ai merged 1 commit into
masterfrom
fix/dashboard-loopback-xss

Conversation

@OgeonX-Ai

Copy link
Copy Markdown
Contributor

Rescues a local-master commit (26ae34d, parallel Gemini session) stranded by branch protection: security hardening for the swarm dashboard — loopback-only bind + HTML escaping in trace rendering (data-exposure/XSS prevention). Diff vs master shows only the new fix; the base commit e85554a landed via PR #26.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26ae34dced

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dashboard/server.js
const url = require('url');
const { once } = require('events');

const TRACE_FILE = path.resolve('C:/PersonalRepo/.planning/traces.jsonl');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve traces from the checkout or configuration

When npm run dashboard-web is used outside the author's C:\PersonalRepo layout, this personal absolute path prevents the dashboard from reading the local trace file; in this Linux checkout, for example, Node resolves it under the repo as .../C:/PersonalRepo/.planning/traces.jsonl, so /data always errors and the web dashboard never shows traces. Derive the trace path from the repo root or an environment variable instead of hard-coding a machine-specific location.

Useful? React with 👍 / 👎.

Comment thread dashboard/server.js
Comment on lines +50 to +51
res.writeHead(500);
res.end('Error reading trace file');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return an empty JSON feed before traces exist

When the trace file has not been created yet, readLastLines() rejects with ENOENT and this branch returns a plain-text 500, but the browser client always calls await resp.json(). That makes the initial/no-traces state fail with a parse error on every poll instead of rendering an empty dashboard; handle missing files by returning [] with application/json.

Useful? React with 👍 / 👎.

@OgeonX-Ai OgeonX-Ai force-pushed the fix/dashboard-loopback-xss branch from 26ae34d to 45cc1f9 Compare July 8, 2026 13:24
@OgeonX-Ai OgeonX-Ai enabled auto-merge (squash) July 8, 2026 16:59
@OgeonX-Ai OgeonX-Ai merged commit 41444ad into master Jul 8, 2026
11 checks passed
@OgeonX-Ai OgeonX-Ai deleted the fix/dashboard-loopback-xss branch July 8, 2026 17:52
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