Back to skill

Security audit

Claude Code Patterns

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only skill about agent engineering patterns, with some sensitive implementation examples that users should scope carefully if they copy them into real systems.

Installers should treat this as Chinese-language engineering reference material. If using its patterns in production, add user-visible controls for context compaction, redact sensitive conversation/tool data before summarization, and tightly scope any keychain, MDM, memory, Bash, or remote-agent behavior instead of copying the snippets verbatim.

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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (8)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
profileCheckpoint('main_entry');

// 并行启动所有 I/O
const [mdmResult, keychainResult, commandsResult] = await Promise.all([
  startMdmRawRead(),        // 并行读取 MDM 配置
  startKeychainPrefetch(),  // 并行预取 keychain
  getCommands(),            // 并行加载命令

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
profileCheckpoint('main_entry');

// 并行启动所有 I/O
const [mdmResult, keychainResult, commandsResult] = await Promise.all([
  startMdmRawRead(),        // 并行读取 MDM 配置
  startKeychainPrefetch(),  // 并行预取 keychain
  getCommands(),            // 并行加载命令

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
// 并行启动所有 I/O
const [mdmResult, keychainResult, commandsResult] = await Promise.all([
  startMdmRawRead(),        // 并行读取 MDM 配置
  startKeychainPrefetch(),  // 并行预取 keychain
  getCommands(),            // 并行加载命令
]);

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description and the main skill content are written entirely in Chinese, with no indication that another language is supported or that Chinese is required for a region-specific purpose. This creates a natural-language policy concern because it effectively constrains the skill to a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document recommends automatic deletion and replacement of prior conversation content as part of normal context management, but it does not require any explicit user notice that older context may be removed or transformed into summaries. In an agent-engineering skill, this can cause silent loss of instructions, consent boundaries, or critical task details, increasing the risk of incorrect actions or misleading users about what context the agent still retains.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes extra API-based summarization and compression, including use of a smaller model, but does not warn that conversation contents may be transmitted to another model or processing path. For a context-management pattern intended for complex agents, this omission can lead implementers to forward sensitive prompts, tool outputs, file paths, or secrets to secondary services without disclosure, consent, or data-handling controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown document is entirely written in Chinese and provides no indication that language selection is optional or that the locale is required for a specific regional or compliance reason. The stated policy requires flagging language or locale constraints when they are imposed without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

该 Markdown 文档全文以中文编写,标题和说明均默认要求读者使用中文理解内容,但未说明这是面向特定中文地区/团队的限定文档,也未提供语言选择或英文替代。根据语言/区域政策,未经用户选择而强制单一语言属于自然语言层面的政策风险。

Content

No source excerpt is available for this finding.