Back to skill

Security audit

Claude Code Team Scaffold

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Claude Code scaffolding skill, but it installs persistent hooks/global memory and can read prior Claude transcripts in ways users should review before installing.

Install only if you want this project to add automatic Claude Code lifecycle hooks and cross-session memory. Before use, review the generated .claude/settings.json and hook scripts, avoid enabling the npx-based quality hook unless dependencies are locally pinned, and do not allow global ~/.claude/CLAUDE.md or ~/.claude/memory changes unless you want future unrelated Claude sessions to inherit them. Treat transcript recovery as privacy-sensitive because it can surface prior conversation excerpts.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T08 · Insecure Dependencies

Error
Location
templates/hooks/subagent-stop.js:67
Finding

Lifecycle Hook May Download and Execute Unpinned npm Packages

Content
View full analysis
l.includes('error TS')).slice(0, 10).join('\n'); return lines ? `**tsc:**\n\`\`\`\n${lines}\n\`\`\`` : null; } function runEslint(files) { const r = tryCmd('npx', ['eslint', ...files], { timeout: 60000, cwd: PROJECT_ROOT }); if (r.ok || !r.output.trim()) return null; return `**eslint:**\n\`\`\`\n${truncate(r.output, 500)}\n\`\`\``; } ``` ```javascript function runVitest(files) { if (files.length === 0) return null; const r = tryCmd('npx', ['vitest', 'run', ...files], { timeout: 90000, cwd: PROJECT_ROOT }); if (r.ok) return null; if (r.output.includes('FAIL') || r.output.includes('Error')) { return `**vitest:**\n\`\`\`\n${truncate(r.output, 800)}\n\`\`\``; } return null; } ``` ### Technical Analysis The `SubagentStop` lifecycle hook automatically invokes `npx` for TypeScript, ESLint, and Vitest checks. It does not use `--no-install`, verify that the executable comes from the repository's locked dependencies, or validate the resolved package and version. When the expected executable is not locally installed, `npx` can attempt package resolution through the configured npm registry. This creates a supply-chain execution channel inside an automatic lifecycle hook. The short command name `tsc` is especially ambiguous because package resolution may not necessarily select the intended TypeScript compiler unless TypeScript is already installed and locked locally. Any ...[truncated 1226 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
templates/skills/planning-with-files/scripts/session-catchup.py:20
Finding

Session Recovery Script Reads Previous Claude Conversation Transcripts

Content
View full analysis
Path: """Convert project path to storage path format.""" sanitized = project_path.replace('/', '-') if not sanitized.startswith('-'): sanitized = '-' + sanitized sanitized = sanitized.replace('_', '-') return Path.home() / '.claude' / 'projects' / sanitized def get_sessions_sorted(project_dir: Path) -> List[Path]: """Get all session files sorted by modification time (newest first).""" sessions = list(project_dir.glob('*.jsonl')) main_sessions = [s for s in sessions if not s.name.startswith('agent-')] return sorted(main_sessions, key=lambda p: p.stat().st_mtime, reverse=True) def parse_session_messages(session_file: Path) -> List[Dict]: """Parse all messages from a session file, preserving order.""" messages = [] with open(session_file, 'r') as f: for line_num, line in enumerate(f): try: data = json.loads(line) data['_line_num'] = line_num messages.append(data) except json.JSONDecodeError: pass return messages ``` ```python def summarize_unsynced(messages: List[Dict]) -> str: """Create a summary of unsynced messages.""" if not messages: return "" lines = ["## Unsynced Context from Previous Session\n"] for msg in messages[-10:]: # Last 10 messages msg_type = msg.get('type', 'unknown') if msg_type == 'human': content = msg.get('message', {}).get('content', '') if isinstance(content, str) and content.strip(): lines.append(f"**User:** {content[:200]}") elif msg_type == 'assistant': c ...[truncated 2687 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:199
Finding

Project Scaffold Directs Persistent Modification of Global Claude Instructions

Content
View full analysis
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
templates/hooks/pre-tool-use.js:84
Finding

Repository-Controlled Markdown Is Injected Verbatim into Pre-Tool Agent Context

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill initializes a Claude Code AI framework for a new project by creating directories, settings/hooks, agent definitions, commands, and memory/planning scaffolding. The actual code chunk does none of that. Instead, it is a helper script for the planning-with-files skill that inspects existing session log files, identifies the last planning-file modification, and summarizes later conversation content to catch up on unsynced context. This is a materially different purpose and introduces an undeclared capability: reading and processing stored session history under ~/.claude/projects. While session catchup could be a supporting component of a broader workflow, this specific code chunk does not match the declared primary purpose of framework initialization.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 134)May include surrounding context.

md
- `subagent-stop.js` — SubagentStop 处理(质量门禁)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill plans to write under ~/.claude/, which affects global user state across projects and sessions. Undisclosed modification of home-directory agent memory and global CLAUDE.md is especially dangerous because it persists outside the target repository and can influence unrelated future work.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · templates/TEMPLATE-CLAUDE.md (reported line 16)May include surrounding context.

md
### 模块划分

<!-- 列出本项目的主要模块、目录、职责 -->
<!-- 例:src/api/ — REST 端点层;src/services/ — 业务逻辑层;src/models/ — 数据模型层 -->

## 安全合规

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · templates/TEMPLATE-CLAUDE.md (reported line 16)May include surrounding context.

md
### 模块划分

<!-- 列出本项目的主要模块、目录、职责 -->
<!-- 例:src/api/ — REST 端点层;src/services/ — 业务逻辑层;src/models/ — 数据模型层 -->

## 安全合规

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · templates/memory/hooks-config.md (reported line 4)May include surrounding context.

md
# Claude Code Hooks 配置笔记

- 文档:https://docs.claude.com/en/docs/claude-code/hooks
- 配置位置:`.claude/settings.json`(项目级)或 `~/.claude/settings.json`(用户级)
- 事件名(PascalCase):`SessionStart`, `PreToolUse`, `PostToolUse`, `Stop`, `SubagentStart`, `SubagentStop`
- Hook 脚本接收 camelCase JSON via stdin:`session_id`, `transcript_path`, `cwd`, `hook_event_name`, `tool_name`, `tool_input`
- **阻断决策**:stdout 输出 `{"decision": "block", "reason": "..."}`(PreToolUse / Stop)

Context Leakage

High
Category
Data Exfiltration
Confidence
89% confidence
Finding

This function enables cross-session context extraction by collecting all human and assistant messages after a checkpoint, which are later summarized and emitted. In the skill context, it runs on SessionStart as an automation feature, making leakage more dangerous because users may unknowingly surface previous-session sensitive content into a new session, logs, or downstream agents without deliberate review.

Content

Scanner excerpt · templates/skills/planning-with-files/scripts/session-catchup.py (reported line 77)May include surrounding context.

python
def extract_messages_after(messages: List[Dict], after_line: int) -> List[Dict]:
    """Extract conversation messages after a certain line number."""
    result = []
    for msg in messages:
        if msg['_line_num'] <= after_line:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
81% confidence
Finding

The skill clearly instructs reading templates and writing multiple project files, but it does not declare an explicit tool scope such as allowed tools or permissions. That increases the chance of unintended file or environment access and makes the skill's operational boundary ambiguous to users and reviewers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The operational instructions and user prompts are presented in Chinese, which can force a specific language experience on users without explicit opt-in. The file does include some English trigger phrases, but it does not offer a language selection or explain that the skill is intended only for a Chinese-language context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill directs the agent to write .claude/settings.json and copy hook scripts into the repository without prominently warning that it will modify project files. Silent repository mutation can surprise users, alter project behavior, and introduce persistent automation that later executes on lifecycle events.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Creating or modifying a root CLAUDE.md changes globally loaded project instructions and can materially affect future agent behavior. Omitting a clear warning hides a high-leverage persistent change that may influence later development sessions beyond the immediate task.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
74% confidence
Finding

The repeated RA2 finding reflects the same persistence concern: generated subagent and memory configuration can continue affecting future sessions after scaffold completion. In a development-assistant context this is more sensitive because persistent instructions may be automatically loaded and not revisited by the user.

Content

Scanner excerpt · SKILL.md (reported line 168)May include surrounding context.


name: backend-developer description: "后端开发专家。实现 API 端点、ORM 模型、Schema、业务服务层、后台任务。" tools: Read, Edit, Glob, Grep, Bash, Task, TodoWrite model: sonnet

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
74% confidence
Finding

The repeated RA2 finding reflects the same persistence concern: generated subagent and memory configuration can continue affecting future sessions after scaffold completion. In a development-assistant context this is more sensitive because persistent instructions may be automatically loaded and not revisited by the user.

Content

Scanner excerpt · SKILL.md (reported line 168)May include surrounding context.


name: backend-developer description: "后端开发专家。实现 API 端点、ORM 模型、Schema、业务服务层、后台任务。" tools: Read, Edit, Glob, Grep, Bash, Task, TodoWrite model: sonnet

text

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown template contains core instructional text in Chinese and states that the file is automatically loaded as global rules for all modules. That imposes a specific language/locale on downstream users and agents without offering an opt-in choice or documenting that the template is intended only for a Chinese-language context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest says the skill triggers whenever a task involves broad terms like AI, LLM, prompt, embedding, or RAG. These are high-level concepts rather than specific invocation boundaries, so the activation scope is unclear and could cause unintended selection for many unrelated engineering requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is entirely written as a Chinese-only skill description and instruction set, with no indication that users may choose another language. This can violate language or locale policy when a skill implicitly forces a specific language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description and all operational instructions are written exclusively in Chinese, indicating the skill is intended to operate in a fixed language. The policy requires flagging language or locale constraints when the skill does not explicitly provide user opt-in or a justified region-specific reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description and all operating instructions are written only in Chinese, with no indication that the user can choose another language or locale. This creates a language policy issue because the skill appears to require a specific language without documented opt-in or justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill triggers when a task involves '前端、组件、UI、状态、页面、CSS' and the framework placeholder, which is a wide set of common terms without clear boundaries or exclusion conditions. This makes it unclear when the skill should activate versus when another engineering skill should handle the task, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file presents the skill description and operating instructions entirely in Chinese and describes the agent as a frontend expert in that language, with no indication that the user can choose another language. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless clearly justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description says the skill triggers whenever a task involves requirements, user stories, documents, manuals, or business processes. Terms like '文档' and '手册' are broad and common across many unrelated tasks, and the file does not provide narrower trigger phrases, exclusions, or negative examples to bound activation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructions are entirely written in Chinese and specify role, process, constraints, and output format only in that language, with no indication that the user can choose another language. This creates a natural-language locale policy concern because it effectively enforces a specific language without opt-in or a documented region-specific justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The command logic first enforces that unmet dependencies must block execution, but the later error-handling text says to ask whether to wait or proceed anyway. This contradiction can cause operators or downstream agents to bypass ordering guarantees, leading to incomplete prerequisite work, invalid assumptions, and unsafe or incorrect code changes.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · templates/commands/run-task.md (reported line 31)May include surrounding context.

md
- Instruction to follow the module's CLAUDE.md conventions
     - Instruction to update the module's `CLAUDE.md` if functionality changes

5. **Verify completion**: After the subagent returns, the SubagentStop hook will automatically run quality checks. The main agent does not need to re-run lint/type-check/tests manually.

6. **Report back**: Summarize:
   - What was done (files changed, key decisions)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Allowing execution to proceed when required dependencies are incomplete weakens task integrity controls and can cause an agent to implement changes against an invalid or partially prepared project state. In this skill's context, that can propagate incorrect designs, break module conventions, or trigger downstream automation on incomplete work.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
templates/hooks/subagent-stop.js:32