Back to skill

Security audit

元造 yotta-skill-creator

Security checks for vulnerabilities and agentic risk

Overview

The skill is mainly a disclosed scaffold generator, but its installer can write persistent skill files into many agent directories and the Node installer has a real symlink-boundary weakness.

Review before installing. Prefer an explicit single target such as --agent codex or --dir, avoid -g or no-argument auto-install unless you want this skill placed into multiple agent contexts, and do not run the Node installer in a shared or attacker-writable skills directory until symlink checks are 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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
bin/install.js:203
Finding

Node Installer Follows Attacker-Controlled Symbolic Links During Cleanup and Installation

Content
View full analysis

Vulnerability Details

File Location: bin/install.js, lines 203–257
Vulnerability Type: Symbolic-link traversal causing writes and deletion outside the selected installation directory
Risk Level: High

Technical Analysis

The Node.js installer derives the destination as <selected-directory>/yotta-skill-creator but does not reject symbolic links at that destination or among existing destination entries.

The cleanResidue() function initially calls fs.statSync(target), which follows a symbolic link. If the linked directory contains SKILL.md, the function treats it as a legitimate prior installation. It then constructs paths under that link and recursively deletes fixed entries such as package.json, .github, .git, bin, and node_modules.

After cleanup, installTo() calls fs.mkdirSync() and copies package contents into the same destination without verifying its canonical path or rejecting symbolic links. Consequently, an attacker-controlled link can redirect cleanup and installation operations outside the directory selected by the user.

Relevant code:

javascript
function cleanResidue(target) {
  const removed = [];
  let stat = null;
  try { stat = fs.statSync(target); } catch (_) { return removed; }
  if (!stat.isDirectory()) return removed;
  if (!fs.existsSync(path.join(target, 'SKILL.md'))) return removed;
  for (const name of TOP_SKIP) {
    const p = path.join(target, name);
    let entry = null;
    try { entry = fs.lstatSync(p); } catch (_) { continue; }
    if (entry.isSymbolicLink()) continue;
    fs.rmSync(p, { recursive: true, force: true });
    removed.push(name);
  }
  const walk = (dir) => {
    for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
      const p = path.join(dir, entry.name);
      if (entry.isSymbolicLink()) continue;
      if (entry.isDirectory()) {
        if (CACHE_DIRS.has(entry.name)) {
          fs.rmSync(p, { recursive: true, force: true });
          removed.push(p
...[truncated 3514 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use fs.lstatSync() on the installation base and final target before cleanup or copying, and reject either path if it is a symbolic link.
  2. Resolve the canonical installation base with fs.realpathSync() and verify that the canonical target remains strictly beneath that base.
  3. Inspect every existing destination path component with lstatSync() before writing or deleting; do not follow symbolic links encountered at any depth.
  4. Apply the same symbolic-link protections already implemented in install.sh to bin/install.js.
  5. Avoid modifying an existing destination in place. Build the installation in a newly created temporary directory under a trusted parent and atomically rename it into place after validation.
  6. Before every recursive deletion, revalidate that the canonical path is beneath the canonical installation target.
  7. Add regression tests covering a symbolic-link target, symbolic-link parent, and nested symbolic-link entries, and verify that installation fails without modifying the linked location.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • 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
Findings (50)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The English description likewise promises only template-based skill creation and self-checks, but the implementation reportedly behaves like an installer/CLI for deploying an existing skill into multiple agent-specific locations. This kind of description-behavior divergence can mislead reviewers and users, concealing persistence-oriented filesystem operations behind a benign-seeming scaffolding label.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The English description likewise promises only template-based skill creation and self-checks, but the implementation reportedly behaves like an installer/CLI for deploying an existing skill into multiple agent-specific locations. This kind of description-behavior divergence can mislead reviewers and users, concealing persistence-oriented filesystem operations behind a benign-seeming scaffolding label.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/yotta_skill_creator.py create yotta-my-tool \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/yotta_skill_creator.py create yotta-my-tool \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/yotta_skill_creator.py create yotta-my-tool \

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · package.json (reported line 4)May include surrounding context.

json
{
  "name": "@yottameta/yotta-skill-creator",
  "version": "0.1.5",
  "description": "YuanZao (元造) — a zero-dependency Python 3.8+ skill scaffold generator: validates naming (yotta- prefix / lowercase-hyphen / YuanX Chinese name / non-overwrite), renders a full release-compliant scaffold from an embedded template (SKILL.md, bilingual four-way-install README, package.json, CHANGELOG, LICENSE, NOTICE, install.sh + bin/install.js, .gitignore, .npmignore, publish.yml, references, assets), replaces placeholders and runs a structure self-check; --self-use mode generates only the skill body (SKILL.md / references / optional CLI) without any release artifacts. Triggers: creating a new yotta- skill, scaffolding a skill from scratch, or fixing release-standard pitfalls into a reusable template; or when the user says 元造 / 造技能 / 脚手架 / scaffold / 新建技能. Boundaries: it does not write skill content or script logic (SKILL.md body / scripts need manual development), does not pre-publish validate or release (that is yotta-publish-guard), and does not batch-migrate existing skill directories.",
  "license": "MIT",
  "keywords": [
    "agent-skills",

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file uses Chinese throughout, including headings and operational descriptions, with no indication that the language is optional or that the skill is region-specific. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The header explicitly labels the skill language as English, which is a natural-language policy concern when presented as a fixed language choice rather than a user-selectable option. Although a Chinese translation link exists, the document still frames English as the operative language without stating that users may choose their preferred language.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger description is broad enough to match generic requests such as 'scaffold' or 'new skill', which can cause the skill to activate when the user did not specifically intend to use this tool. Over-broad activation can lead to inappropriate tool selection, accidental file generation, or interference with other more suitable skills in multi-skill environments.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 99)May include surrounding context.

md
| 元造 yotta-skill-creator (this skill) | **Create**: compliant scaffold + structure self-check |
| 元守 yotta-publish-guard | **Guard**: pre-publish check / pack / versions / names / publish |

Recommended flow: **元造 create (scaffold) → develop the skill body / scripts / tests → 元守 check → pack → versions → names → publish**.

References: `references/tutorial.md` (Chinese tutorial), `references/cli-reference.md` (full CLI reference), `references/scaffold-structure.md` (generated layout).

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 111)May include surrounding context.

text
# Optional China mirror: npm config set registry https://registry.npmmirror.com
npx -y @yottameta/yotta-skill-creator@0.1.5 --agent <agent-name>      # install to the agent's default user-level skills dir
npx -y @yottameta/yotta-skill-creator@0.1.5 --dir <your-skills-dir>   # point to the skills dir itself (e.g. ~/.codex/skills)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill description requires input of a Chinese name and presents the workflow and trigger phrasing entirely in Chinese, indicating a language constraint in the skill’s natural-language interface. There is no statement offering a user language choice or documenting this as an explicitly region-specific limitation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README describes activation with broad phrases such as “元造 / 造技能 / 脚手架 / scaffold / 新建技能 等”, several of which are generic terms that could appear in ordinary conversations about building or creating skills. The description does not provide negative examples or explicit constraints to distinguish when the skill should versus should not activate.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill metadata describes behavior that implies file, environment, and shell access, but it does not declare any explicit tool scope such as allowed-tools or permissions. This creates an under-specified trust boundary: a user or hosting platform cannot easily see that the skill may read environment-derived paths, write files, and invoke installer flows, increasing the risk of unintended execution with broader privileges than expected.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrases include broad terms such as scaffold-like or creation-related language that may overlap with ordinary conversation. Overbroad triggers are risky because they can cause the skill to activate unexpectedly in contexts where the user did not intend filesystem-generating or installer-related actions, especially given the higher-risk behavior suggested by other findings.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code enumerates and targets a broad set of user-home and project agent skill directories, enabling wide deployment of the package into multiple trusted agent contexts. In a skill whose stated purpose is template/scaffold creation, this broad write scope is unusually dangerous because it can plant content where many assistants may later discover and use it.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script's primary behavior is installing files into agent and project skill directories across many environments, which materially exceeds the described scaffold-generation purpose. That mismatch can surprise users, alter unrelated agent configurations, and create an unintended propagation mechanism for skill content into trusted execution locations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.