Back to skill

Security audit

Repomix

Security checks for vulnerabilities and agentic risk

Overview

The skill’s repository-packing purpose is coherent, but its install guidance asks users to run unpinned npm packages, including an auto-confirmed MCP server, which creates avoidable supply-chain and local-access risk.

Review and pin the repomix-rs package version before installing or running it, avoid npx -y for MCP startup unless the package version and provenance are trusted, do not run these commands with elevated privileges, and limit repository packing to directories that do not contain secrets or unrelated private data.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:26
Finding

Unpinned Third-Party Package Installation and Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 26-35
Vulnerability Type: Unpinned npm dependency execution
Risk Level: Medium

Vulnerable Code

bash
# Global install — `repomix` available everywhere
npm install -g repomix-rs

# One-off run without global install
npx repomix-rs .

# Run the MCP server on stdio
npx -y repomix-rs --mcp

Technical Analysis

The skill directs users or agents to install and execute repomix-rs without specifying an exact, reviewed package version or verifying package integrity and provenance. Consequently, npm resolves the package version available under the registry's current distribution tag at execution time. The effective code can therefore change after this skill has been reviewed.

The npx -y command further suppresses the package installation confirmation and immediately starts the downloaded package as an MCP server. A global installation also places or replaces the repomix executable in the global npm binary location, potentially affecting later commands outside the current task.

Exploitation depends on a malicious or compromised package release, registry/account compromise, or dependency supply-chain compromise. The audited file does not itself contain a malicious payload.

Attack Path

  1. An attacker compromises the npm package, its publisher account, or a transitive dependency and publishes malicious code under a version selected by the current npm distribution tag.
  2. A user or agent follows the skill and runs npm install -g repomix-rs, npx repomix-rs ., or npx -y repomix-rs --mcp.
  3. npm retrieves the unpinned package and may execute package lifecycle scripts or the package CLI with the invoking user's permissions.
  4. The malicious code gains access to resources available to that user, including the repository being analyzed, environment variables, writable files, and potentially network services.
  5. With global installation ...[truncated 740 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin the dependency to an exact, reviewed version, for example npx repomix-rs@2.0.0, rather than relying on a mutable distribution tag.
  • Verify the selected package version's provenance, publisher identity, integrity metadata, and release artifacts before execution.
  • Prefer a project-local installation governed by a committed lockfile and integrity hashes over a global installation.
  • Remove -y from npx examples so users must explicitly approve package retrieval.
  • Avoid running npm installation or execution commands with administrator or root privileges.
  • Execute the package in a sandbox or container with narrowly scoped filesystem and network access.
  • Restrict repository access to the minimum directory required and avoid exposing credentials through environment variables.
  • Pin and audit transitive dependencies where the package-management workflow permits it.
  • For MCP mode, bind the server only to the intended transport, limit exposed capabilities, and terminate it immediately after use.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (5)

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

Using npx repomix-rs without pinning an exact package version causes the agent to fetch and execute whatever version is current at runtime. If the package is compromised, typo-squatted, or updated with malicious code, this skill could lead to arbitrary code execution on the host when users follow the documented MCP startup flow.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

npx -y repomix-rs --mcp both auto-confirms installation and executes an unpinned package version, removing an important user friction point before running code from the npm registry. In an agent skill context, this is more dangerous because it directly launches an MCP server process that may be granted access to local files or other agent-connected capabilities.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

npx repomix is also unpinned and is additionally riskier because it refers to a different package name that could be confused with the Rust variant. Dynamic resolution of an unpinned package in documentation encourages execution of whatever package version is currently available, enabling supply-chain compromise or unexpected behavior.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

npx repomix is also unpinned and is additionally riskier because it refers to a different package name that could be confused with the Rust variant. Dynamic resolution of an unpinned package in documentation encourages execution of whatever package version is currently available, enabling supply-chain compromise or unexpected behavior.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The troubleshooting advice to use npx repomix-rs repeats the same supply-chain risk: an agent or user may execute an unpinned package pulled at runtime from npm. In this skill, that risk is amplified because the tool is intended to process local or remote repositories and may be run in privileged developer environments.

Content

No source excerpt is available for this finding.