
Scan a repo for AI-IDE config files that can trigger RCE via Claude Code hooks, Cursor rules, MCP auto-registration. Detects CVE-2025-59536, CVE-2026-21852, CVE-2026-30615 + Pillar Rules File Backdoor patterns.
Scan a repository for AI-IDE configuration files that can trigger RCE, credential theft, or persistent compromise of developer machines when the repo is opened in Claude Code, Cursor, Windsurf, Continue, or any VS Code fork.
Built in response to the April 2026 AI-IDE disclosure wave:
settings.json SessionStart / PreToolUse / PostToolUse / UserPromptSubmit hooks execute arbitrary shell commands on workspace open..cursorrules / .windsurfrules / .github/copilot-instructions.md / .continue/*.md that hide attacker directives from a human reviewer.ANTHROPIC_BASE_URL / OPENAI_BASE_URL / OPENAI_API_BASE redirection to attacker-controlled endpoints (prompt + API-key exfiltration).mcp.json / .mcp.json / .cursor/mcp.json / .claude/mcp.json with arbitrary command stdio invocation..vscode/tasks.json autorun on workspace open.Run it on every third-party repo you clone before opening it in an AI-powered editor.
No install — use npx:
npx valtik-ai-ide-config-guard <path>
Or install globally:
npm i -g valtik-ai-ide-config-guard
ai-ide-config-guard <path>
Node 20+ required.
$ npx valtik-ai-ide-config-guard ./my-cloned-repo
With a failure threshold (for CI):
$ npx valtik-ai-ide-config-guard . --fail-on high
JSON output:
$ npx valtik-ai-ide-config-guard . --json > report.json
SARIF 2.1.0 (for GitHub code scanning):
$ npx valtik-ai-ide-config-guard . --sarif > report.sarif
Run a subset of checks:
$ npx valtik-ai-ide-config-guard . --checks G1,G3,G5
Full flag list: npx valtik-ai-ide-config-guard --help.
Finds .claude/settings.json and parses hooks.SessionStart / hooks.PostToolUse / hooks.PreToolUse / hooks.UserPromptSubmit (and related lifecycle events). If any entry sets a command string (or type: "command" inside the grouped grammar), the finding is CRITICAL — opening the repo in Claude Code executes the command under the developer's shell with their env, SSH keys, and tokens.
Scans .cursorrules, .cursor/rules/*.md[c], .windsurfrules, .windsurf/rules/*.md[c], .github/copilot-instructions.md, .continue/*.md for:
ignore previous, from now on, system:, etc.)Pure-Cyrillic text, emoji, and BOMs at file start are ignored — we only flag what hides content from a human reviewer.
Parses mcp.json, .mcp.json, .claude/mcp.json, .cursor/mcp.json, .windsurf/mcp.json, .vscode/mcp.json, .continue/config.json. For each registered server:
command matches src/fixtures/known-malicious-mcp.json → CRITICALcommand is a local binary → HIGHcommand is npx / uvx / pipx pulling an unverified package → MEDIUMurl is non-https → MEDIUMurl points to localhost / LAN → MEDIUMFlags any task with runOptions.runOn: "folderOpen". Severity escalates if the command uses shell interpolation (curl | sh, wget | bash, eval, base64 -d, backticks, $(...)) or references an external URL.
Scans .env*, .claude/settings.json, .cursor/config.json, .vscode/settings.json, and any mcp.json for:
ANTHROPIC_BASE_URL, ANTHROPIC_API_URLOPENAI_BASE_URL, OPENAI_API_BASE, OPENAI_API_URLIf the host is not the canonical vendor endpoint (api.anthropic.com / api.openai.com), the finding is CRITICAL — every request and API key goes to the attacker's endpoint. Non-cloud hosts (localhost, LAN IPs) are flagged HIGH.
Flags .vscode/settings.json that ships with security.workspace.trust.enabled: false (or the Cursor analog), which silently opts out of the native gate that blocks autorun behavior.
In rules .md / .mdc files, scans for fenced code blocks containing curl | sh, wget | bash, rm -rf, eval, base64 -d, python -c, /dev/tcp, reverse-shell mkfifo, chmod +x. Severity rises when the surrounding prose is imperative ("run this", "execute the following command").
Informational flag for scripts named claude*, cursor*, windsurf*, mcp*, continue*, copilot*, aider*, cline*. HIGH if the same name collides with an npm lifecycle hook (preinstall, postinstall, etc.) — lifecycle hooks run on npm install with no user confirmation.
GitHub Actions:
- name: AI-IDE config guard
run: npx valtik-ai-ide-config-guard . --fail-on high
Or SARIF upload:
- run: npx valtik-ai-ide-config-guard . --sarif > ai-ide.sarif
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ai-ide.sarif
test/fixtures/safe/ is a design goal — we'd rather miss a borderline case than teach users to ignore us.npx dry runs, no URL fetches).This tool is static analysis. A clean report means "the 8 checks shipped with this version did not fire", not "this repo is safe to open in an AI-IDE." Treat every repo you did not author as hostile and apply workspace-trust, hook review, and MCP review by hand.
MIT License — Copyright (c) 2026 Valtik Studios LLC.
| ID | Severity | What it catches |
|---|
| G1 | CRITICAL | Claude Code hook that runs shell on session / tool-use events |
| G2 | HIGH / MEDIUM | Bidi / zero-width / tag chars, homoglyphs, or role-override patterns in rules |
| G3 | CRITICAL / HIGH / MEDIUM | MCP server registered with risky command or url |
| G4 | HIGH / MEDIUM | .vscode/tasks.json with runOn: folderOpen |
| G5 | CRITICAL / HIGH | ANTHROPIC_BASE_URL / OPENAI_BASE_URL / OPENAI_API_BASE redirected |
| G6 | HIGH / INFO | Workspace-trust disabled, task.autoDetect: on |
| G7 | HIGH / MEDIUM | Dangerous shell patterns in fenced blocks inside rules markdown |
| G8 | HIGH / INFO | package.json scripts named after AI agents (or agents in install hooks) |