Skip to content

fix(mcp): shell-quote doctor next commands - #439

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-unescaped-repo-name-in-command-output
Jun 6, 2026
Merged

fix(mcp): shell-quote doctor next commands#439
JSONbored merged 1 commit into
mainfrom
codex/fix-unescaped-repo-name-in-command-output

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The doctor checklist emitted copy-pastable shell commands using untrusted login and repoFullName values which could contain shell metacharacters and enable command-substitution when pasted into a shell.

Description

  • Add a shellArg helper and use it in doctorNextCommand to quote dynamic values in generated commands (profile, --login, and --repo) in packages/gittensory-mcp/bin/gittensory-mcp.js to prevent shell injection.
  • Update the login and preflight recommendation strings to call shellArg so safe plain tokens remain unquoted while unsafe values are single-quoted with internal single-quotes escaped.
  • Add a regression test shell-quotes doctor next command values derived from local repo metadata to test/unit/mcp-cli.test.ts that sets a crafted remote containing command-substitution and asserts both JSON and human doctor output include the quoted repo argument.

Testing

  • Ran npm test -- test/unit/mcp-cli.test.ts and all tests passed (Tests 44 passed).
  • Ran npm run build:mcp which completed successfully (type-check step passed).
  • Verified git diff --check/lint-style check showed no issues.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 6f581a9 Commit Preview URL

Branch Preview URL
Jun 06 2026, 07:58 AM

@github-actions github-actions Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 6, 2026
@ghost

ghost commented Jun 6, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #439 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 6, 2026
@JSONbored JSONbored self-assigned this Jun 6, 2026
@JSONbored
JSONbored merged commit 7aa1409 into main Jun 6, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-unescaped-repo-name-in-command-output branch June 6, 2026 10:03
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 6, 2026
@github-actions github-actions Bot mentioned this pull request Jun 6, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant