Back to skill

Security audit

Plantuml

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned for PlantUML diagrams, but its recommended preview workflow can send diagram contents to a public server and its helper script has weak path validation.

Install only if you are comfortable managing the rendering path. For confidential system diagrams, use local PlantUML or an approved internal renderer, and avoid running scripts/render_preview.py with untrusted diagram names until path validation is added.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/render_preview.py:114
Finding

Path Traversal Enables Arbitrary PlantUML File Disclosure and SVG Overwrite

Content
View full analysis
bool: src_path = os.path.join(SRC_DIR, name + ".puml") with open(src_path, encoding="utf-8") as fp: source = fp.read() status, data = fetch(source, fmt) if status == 200 and is_real_diagram(data): os.makedirs(OUT_DIR, exist_ok=True) dst = os.path.join(OUT_DIR, name + ".svg") with open(dst, "wb") as fp: fp.write(data) print(" [OK] %-20s %6d bytes" % (name, len(data))) return True ``` The value used as `name` comes directly from command-line arguments: ```python def main(): args = [a for a in sys.argv[1:] if not a.startswith("--")] only_check = "--check" in sys.argv all_names = sorted( os.path.splitext(os.path.basename(p))[0] for p in glob.glob(os.path.join(SRC_DIR, "*.puml")) ) names = args if args else all_names ``` ### Technical Analysis The script treats each command-line argument as a diagram name, but it does not restrict that value to a filename or verify that the resulting path remains inside the expected directory. `os.path.join(SRC_DIR, name + ".puml")` does not neutralize `../` components or absolute paths. Consequently, a crafted name can resolve outside `examples/`. If a matching readable file exists, the script reads its complete contents and passes them to `fetch()`, which transmits the source to the configured remote PlantUML server. The same untrusted value is used to construct the output path: ```python dst = os.path.join(OUT_DIR, name + ".svg") ``` A traversal value can therefore direct the returned SVG outside `assets/preview`. If the parent directory exists and the process has permis ...[truncated 1495 chars]
Remediation
View remediation
str: if not NAME_RE.fullmatch(name): raise ValueError("Invalid diagram name") return name ``` 2. Resolve and verify source and destination containment before any file operation: ```python from pathlib import Path SRC_ROOT = Path(SRC_DIR).resolve() OUT_ROOT = Path(OUT_DIR).resolve() def contained_path(root: Path, name: str, suffix: str) -> Path: validate_name(name) candidate = (root / f"{name}{suffix}").resolve() if candidate.parent != root: raise ValueError("Path escapes the permitted directory") return candidate ``` 3. Reject absolute paths, path separators, `.` components, and `..` components even if a broader naming policy is later adopted. 4. Derive selectable names from the enumerated `examples/*.puml` files and reject any requested name not present in that allowlist. 5. Use atomic output creation and avoid overwriting existing files unexpectedly. For example, write to a temporary file inside `OUT_DIR` and atomically replace only the intended preview. 6. Add regression tests covering `../`, absolute paths, nested traversal, platform-specific separators, and valid diagram basenames. ]]>

other

Note
Location
scripts/render_preview.py:81
Finding

Diagram Source Is Transmitted to a Public Rendering Service Without an Explicit Privacy Warning

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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (20)

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 · assets/preview/c4-container.svg (reported line 1)May include surrounding context.

text
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:322px;height:809px;background:#FFFFFF;" width="322px" height="809px" viewBox="0 0 322 809" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.8beta1?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="2"><text x="101.435" y="22.995" fill="#000" font-size="14" textLength="113.066" font-weight="700">电商系统 · 容器图</text></g><!--cluster c1--><g class="cluster" data-qualified-name="c1" id="ent0002" data-source-line="1666"><rect x="7" y="223.577" width="150" height="571.47" fill="none" style="stroke:#444;stroke-width:1;stroke-dasharray:7,7;"/><text x="50" y="260.428" fill="#444" font-size="16" textLength="64" font-weight="700">电商系统</text><text x="52.272" y="275.341" fill="#444" font-size="12" textLength="59.455" font-weight="700">[system]</text></g><!--entity web--><g class="entity" data-qualified-name="c1.web" id="ent0003" data-source-line="71"><rect x="23" y="294.577" width="104" height="99.156" fill="#438DD5" style="stroke:#3C7FC0;stroke-width:0.5;"/><text x="39.228" y="315.716" fill="#FFF" font-size="12" textLength="71.543" font-style="italic">«container»</text><text x="36.238" y="333.397" fill="#FFF" font-size="16" textLength="39.953" font-weight="700">Web</text><text x="76.191" y="333.397" fill="#FFF" font-size="16" font-weight="700"> </text><text x="81.762" y="333.397" fill="#FFF" font-size="16" font-weight="700">应</text><text x="97.762" y="333.397" fill="#FFF" font-size="16" font-weight="700">用</text><text x="53.13" y="348.309" fill="#FFF" font-size="12" textLength="43.74" font-style="italic">[React]</text><text x="72.775" y="364.134" fill="#FFF" font-size="14"> </text><text x="33" y="380.431" fill="#FFF" font-size="14">浏</text><text x="47" y="380.431" fill="#FFF" font-size="14">览</text><text x="61" y="380.431" fill="#FFF" font-size="14">下</tex
...[truncated 27 chars]

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 · assets/preview/c4-container.svg (reported line 1)May include surrounding context.

text
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:322px;height:809px;background:#FFFFFF;" width="322px" height="809px" viewBox="0 0 322 809" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.8beta1?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="2"><text x="101.435" y="22.995" fill="#000" font-size="14" textLength="113.066" font-weight="700">电商系统 · 容器图</text></g><!--cluster c1--><g class="cluster" data-qualified-name="c1" id="ent0002" data-source-line="1666"><rect x="7" y="223.577" width="150" height="571.47" fill="none" style="stroke:#444;stroke-width:1;stroke-dasharray:7,7;"/><text x="50" y="260.428" fill="#444" font-size="16" textLength="64" font-weight="700">电商系统</text><text x="52.272" y="275.341" fill="#444" font-size="12" textLength="59.455" font-weight="700">[system]</text></g><!--entity web--><g class="entity" data-qualified-name="c1.web" id="ent0003" data-source-line="71"><rect x="23" y="294.577" width="104" height="99.156" fill="#438DD5" style="stroke:#3C7FC0;stroke-width:0.5;"/><text x="39.228" y="315.716" fill="#FFF" font-size="12" textLength="71.543" font-style="italic">«container»</text><text x="36.238" y="333.397" fill="#FFF" font-size="16" textLength="39.953" font-weight="700">Web</text><text x="76.191" y="333.397" fill="#FFF" font-size="16" font-weight="700"> </text><text x="81.762" y="333.397" fill="#FFF" font-size="16" font-weight="700">应</text><text x="97.762" y="333.397" fill="#FFF" font-size="16" font-weight="700">用</text><text x="53.13" y="348.309" fill="#FFF" font-size="12" textLength="43.74" font-style="italic">[React]</text><text x="72.775" y="364.134" fill="#FFF" font-size="14"> </text><text x="33" y="380.431" fill="#FFF" font-size="14">浏</text><text x="47" y="380.431" fill="#FFF" font-size="14">览</text><text x="61" y="380.431" fill="#FFF" font-size="14">下</tex
...[truncated 27 chars]

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill title and instructional content are presented in Chinese, and the file does not indicate that users may choose another language. This creates a locale/language policy concern because the skill appears to impose a specific language without user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The README presents core descriptive and instructional content in Chinese at the outset, including the primary usage framing, without indicating that users may choose another language. This can be a language/locale policy issue when a skill implicitly assumes a specific language instead of offering user opt-in or a bilingual choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README prominently recommends and demonstrates use of third-party online PlantUML rendering services, but does not warn users that diagram source may contain proprietary architecture, credentials, internal hostnames, or other sensitive data that would be transmitted off-platform. In an agent skill context, users may paste confidential system descriptions for diagram generation, so omission of a privacy warning can lead to unintended data disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This SVG contains user-facing labels entirely in Chinese, such as the title "电商系统 · 容器图" and component names like "Web 应用" and "支付网关." For a general skill asset, this imposes a specific language/locale without offering opt-in or documenting that the asset is intended only for a Chinese-language context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file contains visible natural-language labels such as "电商系统 · 部署图", "Web 服务器", and other Chinese text embedded directly in the diagram. Under the policy rule for language/locale, this is a violation because the skill content fixes a specific language with no opt-in or explanation that the diagram is intended only for a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This SVG contains natural-language labels such as "下单" and "包含" alongside English entity names, effectively imposing a mixed locale in the rendered artifact. Because SQP-3 applies to all file types, this can be flagged as a language/locale policy issue when no opt-in or justification is present.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This SVG includes Chinese task labels ("任务A", "任务B") alongside English labels, which imposes a locale-specific presentation in the asset without any indication that the user can choose the display language. The policy for this category applies to all file types, including embedded natural-language strings inside SVG content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This file contains user-facing natural-language labels entirely in Chinese (for example, 登录, 进入主页, 显示错误) with no indication that the skill is intended only for a Chinese-speaking or region-specific context. The stated policy requires flagging language or locale constraints when they are imposed without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file uses Chinese for the title and core element labels, with no indication that the skill is region-specific or that language is user-selectable. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This PlantUML file uses Chinese-only natural-language labels such as the title and component names, which can represent a language policy issue when no opt-in or justification is provided. The rule applies to all file types, and there is no indication here that the skill is intentionally limited to a Chinese-language or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This PlantUML file contains user-facing natural-language strings entirely in Chinese, such as the title and node labels, with no indication that the skill is region-specific or that another language can be used. Under the policy, forcing a specific language without opt-in is a natural-language policy concern applicable to all file types.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The relationship labels use Chinese text ("下单", "包含") with no indication that the skill or artifact is intentionally region-specific or that alternate locales are supported. This can violate a language/locale policy when a skill artifact implicitly forces one language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file’s visible labels are entirely in Chinese (for example, UML图, 时序图, 类图), which imposes a specific language on users without any stated opt-in or documented regional justification. Under the policy rule for language/locale constraints, this is a natural-language policy issue because the file does not offer an alternative language or explain why Chinese is required.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language strings in this diagram are entirely in Chinese, including the login form labels and buttons, with no indication that the skill is region-specific or that users can choose another language. This creates a language/locale policy concern because it implicitly forces a specific language without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The visible natural-language labels and title are entirely in Chinese, including the title and state names. For a general-purpose skill artifact, this imposes a specific language/locale without indicating user opt-in or that the skill is region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown cheatsheet presents all instructions and labels in Chinese, and there is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the natural-language policy rule, forcing a specific language without user opt-in can be a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language instructions and user-facing messages in Chinese, which effectively forces a specific language for users of the skill. The policy allows locale constraints only when they are optional or clearly justified as region-specific, which is not stated here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.