Back to skill

Security audit

Repomix Explorer

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate repository-analysis purpose, but it tells the agent to download and run mutable third-party code through shell commands without strong scoping or confirmation.

Install only if you are comfortable with an agent running shell commands that may download Repomix from npm, read repository contents, and write output files. Prefer a revised version that pins Repomix to a reviewed version, asks before first execution or network access, validates repository and path inputs, and limits cleanup to known generated files.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:41
Finding
Mutable Remote Package Is Downloaded and Executed Through npx<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:41-47` **Additional References**: `SKILL.md:53-64`, `SKILL.md:78-90`, `SKILL.md:189-243`, `SKILL.md:276` **Vulnerability Type**: Remote execution of an unpinned third-party package **Risk Level**: High ### Vulnerable Code ```markdown 2. **Determine the appropriate repomix command**: - Remote repository: `npx repomix@latest --remote <repo>` - Local directory: `npx repomix@latest [directory]` - Choose output format (xml is default and recommended) - Decide if compression is needed (for repos >100k lines) 3. **Execute the repomix command** via shell ``` The same unsafe pattern is prescribed by the primary workflow: ```bash npx repomix@latest --remote <repo> --output /tmp/<repo-name>-analysis.xml ``` ```bash npx repomix@latest [directory] [options] ``` ### Technical Analysis The Skill repeatedly instructs the agent to invoke `npx repomix@latest`. If the package is not already available locally, `npx` can retrieve it from the configured npm registry and immediately execute its entry point. The `latest` tag is mutable and does not identify a reviewed, immutable package version. Consequently, the code executed at invocation time can differ from the code that existed when this Skill was audited. There is no exact version pin, lockfile, package integrity requirement, or independent verification step in the project. This creates a remote payload retrieval and execution channel through the npm supply chain. The issue does not prove that Repomix itself is malicious. The vulnerability is that the documented execution mechanism implicitly trusts future content associated with a mutable remote package tag. ### Attack Path 1. An attacker compromises the package publisher account, npm package, registry resolution path, or a future release associated with the `latest` tag. 2. A user asks the agent to analyze a repository using this Skill. 3. The agent follows the instructions and runs `npx re ...[truncated 1073 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `repomix@latest` with an explicitly reviewed version, such as `repomix@x.y.z`. 2. Manage the package through a committed lockfile that records resolved package versions and integrity hashes. 3. Install dependencies in a controlled build step rather than allowing `npx` to download packages during each Skill invocation. 4. Use `npx --offline` or `npx --no-install` after installing and verifying the approved dependency. 5. Verify package provenance and integrity through trusted registry metadata, signatures, or an approved internal artifact repository. 6. Run repository analysis in a sandbox with minimal filesystem access, restricted environment variables, and limited network connectivity. 7. Require explicit user confirmation before any package download or first-time third-party code execution. 8. Establish a dependency update process in which new versions are reviewed and tested before the pinned version is changed. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:41
Finding
User-Supplied Repository and Path Values Are Inserted Into Shell Command Templates<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:41-47` **Additional Reference**: `SKILL.md:53-64` **Vulnerability Type**: Shell command and option injection **Risk Level**: High ### Vulnerable Code ```markdown 2. **Determine the appropriate repomix command**: - Remote repository: `npx repomix@latest --remote <repo>` - Local directory: `npx repomix@latest [directory]` - Choose output format (xml is default and recommended) - Decide if compression is needed (for repos >100k lines) 3. **Execute the repomix command** via shell ``` The corresponding workflow templates are: ```bash npx repomix@latest --remote <repo> --output /tmp/<repo-name>-analysis.xml ``` ```bash npx repomix@latest [directory] [options] ``` ### Technical Analysis The Skill directs the agent to construct and execute shell commands containing repository identifiers, directory paths, output names, and options derived from a user's request. It does not require strict validation, safe quoting, structured argument passing, or rejection of shell metacharacters. If an agent performs direct string interpolation, shell control characters in a supplied repository or path value can be interpreted as command syntax rather than literal data. Even where shell metacharacters are quoted, values beginning with option prefixes may be interpreted as unintended Repomix or `npx` arguments unless option handling is explicitly terminated or validated. The `[options]` placeholder further permits user-influenced flags without an allowlist. Depending on supported command-line options, this can alter input selection, output locations, remote targets, and other processing behavior. ### Attack Path 1. An attacker submits an analysis request containing a crafted repository identifier, directory path, output name, or purported option. 2. The agent substitutes the value into one of the documented command templates. 3. The agent executes the resulting command through a shell, as explicitly r ...[truncated 1115 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not construct a command string and pass it to a shell. Invoke the process through an API that accepts an executable and a separate argument array. 2. Pass every repository identifier, path, output name, and option as an individual argument. 3. Allowlist remote repository formats, such as a narrowly defined `owner/repository` pattern or validated HTTPS URLs from approved hosts. 4. Resolve local paths canonically and verify that they remain within an explicitly authorized directory. 5. Reject control characters, shell metacharacters, newline characters, and unexpected leading hyphens in user-controlled values. 6. Use `--` to terminate option parsing before positional paths where the invoked command supports it. 7. Replace the unrestricted `[options]` placeholder with a fixed allowlist of documented, low-risk flags and validate each flag's value. 8. Generate output names internally rather than deriving raw filenames from repository names. Use securely created temporary directories and non-colliding files. 9. Require user confirmation before processing paths outside the current project or writing to user-selected locations. 10. Add adversarial tests covering spaces, quotes, semicolons, command substitutions, newlines, redirections, leading hyphens, traversal sequences, and absolute paths. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (19)

Vague Triggers

Medium
Confidence
88% confidence
Finding
The trigger phrases are broad and overlap with many ordinary repository questions, which increases the chance the skill will auto-activate and execute shell/network actions when the user only wanted a conceptual answer. In skill systems, ambiguous activation boundaries can turn benign prompts into unexpected code execution and local file creation.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The skill instructs use of `npx repomix@latest`, which fetches and executes whatever package version is current at runtime rather than a reviewed, immutable version. This creates a supply-chain risk: a compromised upstream release, malicious dependency, or typo/registry hijack could lead to arbitrary code execution on the agent host whenever the skill runs.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
Using `npx repomix@latest` delegates trust to the latest published package at execution time, enabling unreviewed code to run in the shell. In an agent skill, this is especially risky because the command may run automatically on user-triggered prompts and can access local files and network resources.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill directs shell execution, remote fetching, local output-file creation, and possible cleanup without explicitly warning the user that these system changes will occur. This weakens informed consent and makes it more likely the agent will perform impactful actions—network access and filesystem modification—under prompts that sound like ordinary analysis requests.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
This command pattern relies on fetching the newest package version during execution, exposing the environment to supply-chain compromise and unexpected behavior changes. Because the tool is invoked through shell commands, any malicious package code would execute with the agent's permissions.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
Referencing `npx repomix@latest` means the exact code executed is nondeterministic and controlled by the remote package registry. That creates a direct path for arbitrary code execution if the upstream package or one of its dependencies is compromised.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The skill's repeated use of `@latest` normalizes execution of unpinned third-party code, increasing the chance that every invocation will pull in changed or malicious content. In a repository-analysis context, the tool may process untrusted repositories while also having local filesystem access, compounding risk.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
This example again uses runtime resolution of the latest package release, which is a classic software supply-chain hazard. If exploited, malicious package code could read local data, tamper with outputs, or execute further commands from the host environment.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
An agent following this instruction would execute a non-deterministic external package via shell, making the skill dependent on mutable upstream code. That is dangerous because compromise of the package ecosystem immediately becomes compromise of the agent runtime.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The command shows direct shell execution of an unpinned package version, exposing the host to arbitrary code execution from the npm supply chain. The risk is amplified by the skill's broad trigger scope, which could cause frequent or casual invocation.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
Using `npx ...@latest` for included-pattern analysis still requires downloading and executing the current release from the registry. A malicious or compromised release could abuse the agent's local access regardless of the benign analytical intent.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The manifest describes analyzing and exploring repositories with Repomix, which clearly justifies packing repositories and reading the resulting output. However, instructing the agent to 'clean up output files' adds filesystem-deletion behavior beyond what is necessary to analyze a codebase, especially when no user request to delete files is required.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The explicit `rm repomix-output.xml` command gives the agent a destructive filesystem action that is not strictly necessary to fulfill repository analysis and may operate in the current directory. In an automated skill, this can lead to accidental deletion, path-confusion mistakes, or normalization of broader file-removal behavior beyond the minimum required capability.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The example workflow instructs execution of a mutable upstream package at analysis time. This exposes the system to unexpected code changes and possible malicious package execution whenever a user asks to analyze a repository.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
This pattern repeats the same unsafe supply-chain behavior: pulling and executing the latest package release through `npx`. Because the command may be run against local repositories, a compromise could affect local source trees and adjacent files.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
Invoking `npx repomix@latest ./` permits unreviewed third-party code to execute on the host each time the workflow runs. The fact that the action is framed as routine structure analysis makes accidental exposure more likely.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
Even with `--compress`, the core issue remains that the command executes whatever package version is currently published. That creates a straightforward supply-chain execution vector with potentially broad filesystem and network impact.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
This file-type filtering example still depends on `npx repomix@latest`, so it inherits the same arbitrary code execution risk from the npm ecosystem. The analytical use case does not mitigate the danger of executing mutable external code.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
Advising `npx repomix@latest --help` still causes execution of the latest release and is therefore not harmless from a security perspective. Any package lifecycle or runtime code would execute before help text is shown, enabling compromise through a seemingly safe support action.

Static analysis

No suspicious patterns detected.