Back to skill

Security audit

Nima Skill Creator

Security checks for vulnerabilities and agentic risk

Overview

This skill helps build and package skill files and does not show hidden data theft or unsafe automatic behavior, but it can create persistent skill folders when used.

Install only if you want a skill that can create, modify, validate, and package Codex skill folders. Review target paths before running its scripts, especially commands that write under CODEX_HOME or package a directory, and avoid placing package output inside the source skill directory.

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

Note
Location
scripts/package_skill.py:36
Finding
Archive Self-Inclusion When Output Is Placed Inside the Source Tree<![CDATA[ ## Vulnerability Details **File Location**: `scripts/package_skill.py:36-45` **Vulnerability Type**: Unsafe archive output-path handling **Risk Level**: Low ```python target_dir = (output_dir or skill_dir.parent).expanduser().resolve() target_dir.mkdir(parents=True, exist_ok=True) archive_path = target_dir / f"{skill_dir.name}.skill.zip" with ZipFile(archive_path, "w", ZIP_DEFLATED) as zf: for path in iter_files(skill_dir): zf.write(path, path.relative_to(skill_dir)) return archive_path ``` ### Technical Analysis The packaging function permits `output_dir` to resolve to the source Skill directory or one of its descendants. It opens the destination archive before recursively enumerating source files through `iter_files(skill_dir)`. If the destination archive is inside `skill_dir`, recursive enumeration can encounter the archive currently being written and attempt to add it to itself. The implementation also does not exclude pre-existing `*.skill.zip` archives. This can produce nondeterministic or corrupted packages and may unnecessarily increase resource consumption. Exploitation requires control over the packaging output path and write access to the selected directory. The issue does not provide command execution, privilege escalation, or access beyond the invoking process's existing filesystem permissions. ### Attack Path 1. Prepare or select a valid Skill directory that passes `validate_skill`. 2. Invoke the packaging script with an output directory located inside that Skill directory: ```bash python3 scripts/package_skill.py /path/to/skill /path/to/skill ``` 3. The script creates `/path/to/skill/skill.skill.zip`. 4. `iter_files()` recursively enumerates `/path/to/skill` after the archive has been opened. 5. The active archive can be treated as a source file and written into itself. Pre-existing package archives can likewise be included. 6. The resulting package may be corrupted, nondetermini ...[truncated 555 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Reject any archive destination located within the source Skill directory: ```python resolved_skill_dir = skill_dir.expanduser().resolve() target_dir = (output_dir or resolved_skill_dir.parent).expanduser().resolve() if target_dir == resolved_skill_dir or resolved_skill_dir in target_dir.parents: raise ValueError("Output directory must not be inside the skill directory.") ``` 2. Resolve `archive_path` and explicitly exclude it during file enumeration as defense in depth. 3. Exclude package artifacts such as `*.skill.zip` unless they are intentionally part of the Skill. 4. Enumerate and validate the complete input file list before opening the output archive. 5. Add regression tests covering: - Output equal to the Skill directory. - Output in a nested subdirectory. - A pre-existing archive in the source tree. - The normal default output in the Skill directory's parent. ]]>
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
The declared description presents a broad skill-authoring and improvement system focused on requirement discovery, planning, scaffolding scripts, and validation for building or redesigning skills. The actual code chunk does not implement creation, refactoring, requirement discovery, planning, or scaffolding. Instead, it performs packaging of an already existing validated skill directory into a .zip file. Validation is mentioned in the description, so that aspect is partially aligned, but the primary behavior of this code is packaging/archiving, which is a materially different and undeclared capability relative to the stated purpose. Therefore this chunk is a description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
The code chunk only implements validation of a skill folder’s structure and metadata. It does not create, refactor, scaffold, plan, or redesign skills, nor does it perform requirement discovery. Validation is one component mentioned in the description, but the declared purpose presents a much broader skill-building and transformation capability than what this code actually does. Therefore the description materially overstates the code’s behavior.

Ae1

High
Category
analysis-evasion
Content
4. Keep `SKILL.md` procedural and concise. Move deep detail into `references/`.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
4. Keep `SKILL.md` procedural and concise. Move deep detail into `references/`.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
4. Keep `SKILL.md` procedural and concise. Move deep detail into `references/`.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
4. Keep `SKILL.md` procedural and concise. Move deep detail into `references/`.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill instructs the agent to run local Python scripts and operate on user-supplied paths, but it declares no explicit tool scope or permission boundaries. That increases the chance the skill will perform filesystem writes and shell execution more broadly than intended, especially if a user provides a sensitive or unexpected target path.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
Forcing Chinese during requirement discovery without user opt-in can cause misunderstanding of requirements, validation steps, or filesystem targets, which is risky in a skill that creates and modifies files and runs scripts. In security-sensitive or operational contexts, language coercion can undermine informed consent and accurate review even if it is not overtly malicious.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The file description says only 'Hybrid skill creation framework with interactive Chinese-guided workflows and English technical documentation,' which is materially narrower than the stated manifest context describing gated requirement discovery, reusable resource planning, executable scaffolding scripts, validation, and multiple redesign patterns. That creates a semantic mismatch between what the skill is presented as doing here and what it is claimed to actually support.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The manifest description says the skill uses "interactive Chinese-guided workflows and English technical documentation," which indicates a language-specific interaction model. Because it does not mention any user choice, opt-in, or justification for this locale constraint, it appears to force a specific language and may violate language/locale policy requirements.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The template tells authors to describe when the skill should activate, but it does not require narrow, testable trigger constraints. In practice, this can lead to overly broad skill routing and accidental invocation in unrelated contexts, increasing the chance that powerful scripts, references, or automation are loaded when they should not be.

Vague Triggers

Medium
Confidence
90% confidence
Finding
Lines L08-L09 instruct authors to place activation guidance in the description, but they do not require specificity, constraints, or negative examples. In a best-practices document, this omission can promote broad or ambiguous trigger descriptions that overlap with ordinary requests.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file is titled and instructed entirely as Chinese-only guidance, including the explicit rule to 'Use plain Chinese' and all prompt examples in Chinese. This imposes a specific language/locale without any opt-in, alternative, or stated region-specific justification, which matches the policy-violation criteria.

Static analysis

No suspicious patterns detected.