Back to skill

Security audit

Api Doc Writer Free

Security checks for vulnerabilities and agentic risk

Overview

This API documentation skill is not malicious, but it asks for command execution and broad file/tool authority that are not well scoped to simple documentation writing.

Install only if you are comfortable with a documentation helper that may read and write files and has command-execution capability. Prefer using it in a sandboxed workspace, avoid giving it secrets or private API specs unless necessary, and confirm before allowing any command execution or external callback/API use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:23
Finding

Excessive Command-Execution Permission

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 23–26
Vulnerability Type: Violation of least privilege through unnecessary command-execution capability
Risk Level: Medium

Vulnerable Code

yaml
tools:
  - read
  - exec
  - write

Technical Analysis

The skill is designed to generate REST API documentation, a task that does not inherently require operating-system command execution. Nevertheless, its metadata grants the exec tool alongside file read and write capabilities.

No concrete workflow in the reviewed file requires exec. The only shell example validates a user-configured environment variable and does not establish a legitimate runtime need for arbitrary command execution. Granting this capability therefore expands the skill's authority beyond its documented purpose and violates the principle of least privilege.

In an agent environment where skill input, API specifications, or referenced documents are untrusted, malicious instructions embedded in that content could attempt to induce the agent to invoke exec. Whether exploitation succeeds depends on the host agent's instruction hierarchy, tool controls, sandboxing, and approval requirements; the declaration alone does not prove that commands are automatically executed.

Attack Path

  1. A user activates the skill to process an API specification or documentation request.
  2. An attacker supplies or influences content within the input, such as an API description containing embedded instructions.
  3. The agent interprets the attacker-controlled content as an instruction to execute a local command.
  4. Because the skill declares access to exec, the agent may invoke the command if the hosting platform does not enforce sufficient isolation or confirmation.
  5. The command executes with the operating-system privileges and filesystem access available to the agent process.

Impact Assessment

Successful exploitation could provide command execution within the agent' ...[truncated 561 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove exec from the declared tool list because the documented API-writing workflow does not require shell access:
yaml
tools:
  - read
  - write
  1. If documents are generated entirely in the conversation, remove file permissions as well and declare no tools.
  2. If command execution is later shown to be essential, replace unrestricted execution with a narrowly scoped interface that:
    • permits only explicitly documented commands;
    • uses fixed executable paths and fixed argument structures;
    • rejects shell metacharacters and user-controlled command strings;
    • runs in a restricted sandbox with minimal filesystem and network access;
    • excludes secrets from the process environment;
    • applies execution time and resource limits; and
    • requires explicit user confirmation before each invocation.
  3. Treat API specifications, callback values, templates, and other supplied content as untrusted data rather than executable instructions.
  4. Add automated validation to ensure the skill's declared tools remain aligned with its documented functionality.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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 (6)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| POST | 创建资源 | `POST /api/v1/users` |
| PUT | 完整更新 | `PUT /api/v1/users/1` |
| PATCH | 部分更新 | `PATCH /api/v1/users/1` |
| DELETE | 删除资源 | `DELETE /api/v1/users/1` |

> **升级提示**: 付费版提供完整 URL 命名规范(名词复数、小写、连字符、避免动词)与 HTTP 状态码 1xx-5xx 分类说明.
## 使用说明

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Lines L226-L231 and L221-L224 repeatedly state that the free version lacks security advice and related advanced security content. However, lines L344-L359 include a dedicated security section with concrete guidance on encryption, access control, API key handling, command execution risk, TLS, and sensitive-data protection, which directly contradicts the stated limitation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

At L231 the document states '无错误示例' and earlier upgrade notices say error example writing is paid-only. Yet L205-L212 provides an error recovery table with specific business-code scenarios, and L368-L403 includes detailed failure cases such as 401, 429, 504, file, permission, command, and network errors with causes and remedies. This is an intent-level contradiction in the documentation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger condition is overly broad: 'when the user needs Development-related tasks, auto-activate.' In a skill with read/exec/write capabilities, broad auto-activation can cause the agent to invoke the skill in unrelated contexts, increasing the chance of unnecessary file access, command execution, or unintended handling of sensitive project data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill advertises file handling, external API integration, and command execution, but the user-facing material does not clearly warn about system or data impact at the point of use. In practice, this can lead users to invoke a seemingly harmless documentation tool without realizing it may read/write files, execute commands, or transmit data externally, increasing the risk of accidental data exposure or system modification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

Lines L229 and L077-L078 indicate that HTTP status code classification is not part of the free version. However, the document later includes explicit classifications/examples for 401, 429, and 504 in the troubleshooting tables, which undermines the earlier statement that such classification is unavailable.

Content

No source excerpt is available for this finding.