Back to skill

Security audit

Shinewilzhang Veadk Skills

Security checks for vulnerabilities and agentic risk

Overview

This VeADK code-generation skill is coherent, but its bundled save script can create or overwrite any writable local file path without validation or confirmation.

Install only if you are comfortable with a VeADK generator that can write local files. Before using it, constrain outputs to a dedicated workspace directory, review generated paths, and avoid letting user-provided names or conversion input determine file paths without validation.

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
scripts/save_file.py:17
Finding

Unrestricted Arbitrary File Write

Content
View full analysis

Vulnerability Details

File Location: scripts/save_file.py, lines 17–21 and 29–35
Vulnerability Type: Unrestricted file path handling and arbitrary file overwrite
Risk Level: High

Vulnerable Code

python
# create dir if not exist
os.makedirs(os.path.dirname(file_path), exist_ok=True)

with open(file_path, "w", encoding="utf-8") as f:
    f.write(content)

The destination and content are supplied directly through command-line arguments:

python
parser.add_argument("--path", type=str, required=True, help="Path to save the file")

parser.add_argument(
    "--content",
    type=str,
    required=True,
    help="Content to write into the file",
)

Technical Analysis

The script accepts an unrestricted caller-controlled path and writes caller-controlled content to it. It does not:

  • Restrict output to a designated artifact directory.
  • Reject absolute paths or .. traversal components.
  • Canonicalize the destination before validating it.
  • detect symlink-based escapes.
  • Prevent unintended replacement of existing files.

The use of open(file_path, "w") truncates an existing destination before writing. Although SKILL.md describes saving generated files under an Agent-specific directory, that intended boundary is not enforced by the executable code.

Exploitation requires the attacker to influence the --path and potentially --content arguments passed to the script. This may occur through direct invocation or manipulation of an Agent workflow that derives the output path from untrusted input.

Attack Path

  1. The Skill completes Agent code generation and invokes save_file.py.
  2. An attacker influences the path argument directly or through manipulated Agent naming or output-path content.
  3. The attacker supplies an absolute path, a path containing traversal components, or a path that resolves through a symlink.
  4. os.makedirs() creates missing paren ...[truncated 1054 chars]
Remediation
View remediation

Remediation Suggestions

  • Define a fixed, trusted artifact root and permit writes only beneath it.
  • Parse the requested destination as a relative path and reject absolute paths and traversal components.
  • Resolve both the artifact root and destination with pathlib.Path.resolve(), then verify that the destination is a descendant of the trusted root.
  • Validate generated Agent names using a strict allowlist, such as ASCII letters, digits, and underscores.
  • Reject symlink destinations and inspect existing parent path components for symlinks where the threat model requires it.
  • Avoid overwriting existing files by default. Use exclusive creation mode ("x") or require explicit authorization before replacement.
  • Apply restrictive file permissions where generated artifacts may contain sensitive content.
  • Prefer passing content through standard input or a protected temporary file if command-line exposure is a concern.
  • Add tests covering absolute paths, ../ traversal, nested traversal, symlink escapes, existing-file replacement, and valid paths under the artifact root.

Example containment check:

python
from pathlib import Path

OUTPUT_ROOT = Path("generated_agents").resolve()

def safe_destination(relative_path: str) -> Path:
    requested = Path(relative_path)
    if requested.is_absolute():
        raise ValueError("Absolute paths are not permitted")

    destination = (OUTPUT_ROOT / requested).resolve()
    if destination == OUTPUT_ROOT or OUTPUT_ROOT not in destination.parents:
        raise ValueError("Destination escapes the artifact directory")

    return destination
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (13)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The stated purpose is general VeADK assistance, but the skill also instructs local file creation and code persistence through a command-line save script. This mismatch is dangerous because users may invoke what appears to be a code-generation helper without realizing it can perform filesystem changes, which broadens the skill's effective privilege and abuse surface.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill directs the agent to write generated code to local files via python save_file.py --path ... --content ..., but it declares no tool scope or permission boundary. That means a caller or downstream agent could enable file-write behavior without any explicit restriction on destination paths or user confirmation, increasing the risk of unintended or unsafe local file modification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger conditions are broad enough to activate on many ordinary VeADK-related requests, including simple help or conversions. When a skill with file-writing follow-up actions can trigger too easily, the chance of accidental activation and unintended code/file generation increases substantially.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly instructs saving generated code to files but does not warn the user that local files will be created or modified. In context, this is more dangerous because the write path is parameterized and the skill is aimed at code generation, making it easy to overwrite files or create artifacts without informed consent.

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 contains natural-language guidance in Chinese and uses directive wording such as '你必须清晰地定义好 Docstring', effectively prescribing a specific language/locale for skill documentation. Under the policy, forcing a language without user choice or documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill instruction is written exclusively in Chinese and provides no indication that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script writes attacker-controlled content to an attacker-controlled path with no validation, sandboxing, overwrite protection, or user confirmation. In an agent-skill context, this can be abused to create or overwrite arbitrary files accessible to the process, potentially modifying configuration, scripts, or other sensitive files and enabling persistence or further compromise.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains instructional content exclusively in Chinese, and there is no note offering an alternative language or stating that the content is intentionally limited to a Chinese-speaking audience. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a locale/language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill documentation is written only in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the stated policy, forcing a specific language without opt-in or documented justification 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
89% confidence
Finding

The title and all explanatory text in the markdown are written in Chinese, with no indication that language selection is optional or that the document is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

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 title and instructions are written entirely in Chinese and direct the agent to generate Python code according to the provided guidance, with no indication that the user may choose another language or locale. This creates a natural-language policy concern because it implicitly enforces 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
95% confidence
Finding

The function docstring is written in Chinese, which imposes a specific language in the skill's natural-language documentation without offering a user choice or documenting a justified locale restriction. Under the policy, fixed language constraints should be optional or explicitly justified.

Content

No source excerpt is available for this finding.