Skip to content

Apply upstream security hardening (parent PR #29) to fork #1

Description

@cbeaulieu-gt

Summary

This fork (cbeaulieu-gt/claude-code-cli-ui) is missing the security hardening drafted in the parent repo Ngxba/claude-code-cli-ui PR Ngxba#29 ("harden security — patch 7 critical and 3 high vulnerabilities"). Parent PR Ngxba#29 is still open/unmerged upstream, so a normal upstream-master merge does not deliver the fixes. Plan: cherry-pick the PR Ngxba#29 head branch (fix/security-hardening, single commit e25420e8) onto a feature branch of this fork, resolve conflicts, and ship all fixes in one PR.

Vulnerabilities patched

Sev Issue File(s)
Critical Command injection via exec() server/api/reveal.post.ts
Critical Arbitrary file read (no path restriction) server/api/files.get.ts
Critical Arbitrary directory listing server/api/directories.get.ts
Critical Hardcoded bypassPermissions SDK mode server/utils/claudeSdk.ts, server/utils/providers/claudeProvider.ts
Critical XSS — v-html sinks without sanitizer app/utils/markdown.ts, app/utils/messageFormatting.ts
Critical MCP import writes arbitrary configs server/api/mcp/import.post.ts
High Path traversal via agent slugs server/utils/agentUtils.ts
High Debug endpoint leaks process.env.PATH server/api/debug/claude-cli.get.ts
High Orphaned PTY processes on shutdown server/utils/cliSession.ts

Adds server/utils/path-security.ts, dompurify (+ types), and a vitest test suite (tests/security/*, vitest.config.ts).

Known conflicts vs current master

merge-tree against master (HEAD 4649427) predicts conflicts in:

  • package-lock.json (regenerate)
  • server/utils/providers/claudeProvider.ts (this fork's MCP transport/capability work overlaps the bypassPermissions fix)

Acceptance criteria

🤖 Generated by Claude Code on behalf of @cbeaulieu-gt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions