spec-workflow-mcp
- Type
- MCP server
- Scanned
- Nov 13, 2026
- Version
- d38e82eaa8a6
- Files read
- 379
Spec Workflow MCP is an AI helper, local web dashboard, and VS Code extension that guides coding assistants through writing software plans, tracking tasks, and collecting human approvals. The biggest risk is that crafted text or a tricked AI assistant could run unwanted commands in VS Code, run harmful scripts in the passwordless web dashboard, or read files and change or delete JSON files outside your project.
What it can reach
- Files
- Reads, creates, edits, and deletes workflow, approval, and log files in your project's .spec-workflow folder and ~/.spec-workflow-mcp (or SPEC_WORKFLOW_HOME), and reads project files linked in approval reviews.
- Network
- Runs a passwordless local web server on port 5000 for the dashboard, and connects to registry.npmjs.org for updates and packages, as well as cdn.jsdelivr.net and notificationsounds.com.
- Shell commands
- Runs Git commands in your project folder to find Git repository and worktree folders.
- Browser
- Automatically opens your default web browser to the local dashboard on startup unless disabled, and opens external links from the VS Code extension.
Findings
-
HighPath traversal in approvalId allows deleting or modifying arbitrary JSON files
src/dashboard/approval-storage.ts:335
ApprovalStorage.findApprovalPath validates category folder names but concatenates the approval ID directly into path.join(categoryPath,
${id}.json) without checking for .. or path separators. A prompt-injected AI agent calling the approvals MCP tool with action 'delete' and a traversal approvalId (such as ../../../../package or ../../../../../../Users/victim/.claude/settings) can permanently delete any readable JSON file on the machine whose top-level status field is not 'pending'. The same unvalidated lookup is used by single-item dashboard approval endpoints (allowing JSON file corruption) and by SpecWorkflowService.findApprovalPath in the VS Code extension.Fix: Validate id with PathUtils.validateSimplePathSegment(id, 'approvalId') and use PathUtils.safeJoin(categoryPath,
${id}.json) in both ApprovalStorage and the VS Code extension's SpecWorkflowService. -
HighTrusted Markdown hovers in VS Code extension allow arbitrary command execution
vscode-extension/src/extension/services/ApprovalEditorService.ts:484
createApprovalHoverMessage and createCommentHoverMessage set message.isTrusted = true on VS Code MarkdownString instances and append untrusted fields (approval.title, approval.response, approval.annotations, and comment.text) directly via appendMarkdown without escaping. Setting isTrusted = true enables all VS Code command: URIs, including workbench.action.terminal.sendSequence. A prompt-injected agent creating an approval request (or a crafted approval file in a repository) can embed a disguised command: link in the title that executes arbitrary shell commands in the VS Code terminal when clicked by the user.
Fix: Restrict message.isTrusted to { enabledCommands: ['spec-workflow.approveFromEditor', 'spec-workflow.rejectFromEditor', 'spec-workflow.requestRevisionFromEditor', 'spec-workflow.editComment', 'spec-workflow.deleteComment'] } and render user-controlled text using appendText instead of appendMarkdown.
-
MediumStored XSS in web dashboard via Mermaid securityLevel 'loose' and unsafe-inline CSP
src/dashboard_frontend/src/modules/mdx-editor/plugins/mermaidPlugin.tsx:25
MermaidRenderer initializes Mermaid with securityLevel: 'loose' and injects the rendered SVG into the DOM via dangerouslySetInnerHTML. Because MDXEditorWrapper automatically renders mermaid code blocks in view and edit modes and the dashboard's Content-Security-Policy allows script-src 'unsafe-inline', any spec, steering document, or approval file containing a malicious mermaid diagram (for example, an HTML tag with an onerror handler inside a node label) executes arbitrary JavaScript when viewed in the dashboard, giving full access to all unauthenticated dashboard file and job APIs.
Fix: Change Mermaid's securityLevel to 'strict' (or sanitize rendered SVG with DOMPurify) and remove 'unsafe-inline' from script-src in createSecurityHeadersMiddleware.
-
MediumUnpatched arbitrary file read in dashboard approval content endpoint and VS Code extension
src/dashboard/multi-server.ts:638
Although version 2.2.4 added path validation to ApprovalStorage and the approvals MCP tool, the dashboard's GET /api/projects/:projectId/approvals/:id/content route implements its own path resolution that still accepts absolute paths and .. traversal in approval.filePath. Because the Approvals page automatically fetches content for every pending approval, a crafted approval JSON inside .spec-workflow/approvals/ (from a cloned repository or written directly by a workspace-confined agent) causes the dashboard to read arbitrary files outside the workspace (such as ~/.ssh/id_rsa or /etc/passwd). The VS Code extension's resolveApprovalFilePath in ApprovalEditorService.ts and SpecWorkflowService.ts has the same unpatched behavior.
Fix: Delegate file reading in multi-server.ts to project.approvalStorage.getCurrentFileContent(id) and enforce PathUtils.safeJoin and PathUtils.validatePathWithinBases in the VS Code extension's resolveApprovalFilePath methods.
-
MediumScript tag breakout and missing CSP in VS Code comment modal webview
vscode-extension/src/extension/services/CommentModalService.ts:114
CommentModalService injects selectedText and existingComment into an inline <script> block using raw JSON.stringify, and comment-modal.html defines no Content-Security-Policy. Because JSON.stringify does not escape closing </script> tags, selecting text in an untrusted file that contains </script><script>... and running 'Add Comment' (or editing a crafted comment from an approval file) breaks out of the script block and executes arbitrary JavaScript in the VS Code webview.
Fix: Escape '<' as '\u003c' when serializing JSON into HTML <script> tags (or pass initial state via postMessage) and add a nonce-based Content-Security-Policy to comment-modal.html.
-
MediumOptional projectPath parameter in MCP tools allows escaping the configured workspace
The approvals, spec-status, and log-implementation MCP tools allow the caller to override the server's configured context.projectPath with an arbitrary projectPath argument. Because validateProjectPath only blocks a small denylist of OS directories (/etc, /usr, /bin, etc.) and log-implementation skips validateProjectPath entirely, a prompt-injected agent can point approvals action:'request' at sensitive directories such as the user's home folder (/Users/victim) and copy secret files (like .ssh/id_ed25519 or .aws/credentials) into .spec-workflow/approvals/.../.snapshots/ JSON files, or write logs into other repositories.
Fix: Remove the projectPath input parameter from MCP tools and always enforce the trusted context.projectPath configured when starting the MCP server.
-
MediumClaude plugin runs unpinned latest package from npm at startup
Both .claude-plugin/.mcp.json and .claude-plugin/with-dashboard/.mcp.json run npx with -y and the floating @latest tag instead of the fixed version declared in plugin.json (2.2.6). Every time the AI agent starts the plugin, it can silently download and execute newly published code from npm without asking, meaning a future compromise of the npm package would immediately run attacker code on existing installations.
Fix: Pin @pimzino/spec-workflow-mcp to the exact release version matching plugin.json in both .claude-plugin/.mcp.json and .claude-plugin/with-dashboard/.mcp.json.
-
LowPath traversal via spec name parameter in dashboard API routes
src/dashboard/multi-server.ts:557
Multiple dashboard routes—including PUT /api/projects/:projectId/specs/:name/:document, GET /api/projects/:projectId/specs/:name/all, GET /api/projects/:projectId/specs/:name/all/archived, PUT /api/projects/:projectId/specs/:name/tasks/:taskId/status, and POST /api/projects/:projectId/specs/:name/implementation-log—pass the :name URL parameter directly into path.join instead of PathUtils.getSpecPath or PathUtils.safeJoin. URL-encoded traversal sequences (such as ..%2F..%2F) in :name allow reading or overwriting requirements.md, design.md, tasks.md, or implementation logs in arbitrary directories outside .spec-workflow/specs.
Fix: Validate the :name parameter with PathUtils.validateSimplePathSegment(name, 'spec name') and resolve spec directories exclusively through PathUtils.getSpecPath and PathUtils.getArchiveSpecPath.
-
LowMissing Host header validation exposes local dashboard to DNS rebinding
src/core/security-utils.ts:305
The local dashboard has no authentication and relies on CORS to block cross-origin browser requests, while allowing any request without an Origin header. Because browsers do not send an Origin header on same-origin GET requests and the server does not validate the HTTP Host header, a malicious website can use DNS rebinding (resolving its domain to 127.0.0.1) to read all GET endpoints on port 5000, leaking project paths, specifications, steering documents, implementation logs, and pending approval file contents.
Fix: Add an onRequest middleware hook that rejects requests whose Host header does not match localhost, 127.0.0.1, or [::1] (with the expected port) unless external access is explicitly enabled, and require an authentication token.
-
LowClaude plugin configurations execute unpinned @latest package from npm at runtime
Both .claude-plugin/.mcp.json and .claude-plugin/with-dashboard/.mcp.json run npx -y @pimzino/spec-workflow-mcp@latest on startup rather than pinning to the plugin version. Every launch automatically downloads and executes whatever version is currently tagged latest on npm without user confirmation, increasing exposure to npm supply-chain compromise.
Fix: Pin the package version in .mcp.json to match the exact version in plugin.json and update it via scripts/sync-plugin-version.js.
-
LowUnannounced third-party network requests from web dashboard
src/dashboard_frontend/src/modules/notifications/NotificationProvider.tsx:75
When dashboard notification sounds are enabled (the default), NotificationProvider fetches audio from https://notificationsounds.com/storage/sounds/file-sounds-1150-pristine.mp3 on notifications, leaking client IP addresses and activity timing to a third-party domain. In addition, HighlightStyles.tsx loads stylesheets from cdn.jsdelivr.net without Subresource Integrity hashes, and multi-server.ts queries registry.npmjs.org on every dashboard startup.
Fix: Bundle the notification sound file and highlight.js stylesheets locally (as already done in the VS Code extension) and read the local package.json version instead of querying registry.npmjs.org by default.
-
LowDocker image disables external-binding guard while quick-start commands expose port 5000 to the network
The web dashboard has no password or user login, yet lets anyone who reaches it view project specs and file snapshots, approve or reject documents, and write revisions to workspace files. Outside Docker, the server blocks binding to 0.0.0.0 unless external access is explicitly enabled, but containers/Dockerfile enables SPEC_WORKFLOW_BIND_ADDRESS=0.0.0.0 and SPEC_WORKFLOW_ALLOW_EXTERNAL_ACCESS=true by default while the Docker CLI quick-start commands in README.md and containers/README.md use -p 5000:5000 instead of -p 127.0.0.1:5000:5000, exposing the dashboard to everyone on the same Wi-Fi or LAN despite README.md stating it binds to 127.0.0.1 by default.
Fix: Update all Docker CLI examples in README.md and containers/README.md to bind to localhost with -p 127.0.0.1:5000:5000 by default, and add authentication before allowing network access.
