Back to skill

Security audit

drawio-generator

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent draw.io link generator, but its documented command-line workflow can turn untrusted diagram text into shell command execution if followed literally.

Review before installing. The skill is not showing deception or persistence, but it should be changed so agents do not build shell commands with user-supplied diagram code. Prefer stdin, a temporary file, or a shell-free argument-array invocation, and consider localizing or neutralizing the output link text.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:85
Finding

Shell Command Injection Through Unsafe Diagram-Code Interpolation

Content
View full analysis
B" python scripts/generate_drawio_url.py --type xml --code "..." python scripts/generate_drawio_url.py -t csv -c "name,manager\nCEO,\nCTO,CEO" ``` ### Technical Analysis The Skill instructs an agent to pass generated Mermaid, XML, or CSV content directly through a double-quoted shell argument. Diagram content may be based on untrusted user input and can contain shell metacharacters such as double quotes, backticks, or `$()` command substitutions. Double quotes do not prevent shell command substitution. If an agent constructs and executes the documented command through a shell, attacker-controlled content can terminate or alter the intended argument or cause the shell to evaluate embedded substitutions before `generate_drawio_url.py` receives the diagram code. For example, an attacker could request a Mermaid node containing content similar to: ```text A["$(id > /tmp/drawio-injection-result)"] ``` If this content is interpolated into the documented command template, the shell may execute `id > /tmp/drawio-injection-result`. The Python script itself does not invoke a subprocess; the vulnerability arises from the unsafe shell invocation pattern prescribed by the Skill documentation. ### Attack Path 1. An attacker asks the agent to create a diagram containing shell command-substitution syntax in a label, XML attribute, or CSV field. 2. The agent preserves the attacker-controlled text while generating the requested diagram code. 3. Following `SKILL.md`, the agent places the generated code inside the double-quoted `--code` argument. 4. The agent executes the resulting command through a shell. 5. The shell evaluates the injected command substitution before starting Python. 6. The attacke ...[truncated 1072 chars]
Remediation
View remediation
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
81% confidence
Finding

The skill instructs the agent to execute a Python script that generates a draw.io URL, which implies code execution and likely outbound network use, but it declares no explicit tool scope or permissions. This can cause the skill to run with broader-than-necessary capabilities or without clear operator review, increasing the chance of unintended network access or misuse when handling untrusted diagram content.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description uses extremely broad activation criteria such as 'any visual diagram' and 'any other visual representation,' which can cause the skill to trigger for a wide range of loosely related prompts. Overbroad activation increases the attack surface by making it easier for adversarial or irrelevant requests to invoke code-generating behavior and bypass more appropriate, narrower skills or guardrails.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill hardcodes a Chinese user-facing output string ('点击查看图表') and instructs the agent to present it directly, regardless of the user's language or preferences. While not a direct code-execution issue, this overrides normal user-context handling and can facilitate prompt-level policy interference by forcing output formatting without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script prints the markdown link using Chinese text (点击查看图表) as the only user-facing label. This imposes a specific language choice on all users without offering a locale option or documenting that the tool is intended for a Chinese-only context.

Content

No source excerpt is available for this finding.