ワンクリックで
milens-security-review
Security Audit — scan for secrets, hidden unicode, dangerous patterns, data leaks, and produce a security report
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Security Audit — scan for secrets, hidden unicode, dangerous patterns, data leaks, and produce a security report
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Code intelligence for the adapters area — symbols, dependencies, and entry points
Code intelligence for the analyzer area — symbols, dependencies, and entry points
Code intelligence for the apps area — symbols, dependencies, and entry points
Code intelligence for the docs area — symbols, dependencies, and entry points
Code intelligence MCP tools — symbol search, text grep, impact analysis, dependency graph
Code intelligence for the orchestrator area — symbols, dependencies, and entry points
| name | milens-security-review |
| description | Security Audit — scan for secrets, hidden unicode, dangerous patterns, data leaks, and produce a security report |
Scan the codebase for security vulnerabilities: exposed secrets, hidden unicode (Trojan Source), dangerous code patterns, data leakage, and unexpected file changes.
| Tool | Purpose |
|---|---|
mcp_milens_review_pr | Initial risk assessment of changed files and symbols |
mcp_milens_grep | Pattern search for secrets, unicode, dangerous calls, data leaks |
mcp_milens_review_symbol | Deep-dive risk analysis on high-risk symbols |
mcp_milens_detect_changes | Verify only expected files changed |
CRITICAL: All milens MCP tool calls MUST include the
repoparameter set to the absolute path of the workspace root.
Start with a PR-level overview to identify high-risk areas.
mcp_milens_review_pr({repo: "<workspaceRoot>"})
Focus on:
.env, config.*, settings filesSearch for hardcoded secrets and credentials.
mcp_milens_grep({pattern: "password|secret|api_key|token|private_key|AUTH_TOKEN", scope: "code", repo: "<workspaceRoot>"})
Key patterns to flag:
const apiKey = "sk-..." (critical)password: "admin123" (high)const apiKey = process.env.KEY (low — already env-var'd)const testPassword = "..." (verify it's not a real password)Search for invisible and bidirectional Unicode characters used in supply-chain attacks.
mcp_milens_grep({pattern: "[\\u200B\\u200C\\u200D\\u2060\\uFEFF\\u202A-\\u202E]", scope: "code", isRegex: true, repo: "<workspaceRoot>"})
These characters can:
Any match is a CRITICAL finding — flag for immediate removal.
Search for patterns that enable code injection or arbitrary execution.
mcp_milens_grep({pattern: "eval\\(|exec\\(|child_process|Function\\(", scope: "code", isRegex: true, repo: "<workspaceRoot>"})
Severity guidance:
eval() / exec() with user input — CRITICALchild_process.exec() with dynamic arguments — CRITICALnew Function() — HIGH (eval equivalent)child_process.spawn() with fixed arguments — LOW (safer than exec)Find logging statements that may expose sensitive data.
mcp_milens_grep({pattern: "console\\.(log|debug|info)\\(", scope: "code", isRegex: true, repo: "<workspaceRoot>"})
Flag any console.log that logs:
For any symbol flagged as CRITICAL in Step 1, run a deep-dive.
mcp_milens_review_symbol({name: "<symbolName>", repo: "<workspaceRoot>"})
This provides:
Confirm that only expected files were modified.
mcp_milens_detect_changes({repo: "<workspaceRoot>"})
This catches:
Consolidate into a structured report:
eval/exec/Function usage with justificationconsole.log that logs sensitive data"run a security audit before the release"
Step 1 — PR overview:
mcp_milens_review_pr({repo: "/home/user/project"})
Output: 8 changed files, 2 CRITICAL symbols (authHandler, paymentProcessor).
Step 2 — Secret detection:
mcp_milens_grep({pattern: "password|secret|api_key|token|private_key|AUTH_TOKEN", scope: "code", repo: "/home/user/project"})
Output:
src/config.ts:12 apiKey: "sk-prod-abc123..." ← CRITICAL: hardcoded API key
src/auth/login.ts:34 const password = req.body.pass ← LOW: variable assignment
src/__tests__/helpers.ts:8 const testToken = "test" ← OK: test fixture
Step 3 — Unicode scan:
mcp_milens_grep({pattern: "[\\u200B\\u200C\\u200D\\u2060\\uFEFF\\u202A-\\u202E]", scope: "code", isRegex: true, repo: "/home/user/project"})
Output: 0 matches. Clean.
Step 4 — Dangerous patterns:
mcp_milens_grep({pattern: "eval\\(|exec\\(|child_process|Function\\(", scope: "code", isRegex: true, repo: "/home/user/project"})
Output:
src/scripts/migrate.ts:22 exec(`pg_dump ${dbName}`) ← CRITICAL: dynamic args
Step 5 — Data leak:
mcp_milens_grep({pattern: "console\\.(log|debug|info)\\(", scope: "code", isRegex: true, repo: "/home/user/project"})
Output:
src/auth/login.ts:28 console.log("User login:", email) ← HIGH: logs PII
Step 6 — Deep-dive:
mcp_milens_review_symbol({name: "authHandler", repo: "/home/user/project"})
Output: Core auth entry point, 23 dependents, 0 tests — very high risk.
Step 7 — Verify scope:
mcp_milens_detect_changes({repo: "/home/user/project"})
Output: 8 files changed — matches expectations.
Step 8 — Report produced (see report format above). Verdict: NEEDS REMEDIATION (1 critical secret, 1 critical dangerous pattern, 1 high data leak).
const password = process.env.DB_PASS is fine; const password = "admin123" is not. Read the value, not just the name.const testApiKey = "test-key" is acceptable, but const testApiKey = "sk-live-..." is a leaked production key.exec() takes user-controlled input, it's remote code execution. The only acceptable pattern is fully-hardcoded command strings.detect_changes shows files you didn't touch, something went wrong — config drift, lockfile churn, or accidental staging.| Criteria | Pass | Fail |
|---|---|---|
| Secret scan | No hardcoded secrets found outside test fixtures | Any production secret in code |
| Unicode scan | Zero matches | Any hidden unicode character found |
| Dangerous patterns | No eval/exec with dynamic input | Any dynamic exec() or Function() call |
| Data leak | No PII/credentials in console.log | Sensitive data logged to console |
| Change scope | detect_changes matches expectations | Unexpected files in the diff |
| All scans completed | All 7 steps executed | Any tool call skipped or failed |