Back to skill

Security audit

CapForge

Security checks for vulnerabilities and agentic risk

Overview

The skill's repository-scanning purpose is coherent, but it needs Review because it claims to avoid remote npx execution while still using unpinned npm/npx execution paths.

Review before installing. Use a pinned, reviewed capforge version if possible, replace npx examples with the installed capforge binary, and run commands only after confirming the target repository and workspace. Expect cloned repositories and generated Markdown files under ~/.capforge unless you set a different workspace.

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:16
Finding

Unpinned npm Package Installation and Remote Execution Through npx

Content
View full analysis

Vulnerability Details

File Locations:

  • SKILL.md:16-20
  • SKILL.md:108-113
  • README.md:12-16

Vulnerability Type: Unpinned third-party dependency and mutable remote package execution
Risk Level: Medium

Vulnerable Code:

SKILL.md:16-20:

yaml
install:
  # Install the CapForge CLI through a fixed dependency and avoid npx remote execution
  - kind: node
    package: capforge
    bins: [capforge]

SKILL.md:108-113:

bash
### Step 3) Generate transform-plan.md

```bash
npx capforge transform <project-name>
text

`README.md:12-16`:

```bash
# Import and scan
npx capforge import https://github.com/nousresearch/hermes-agent
npx capforge scan hermes-agent
npx capforge describe hermes-agent

Technical Analysis

The Skill declares the capforge npm package without an exact version or integrity constraint. It also directs users or Agents to invoke the package through npx capforge.

When the package is not already available locally, npx can retrieve the currently published package from the configured npm registry and execute it. The effective code therefore may change after the Skill has been reviewed. A compromised maintainer account, malicious package release, registry compromise, or unexpected future version could introduce arbitrary code without any modification to this Skill package.

This behavior also conflicts with the comment in SKILL.md:17, which claims that the dependency is fixed and that remote execution through npx is avoided. The declared installation is not fixed because package: capforge contains no version, and multiple documented commands explicitly use npx.

The repository pre-scan warning concerning curl | sh is not itself a vulnerability. The occurrence in SKILL.md:35 is explanatory text that prohibits such execution rather than an executable command.

Attack Path

  1. An attacker compromises the npm publishe ...[truncated 1491 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin capforge to a reviewed exact version in the Skill metadata, for example:

    yaml
    package: capforge@1.3.3
    

    Confirm the exact syntax supported by the Skill installer before publishing.

  2. Replace every npx capforge ... instruction with the already-declared installed binary:

    bash
    capforge transform <project-name>
    capforge import https://github.com/nousresearch/hermes-agent
    capforge scan hermes-agent
    capforge describe hermes-agent
    
  3. Use a lockfile and npm integrity hashes wherever the installation framework supports them.

  4. Review the pinned package contents, transitive dependencies, executable entry points, and npm lifecycle scripts before approving an update.

  5. Disable lifecycle scripts during installation when they are not required, such as through npm install --ignore-scripts, subject to compatibility testing.

  6. Ensure upgrades require an explicit security review rather than automatically tracking the latest registry release.

  7. Update the documentation so its security claims accurately reflect the implemented installation and execution process.

Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
本 skill **默认只读(read-only)**:只执行结构扫描、文档生成、域归类、格式校验与安全的仓库同步。

- 不会自动执行代码改造/重构
- 不会执行隐藏命令、`curl | sh`、或 `npx @latest` 这类不可审计的远程执行
- License 合规仅做提醒与门禁,不提供法律意见

### 运行前确认(降低误操作风险)

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

The README instructs users to run npx capforge without pinning a specific package version. Because npx resolves and may download the latest package at execution time, a compromised upstream release, typosquat, or unexpected breaking update could cause users to execute unreviewed code on their systems.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

This command again uses npx capforge without a pinned version, which means the executed code is not fixed to a reviewed release. In a skill README, users are likely to copy-paste commands directly, increasing the chance of running a newly published or malicious package version if the supply chain is compromised.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

The unpinned npx capforge invocation allows dynamic retrieval of whatever version is current at runtime. That creates a supply-chain execution risk, especially in documentation intended for broad reuse, because an attacker controlling the package or a dependency could gain code execution on user machines.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document explicitly claims it avoids remote npx execution through fixed dependency installation, but later instructs the user to run npx capforge transform. This inconsistency can mislead users into trusting a workflow that still permits dynamic package execution, undermining the stated security boundary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language instructions, warnings, and workflow are predominantly in Chinese, which effectively forces a specific language for users of the skill. The file does not offer an opt-in language choice or explain that the skill is intended only for a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The security statement says the skill is 'read-only by default' and only performs scanning, documentation generation, classification, validation, and safe sync. Later instructions direct the agent to '覆盖写回' the generated capability file and to rewrite the transform plan file, which are active content modifications and not merely read-only scanning behavior.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The workflow later instructs running npx capforge transform <project-name>, which can resolve and execute a package at runtime rather than using only the pinned locally installed CLI described earlier. That creates a supply-chain and unexpected-code-execution risk, especially because the skill positions itself as safer than remote npx execution.

Content

No source excerpt is available for this finding.