Back to skill

Security audit

Publish Art Tutor

Security checks for vulnerabilities and agentic risk

Overview

This art-tutor skill is mostly coherent, but it asks the agent to run broad PowerShell filesystem scans using an unvalidated configurable path, which needs user review before installation.

Install only if you trust and control the configured knowledge_base_path. Point it to a narrow art-resource folder, not a home directory or drive root, and avoid paths supplied by someone else. Review or replace the PowerShell scan instructions with safer file-browsing behavior if available.

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

Warning
Location
SKILL.md:100
Finding

Command Injection Through Unvalidated Knowledge Base Path

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 100-110
Vulnerability Type: PowerShell command injection through unsafe configuration interpolation
Risk Level: Medium

Vulnerable Code

powershell
# Scan files in a specified directory, sorted by name
Get-ChildItem -Path "{{knowledge_base_path}}02_绘画技法\水彩教程" -File | Sort-Object Name | Select-Object Name, @{N='MB';E={[math]::Round($_.Length/1MB,1)}} | Format-Table -AutoSize -Wrap

# Search by keyword
Get-ChildItem -Path "{{knowledge_base_path}}" -Recurse -File | Where-Object { $_.Name -match "素描|水彩|解剖" } | Sort-Object Name | Select-Object Name, @{N='MB';E={[math]::Round($_.Length/1MB,1)}} | Format-Table -AutoSize

# Display the number and total size of books in a category
Get-ChildItem -Path "{{knowledge_base_path}}04_艺术史论" -Recurse -File | Measure-Object -Property Length -Sum | ForEach-Object { "Book count: $($_.Count) | Total size: $([math]::Round($_.Sum/1GB,2)) GB" }

Technical Analysis

The user-configurable knowledge_base_path value is inserted directly into double-quoted PowerShell commands that the skill instructs the agent to run through exec. The skill does not require validation, canonicalization, escaping, or argument-safe process invocation before interpolation.

PowerShell treats characters such as double quotes, semicolons, pipes, subexpressions, and comment markers as syntax. A malicious configuration value can therefore terminate the intended -Path argument and append another command. For example, a value shaped like C:\Books"; whoami; # would close the path string, execute whoami, and comment out the generated suffix.

This vulnerability applies when an attacker can set or modify the skill configuration, or can persuade a user or agent to use an attacker-provided path. Merely scanning a legitimate configured path does not trigger exploitation.

Attack Path

  1. An attacker obtains influence over the configured `kn ...[truncated 1212 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not construct a PowerShell command by concatenating or interpolating knowledge_base_path.
  2. Prefer a dedicated filesystem enumeration API or agent tool that accepts the directory as a structured argument without invoking a shell.
  3. If PowerShell is unavoidable, pass the path through a parameterized script or process argument array rather than embedding it in command text.
  4. Canonicalize the configured path and require it to resolve to an existing directory.
  5. Restrict access to explicitly approved knowledge-base roots and reject paths that escape those roots.
  6. Reject control characters and PowerShell metacharacters, including quotes, semicolons, pipes, backticks, dollar-sign expressions, newlines, and comment markers.
  7. Apply least privilege to the agent process so it cannot access unrelated sensitive directories.
  8. Require explicit user confirmation before recursively scanning a broad directory.
  9. Add tests using malicious path values to verify that configuration input is always handled as literal path data and can never alter command structure.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (6)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases are broad enough to activate on generic art-related requests, which can cause the skill to take over conversations outside a narrowly intended scope. This increases the chance of unintended tool use and unnecessary access to the local knowledge base, especially when combined with exec-based scanning behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The user-facing description and operating instructions are entirely in Chinese and present the skill as a Chinese-language tutor without offering a language choice. Under the policy, forcing a specific language or locale without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs the agent to use exec/PowerShell to enumerate the local filesystem, including recursive scans from a configurable root path. For an art tutor, shell execution is unnecessarily powerful and can expose unrelated local file metadata or become a stepping stone for command/path injection if the configured path or future query parameters are not tightly constrained.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

该技能清单整体宣称用于艺术学习助教,并围绕绘画、摄影、艺术史等本地艺术知识库进行推荐与答疑,但在末尾加入了“音乐教程”分类。音乐学习并未体现在技能描述的触发范围或能力说明中,因此知识库内容与声明的技能范围不一致。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The document is written entirely in Chinese, including headings and descriptive text, with no indication that users can choose another language or locale. 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
94% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Chinese from the title onward. Under the language/locale policy rule, forcing a specific language without opt-in or justification can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.