diff --git a/IDEAS.md b/IDEAS.md index ab994fe..ec02dc9 100644 --- a/IDEAS.md +++ b/IDEAS.md @@ -2,25 +2,25 @@ > Research topics for future guide improvements. Curated and validated. -## High Priority +## Done -### MCP Security Hardening +### MCP Security Hardening ✅ Unified security research covering MCP vulnerabilities, prompt injection, and secret detection. -**Topics:** -- Real-world Tool Shadowing and Confused Deputy incidents -- Prompt injection bypass techniques (Unicode, encoding, obfuscation) -- Secret detection regex patterns (compare GitHub, Gitleaks, TruffleHog) -- Supply chain risks in MCP server ecosystem +**Completed**: [Security Hardening Guide](./guide/security-hardening.md) covers: +- CVE-2025-53109/53110, 54135, 54136 with mitigations +- MCP vetting workflow with 5-minute audit checklist +- MCP Safe List (community vetted) +- Prompt injection evasion techniques (Unicode, ANSI, null bytes) +- Secret detection tool comparison (Gitleaks, TruffleHog, GitGuardian) +- Incident response procedures (secret exposed, MCP compromised) +- 3 new hooks: `unicode-injection-scanner.sh`, `repo-integrity-scanner.sh`, `mcp-config-integrity.sh` -**Perplexity Query:** -``` -MCP Model Context Protocol security vulnerabilities 2024-2025: -- Tool shadowing attacks -- Prompt injection bypass techniques for coding assistants -- Secret detection regex patterns comparison (GitHub vs Gitleaks vs TruffleHog) -Include real incidents if documented. -``` +--- + +## High Priority + +*(No items currently)* --- diff --git a/README.md b/README.md index 10570bd..b3f178b 100644 --- a/README.md +++ b/README.md @@ -405,11 +405,14 @@ Copy-paste templates from [`examples/`](./examples/) for immediate use: |------|-------|---------| | [dangerous-actions-blocker.sh](./examples/hooks/bash/dangerous-actions-blocker.sh) | PreToolUse | Block `rm -rf /`, force push, secrets | | [prompt-injection-detector.sh](./examples/hooks/bash/prompt-injection-detector.sh) | PreToolUse | Detect injection attempts | +| [unicode-injection-scanner.sh](./examples/hooks/bash/unicode-injection-scanner.sh) | PreToolUse | Detect zero-width, RTL, ANSI escape | +| [repo-integrity-scanner.sh](./examples/hooks/bash/repo-integrity-scanner.sh) | PreToolUse | Scan README/package.json for injection | +| [mcp-config-integrity.sh](./examples/hooks/bash/mcp-config-integrity.sh) | SessionStart | Verify MCP config hash (CVE protection) | | [output-secrets-scanner.sh](./examples/hooks/bash/output-secrets-scanner.sh) | PostToolUse | Detect exposed secrets | | [notification.sh](./examples/hooks/bash/notification.sh) | Notification | macOS sound alerts | | [auto-format.sh](./examples/hooks/bash/auto-format.sh) | PostToolUse | Auto-format with Prettier | -**[See All 11 Hooks](./examples/hooks/)** — Includes session-logger, security-check, claudemd-scanner, and more +**[See All 14 Hooks](./examples/hooks/)** — Includes session-logger, security-check, claudemd-scanner, and more ### GitHub Actions (CI/CD) @@ -554,7 +557,7 @@ If this guide saved you time, helped you master Claude Code, or inspired your wo --- -*Version 3.5.0 | January 2026 | Crafted with Claude* +*Version 3.6.0 | January 2026 | Crafted with Claude* '; then + echo "BLOCKED: Hidden HTML comment with suspicious instructions in: $file" >&2 + return 1 + fi + + # === ROLE OVERRIDE PATTERNS === + if echo "$content" | grep -qiE 'ignore (previous|all|your) instructions|you are now|pretend (you are|to be)|from now on|new instructions:'; then + echo "BLOCKED: Prompt injection pattern detected in: $file" >&2 + return 1 + fi + + # === BASE64 IN COMMENTS === + # Long base64 strings in comments could be encoded instructions + if echo "$content" | grep -qE '(#|//|