Back to skill

Security audit

Forge

Security checks for vulnerabilities and agentic risk

Overview

Forge is a disclosed autonomous test-and-fix skill, but it gives the agent broad authority to run project commands, modify code, persist learned patterns, and commit changes with insufficient scoping and safeguards.

Install only in a disposable branch or isolated test environment. Review any forge.config.yaml first, pin or preinstall external tooling instead of using @latest, verify .env and backend targets are non-production, and disable or closely supervise auto-fix, auto-commit, persistent memory reuse, migrations, seeding, and background services.

Vulnerability Patterns
  • 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
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:193
Finding

Mutable Remote Package Is Downloaded and Executed Through npx

Content
View full analysis
/tmp/live-spec.json # Store contract snapshot for regression detection npx @claude-flow/cli@latest memory store \ --key "contract-snapshot-$(date +%s)" \ --value "$(cat /tmp/live-spec.json | head -c 5000)" \ --namespace forge-contracts ``` The same mutable `npx @claude-flow/cli@latest` execution pattern is used repeatedly elsewhere in `SKILL.md`, including swarm initialization, memory operations, hooks, and neural training. ### Technical Analysis The skill instructs the agent to execute `@claude-flow/cli` through `npx` using the mutable `latest` distribution tag. If the package is not already available locally, `npx` can download and execute it automatically. The `latest` tag does not identify a fixed, previously audited artifact and can resolve to different package contents after the skill itself has been reviewed. No exact version, package-lock entry, integrity hash, vendored artifact, or trusted installation step constrains the code that will execute. Consequently, compromise of the package, its publishing account, its dependency graph, or the package registry can change the effective executable payload without any modification to this project. This is primarily remote payload retrieval and execution. It also creates a supply-chain risk because the downloaded executable receives the permissions of the user running the agent. ### Attack Path 1. An attacker compromises the `@claude-flow/cli` package, a transitive dependency, or an account authorized to publish it. 2. The attacker publishes a malicious version and assigns it to the `latest` tag. 3. A user invokes Forge in a project environment. 4. Forge follows the inst ...[truncated 1056 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:566
Finding

Untrusted Repository-Derived Fix Patterns Can Poison Persistent Agent Memory

Content
View full analysis
= 0.95 confidence): - Auto-apply the stored fix pattern immediately - No review needed GOLD (>= 0.85 confidence): - Auto-apply the stored fix pattern - Flag in commit message for awareness SILVER (>= 0.75 confidence): - Read the failing test file and source file - Apply suggested fix with extra verification - Run targeted test before proceeding BRONZE or NO PATTERN: - Read the failing test file - Read the source file causing the failure - Implement fix from first principles - Use defensive patterns appropriate to the test framework 3. After fixing, identify affected context: - Check dependency graph for cascade impacts - Flag dependent contexts for re-testing 4. Store the fix pattern with initial confidence: npx @claude-flow/cli@latest memory store \ --key "fix-[error-type]-[hash]" \ --value '{"pattern":"[fix]","confidence":0.75,"tier":"silver","applied":1,"successes":0}' \ --namespace forge-patterns 5. Signal Test Runner to re-run affected tests 6. Signal Quality Gate Enforcer to check all 7 gates ``` Confidence is subsequently increased after successful test cycles, allowing stored patterns to reach the Platinum tier and be applied without review. ### Technical Analysis The skill persists fix patterns derived from repository source, test failures, stack traces, and agent-generated analyses. These inputs may be attacker-controlled when Forge is run against an untrusted repository. The stored records are placed in the generic `forge-patterns` namespace without documented isolation by repository identity, revision, owner, framework version, or trust level. A test result only demonstra ...[truncated 2108 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:145
Finding

Repository-Controlled Configuration Commands Are Interpolated Directly Into a Shell

Content
View full analysis
/dev/null || true # 5. Build the backend ${BUILD_COMMAND} # 6. Run database migrations (if applicable) ${MIGRATION_COMMAND} # 7. Start backend (background) nohup ${RUN_COMMAND} > backend.log 2>&1 & echo $! > backend.pid # 8. Wait for backend to be healthy (up to 60 seconds) for i in {1..60}; do if curl -s http://localhost:${BACKEND_PORT}/${HEALTH_ENDPOINT} | grep -q "ok\|healthy\|UP"; then echo "Backend healthy on port ${BACKEND_PORT}" break fi sleep 1 done } ``` The values are obtained from auto-discovery or a repository-provided `forge.config.yaml`, which supports fields such as `buildCommand`, `migrationCommand`, and `runCommand`. ### Technical Analysis The skill treats command strings supplied by project configuration as executable shell syntax. Variables such as `BUILD_COMMAND`, `MIGRATION_COMMAND`, `RUN_COMMAND`, and `BACKEND_DIR` are interpolated directly into a shell script without an executable allowlist, structured argument separation, escaping, validation, sandboxing, or user confirmation. A malicious repository can therefore place shell metacharacters, command substitutions, redirections, pipelines, or additional commands in these fields. Even a quoted implementation would remain unsafe if it ultimately evaluates the value as a shell command rather than treating the executable and each argument as separate data. This behavior occurs in the mandatory backend set ...[truncated 1728 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (45)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill starts backend services, copies environment files, runs migrations, and seeds test data against a real backend without a strong up-front user warning. In the wrong environment, this can alter databases, consume secrets from local env files, or affect non-test systems if discovery/config points to them.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

Automatically copying .env.example to .env and then building/running the backend can activate credentials, service endpoints, or security-sensitive configuration without user review. In many repos, .env may influence database targets, third-party integrations, or test keys, causing accidental credential use or environment confusion.

Content

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

md
cd ${BACKEND_DIR}

  # 4. Ensure environment is configured
  cp .env.example .env 2>/dev/null || true

  # 5. Build the backend
  ${BUILD_COMMAND}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The changelog documents an agent that can apply fixes and create commits automatically, but it does not warn users that invoking the skill may modify repository contents. In an autonomous coding skill, silent write/commit behavior can cause unintended code changes, branch contamination, or accidental persistence of flawed or unsafe edits, especially when users may assume analysis-only behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented confidence-tiered fix system allows some fixes to be auto-applied immediately, which creates a direct path for autonomous source modification without clear consent or review safeguards. In this skill context, that is more dangerous because the system is explicitly designed for repeated autonomous fix loops, increasing the chance of widespread unintended changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README prominently describes an autonomous system that can fix and commit code continuously, but it does not warn users up front that invoking the skill may modify source files and create commits automatically. In an agentic coding context, missing disclosure materially increases the chance of unintended repository modification, especially when users may treat a README quick start as safe to run verbatim.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The quick start and invocation sections advertise autonomous and chaos modes without any caution that these modes may change code, execute broad test suites, seed data, or intentionally inject failures. Because users are encouraged to run concise commands directly, the lack of warnings is dangerous in this skill context: it increases the risk of accidental service disruption, destructive test activity, or unintended code changes across multiple contexts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The architecture diagram includes an automatic Commit step as part of the core loop, yet there is no adjacent warning that version-control history may be altered without careful user review. In a tool positioned as autonomous and continuous, undocumented auto-commit behavior can lead to irreversible or hard-to-audit changes being recorded and propagated unintentionally.

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.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Starting the backend with nohup ... & and persisting a PID/background log creates a long-lived process outside the immediate task lifecycle. That can leave services running unintentionally, preserve access to test endpoints, or keep sensitive logs on disk after the analysis run completes.

Content

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

md
${MIGRATION_COMMAND}

  # 7. Start backend (background)
  nohup ${RUN_COMMAND} > backend.log 2>&1 &
  echo $! > backend.pid

  # 8. Wait for backend to be healthy (up to 60 seconds)

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The skill repeatedly invokes npx @claude-flow/cli@latest, which fetches and executes the latest remote package version at runtime. That creates a supply-chain execution path where a compromised upstream package or malicious update can run arbitrary code during testing, memory storage, hooks, training, or orchestration.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

The test-data seeding step transmits arbitrary ${SEED_PAYLOAD} to a live backend endpoint using real authentication headers. In context this is intended functionality, but it is still dangerous because the skill can send state-changing requests to whatever backend configuration resolves, potentially impacting real data or leaking sensitive fixtures.

Content

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

bash
# Seed test data through REAL API — adapt to your project's seeding endpoint
curl -X POST http://localhost:${BACKEND_PORT}/${SEED_ENDPOINT} \
  -H "Content-Type: application/json" \
  -H "${TEST_AUTH_HEADER}" \
  -d '${SEED_PAYLOAD}'

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

This npx @claude-flow/cli@latest swarm init command executes an unpinned remote package at runtime. Because it initializes agent orchestration, compromise of the package could immediately lead to arbitrary command execution and broad repository impact.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

This unpinned npx @claude-flow/cli@latest memory search call allows remote code execution through package resolution each time the skill searches stored patterns. The repeated use increases attack surface because many workflow phases depend on that package.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The skill uses npx @claude-flow/cli@latest memory retrieve, again executing a mutable external package at runtime. A malicious release could exfiltrate repository data, tamper with memory results, or alter later autonomous decisions.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

This unpinned CLI invocation for loading confidence tiers creates the same supply-chain execution risk as the other @latest commands. Because the result influences auto-apply fix behavior, compromise could steer subsequent code modifications.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The skill fetches @claude-flow/cli@latest to search defect predictions, allowing mutable upstream code execution in a high-trust path. An attacker controlling that package could bias test order, manipulate analysis data, or run arbitrary commands.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The spec verifier stores results using npx @claude-flow/cli@latest memory store, which executes unpinned remote code from inside an autonomous agent. Since this occurs in the background and stores workflow state, a compromised CLI could silently tamper with downstream decisions or leak data.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
CONSTRAINTS:
    - NEVER generate specs for code you haven't read
    - NEVER assume UI elements exist without checking implementation
    - NEVER create scenarios that duplicate existing coverage
    - NEVER modify existing test files — only spec files

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

This unpinned memory search invocation inside Test Runner exposes test execution to supply-chain compromise. Because it precedes parsing and storing failures, malicious code could falsify results or access test artifacts.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The Test Runner stores parsed results via npx @claude-flow/cli@latest memory store, creating another remote execution point in a trusted automation flow. Attackers could alter stored failures to induce unsafe fixes or hide malicious behavior.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The Failure Analyzer uses an unpinned external CLI to search fix patterns, which could let compromised upstream code influence root-cause analysis and recommended changes. This is especially dangerous because it directly feeds an autonomous code-fixing agent.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

This memory store command relies on npx @claude-flow/cli@latest during failure analysis, preserving the same runtime supply-chain risk. It also enables tampering with analysis artifacts that determine what files get changed.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The Bug Fixer stores fix patterns through an unpinned remote CLI, creating a path for arbitrary code execution in the most privileged phase: code modification. A compromised package could inject malicious edits while appearing to be part of normal repair automation.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
ACCEPTANCE:
    - Every applied fix has a targeted test re-run result
    - Zero fixes without verification
    - Fix pattern stored with initial confidence score
    - Cascade impacts identified and flagged for re-testing`,
  subagent_type: "coder",

Static analysis

No suspicious patterns detected.