Back to skill

Security audit

doc-system-generator

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its documentation-generation purpose, but it persists future agent-reading rules and ships a helper script with a confirmed command-execution flaw.

Review before installing. Use it only when you want a repository-wide documentation system, require approval before it creates or modifies AGENTS.md or scripts/, remove the "Highest Priority" prohibition language, and harden or replace md-sections.sh before allowing agents or automation to pass it untrusted --line values.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
` for JSON structure Step 2: Run `scripts/md-sections.sh <file> "Section Name"` to extract specific content PROHIBITED: Reading full document content in one operation ``` ``` ### Technical Analysis The Skill explicitly instructs the Agent to create or modify `AGENTS.md` or an equivalent Agent instruction file and insert a rule that identifies itself as the “Highest Priority” constraint. The generated rule prohibits direct full-document access and redirects future document-reading operations th ...[truncated 2218 chars]:97
Finding

Persistent Agent Behavior Modification Through Generated Highest-Priority Instructions

Content
View full analysis
` for JSON structure Step 2: Run `scripts/md-sections.sh "Section Name"` to extract specific content PROHIBITED: Reading full document content in one operation ``` ``` ### Technical Analysis The Skill explicitly instructs the Agent to create or modify `AGENTS.md` or an equivalent Agent instruction file and insert a rule that identifies itself as the “Highest Priority” constraint. The generated rule prohibits direct full-document access and redirects future document-reading operations through a script deployed by the Skill. An Agent entry file is not ordinary documentation: it can be loaded as operational instructions by later Agent sessions. Consequently, the Skill persists its own behavioral restrictions beyond the documentation-generation task. The priority declaration may also create an instruction-precedence conflict with repository, user, developer, or security requirements. The behavior is classified as instruction hijacking because the Skill deliberately introduces instructions that attempt to control how an Agent operates. The persistence of those instructions in an Agent entry file increases the affected duration and scope. ### Attack Path 1. A user invokes the documentation-gen ...[truncated 1391 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/md-sections.sh:63
Finding

Command Execution Risk Through Unvalidated Bash Arithmetic Input

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a high-level documentation-generation skill for entire software projects. The supplied code does not analyze projects or generate documentation systems. Instead, it is a narrow Markdown navigation/extraction tool: it reads one Markdown file, parses headers while ignoring code blocks/comments, computes section ranges, emits a JSON tree, and extracts content by section title or line number. This is a materially different primary purpose, not just an implementation detail. No evidence supports the claimed documentation synthesis, template derivation, or completeness checking capabilities.

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 27)May include surrounding context.

md
4. **Deploy tool**: Copy `scripts/md-sections.sh` to project's `scripts/` directory (create if needed)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. **Deploy tool**: Copy `scripts/md-sections.sh` to project's `scripts/` directory (create if needed)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. **Deploy tool**: Copy `scripts/md-sections.sh` to project's `scripts/` directory (create if needed)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. **Deploy tool**: Copy `scripts/md-sections.sh` to project's `scripts/` directory (create if needed)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. **Deploy tool**: Copy `scripts/md-sections.sh` to project's `scripts/` directory (create if needed)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/completeness-checklist.md (reported line 140)May include surrounding context.

md
|------|----------|-----------|---------|---------|
| C2 API | @PostMapping 注解 | export function | func (http.Handler) | 头文件声明 |
| C3 模型 | Java Entity | TypeScript interface | struct | struct/class |
| C4 配置 | @ConfigurationProperties | .env / config.json | struct tags | config.hpp |
| C5 版本 | pom.xml | package.json | go.mod | CMakeLists.txt |

推导结果记录在项目的文档系统元数据中,供 contract-doc-sync 复用。

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to activate on ordinary documentation-related requests, causing the skill to run extensive project-wide analysis and generation when the user may only want narrow help. In context, this can lead to unnecessary scanning of the repository, over-collection of project context, and unintended file generation or modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow instructs copying scripts/md-sections.sh into the user's project without clearly warning that it will modify the filesystem or requesting approval first. Silent repository modification is risky because it can alter tracked files, affect build or tooling behavior, and violate user expectations in environments where write actions require explicit consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill authorizes optional external field research, which can cause the agent to make network requests and transmit project-derived context outside the local environment. For a documentation-generation skill, this expands the trust boundary unnecessarily and may leak sensitive metadata, technology choices, internal architecture, or proprietary identifiers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents the skill instructions entirely in Chinese, beginning with the title and continuing throughout, with no indication that the user can choose another language or that the skill is region-specific. Under the policy, forcing a specific language without opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

该文件标题及全文均以中文撰写,且未说明这是面向特定中文用户群体的区域性/合规性要求,也未提供语言选择或用户同意机制。按照语言/locale 政策,强制单一语言而无用户选择可能构成自然语言策略违规。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

Lines L023-L025 instruct the agent to present two equal options to the user when existing docs are found. However, the example at L204-L210 assumes a specific user choice path toward full redesign, which creates intent ambiguity in the documented procedure and could bias execution away from the declared neutral decision point.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

该文件包含面向使用者的说明性自然语言内容,且从标题与引导语看默认要求以中文阅读理解。根据语言/locale 政策,若技能强制使用特定语言而无用户选择或明确的地区/场景限定,属于自然语言策略问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's help text, usage examples, and error messages are written entirely in Chinese, which imposes a specific language on users without any opt-in or alternative locale support. The policy specifically calls for flagging language or locale constraints when the skill does not offer a choice or clearly justify the restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.