Vulnerabilities in pkg:npm/agentic-flow

PACKAGE
Advisory Summary

GHSA-vcv2-r9jh-99m5 is a HIGH (CVSS 8.8) os command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Agentic-Flow libraries in the npm ecosystem. The issue involves os command injection in agentic-flow mcp server tools via unsanitized tool-parameter interpolation into execsync. Remediation is available by upgrading affected packages to version 2.0.14.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/agentic-flow

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/agentic-flow. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vcv2-r9jh-99m5 - HIGH Agentic-Flow: OS Command Injection in agentic-flow MCP server tools via unsanitized tool-parameter interpolation into execSync

GHSA-vcv2-r9jh-99m5 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vcv2-r9jh-99m5
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Agentic-Flow
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-vcv2-r9jh-99m5

To remediate this vulnerability, upgrade all affected Agentic-Flow dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

agentic-flow fixed: 2.0.14
npm install agentic-flow@2.0.14
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls agentic-flow

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-vcv2-r9jh-99m5, inspect your project dependencies using npm:

npm ls agentic-flow

Analyze the terminal output to locate any version of Agentic-Flow in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.14), your application is affected.

Note: The npm ls agentic-flow command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Agentic-Flow, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary `agentic-flow` versions `<= 2.0.13` MCP server tools interpolated attacker-influenceable tool parameters (e.g. `agent`, `task`, `name`, `language`, `agentdb` arguments) directly into shell command strings passed to `execSync()`. A malicious value reaching any of the affected MCP tools could break out of the surrounding double-quoted argument and execute arbitrary OS commands with the privileges of the user running the MCP server. This was a partial-fix gap: prior commit `6a06854` (#158) fixed CWE-78 elsewhere in the project but missed the MCP server files entirely. ## Impact Any MCP tool argument that the AI agent treats as data but the implementation interpolates into a shell command string becomes a command-injection vector. In MCP deployments where untrusted content (web pages, files, third-party tool output) is processed by the agent, this is reachable without direct attacker access to the host. The HTTP/SSE transports (`http-sse.ts`, `http-streaming-updated.ts`) expose the same sinks without authentication or Origin/Host validation, which may raise the effective severity in any deployment that binds them to a reachable network interface. ## Affected components - `src/mcp/standalone-stdio.ts` — `agentic_flow_agent`, `agentic_flow_create_agent`, `agentic_flow_list_all_agents`, `agentic_flow_agent_info`, `agentic_flow_check_conflicts`, `agentic_flow_optimize_model`, `agentic_flow_list_agents`, `agent_booster_edit_file`, `agent_booster_batch_edit`, `agent_booster_parse_markdown`, `agentdb_stats`, `agentdb_pattern_store`, `agentdb_pattern_search`, `agentdb_pattern_stats` - `src/mcp/fastmcp/servers/claude-flow-sdk.ts` - `src/mcp/fastmcp/servers/stdio-full.ts` - `src/mcp/fastmcp/servers/http-streaming-updated.ts` - `src/mcp/fastmcp/servers/http-sse.ts` - `src/mcp/fastmcp/servers/poc-stdio.ts` - `src/mcp/fastmcp/tools/agent/{execute,list,parallel}.ts` - `src/mcp/fastmcp/tools/swarm/orchestrate.ts` - `src/mcp/fastmcp/tools/hooks/pretrain.ts` (depth path only) ## Proof of Concept ```ts // Pre-fix (standalone-stdio.ts, agentic_flow_agent) let cmd = `npx --yes agentic-flow --agent "${agent}" --task "${task}"`; const result = execSync(cmd, { encoding: 'utf-8', ... }); ``` Invoking the MCP tool with: ```json { "agent": "coder", "task": "x\"; touch /tmp/INJECTED; id > /tmp/rce.txt; echo \"" } ``` produces, after interpolation: ``` npx --yes agentic-flow --agent "coder" --task "x"; touch /tmp/INJECTED; id > /tmp/rce.txt; echo "" ``` When `execSync` hands that to `/bin/sh -c`, the shell parses three commands: the truncated `npx`, then `touch /tmp/INJECTED`, then `id > /tmp/rce.txt; echo ""`. The marker file `/tmp/INJECTED` is created and the user's `id` output is written to `/tmp/rce.txt`. ## Patches Fixed in [`agentic-flow@2.0.14`](https://www.npmjs.com/package/agentic-flow/v/2.0.14) — every affected call site rewritten to use `execFileSync(file, argv, { shell: false })` so attacker-controlled argv elements are passed straight to `execve(2)` without shell parsing. Fix PR: ruvnet/agentic-flow#170 (merged at `0c2ec96`) A regression test (`tests/security/cwe-78-mcp-execsync.test.ts`) was added that statically scans every `src/mcp/**/*.ts` file and fails the build if any new `execSync()` call is reintroduced outside of a documented exemption, plus a behavioural smoke check that the canonical PoC payload remains inert when passed as an argv element to `execFileSync`. ## Workarounds Upgrade to `agentic-flow >= 2.0.14`. There is no in-product configuration that mitigates this without upgrading. ## Downstream pin The `ruflo` / `claude-flow` / `@claude-flow/cli` packages bumped from `3.12.3` → `3.12.4` to pull the patched `agentic-flow`: - `ruflo@3.12.4` - `claude-flow@3.12.4` - `@claude-flow/cli@3.12.4` End users running any of `npx ruflo@latest`, `npx claude-flow@latest`, or `npx @claude-flow/cli@latest` are pinned to the fixed version. ## Credit Reported by **hackchang** via a well-scoped red-team report package (`npm_agentic-flow_report_package_20260618_163017.zip`) that included a sink inventory, a minimized PoC payload, and a clear explanation of why this was a partial-fix gap rather than intended behaviour. The sink inventory directly drove the single-grep pass that closed every reachable call site; the PoC payload became the behavioural smoke test that proves the canonical attack stays inert as an argv element.

GHSA-vcv2-r9jh-99m5 Affected Agentic-Flow Versions

1 component(s)
Fixed Versions:
2.0.14
Product / Package Ecosystem Affected Versions Fixed Version
agentic-flow
npm
< 2.0.14
2.0.14

References

Frequently Asked Questions

What is GHSA-vcv2-r9jh-99m5?
GHSA-vcv2-r9jh-99m5 is a security vulnerability in Agentic-Flow involving OS Command Injection in agentic-flow MCP server tools via unsanitized tool-parameter interpolation into execSync under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Agentic-Flow versions are affected?
Affected versions include releases prior to 2.0.14 across affected packages: agentic-flow.
What version fixes GHSA-vcv2-r9jh-99m5?
Upgrading to 2.0.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is agentic-flow affected?
Yes, agentic-flow is affected in releases prior to 2.0.14. Upgrade your dependency to 2.0.14 or later.
What is the CVSS score of GHSA-vcv2-r9jh-99m5?
GHSA-vcv2-r9jh-99m5 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-vcv2-r9jh-99m5?
GHSA-vcv2-r9jh-99m5 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for GHSA-vcv2-r9jh-99m5?
Run the dependency tree command: 'npm ls agentic-flow'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vcv2-r9jh-99m5",
  "modified" : "2026-06-19T15:12:58Z",
  "published" : "2026-06-19T15:12:58Z",
  "aliases" : [ ],
  "summary" : "Agentic-Flow: OS Command Injection in agentic-flow MCP server tools via unsanitized tool-parameter interpolation into execSync",
  "details" : "## Summary\n\n`agentic-flow` versions `<= 2.0.13` MCP server tools interpolated attacker-influenceable tool parameters (e.g. `agent`, `task`, `name`, `language`, `agentdb` arguments) directly into shell command strings passed to `execSync()`. A malicious value reaching any of the affected MCP tools could break out of the surrounding double-quoted argument and execute arbitrary OS commands with the privileges of the user running the MCP server.\n\nThis was a partial-fix gap: prior commit `6a06854` (#158) fixed CWE-78 elsewhere in the project but missed the MCP server files entirely.\n\n## Impact\n\nAny MCP tool argument that the AI agent treats as data but the implementation interpolates into a shell command string becomes a command-injection vector. In MCP deployments where untrusted content (web pages, files, third-party tool output) is processed by the agent, this is reachable without direct attacker access to the host. The HTTP/SSE transports (`http-sse.ts`, `http-streaming-updated.ts`) expose the same sinks without authentication or Origin/Host validation, which may raise the effective severity in any deployment that binds them to a reachable network interface.\n\n## Affected components\n\n- `src/mcp/standalone-stdio.ts` — `agentic_flow_agent`, `agentic_flow_create_agent`, `agentic_flow_list_all_agents`, `agentic_flow_agent_info`, `agentic_flow_check_conflicts`, `agentic_flow_optimize_model`, `agentic_flow_list_agents`, `agent_booster_edit_file`, `agent_booster_batch_edit`, `agent_booster_parse_markdown`, `agentdb_stats`, `agentdb_pattern_store`, `agentdb_pattern_search`, `agentdb_pattern_stats`\n- `src/mcp/fastmcp/servers/claude-flow-sdk.ts`\n- `src/mcp/fastmcp/servers/stdio-full.ts`\n- `src/mcp/fastmcp/servers/http-streaming-updated.ts`\n- `src/mcp/fastmcp/servers/http-sse.ts`\n- `src/mcp/fastmcp/servers/poc-stdio.ts`\n- `src/mcp/fastmcp/tools/agent/{execute,list,parallel}.ts`\n- `src/mcp/fastmcp/tools/swarm/orchestrate.ts`\n- `src/mcp/fastmcp/tools/hooks/pretrain.ts` (depth path only)\n\n## Proof of Concept\n\n```ts\n// Pre-fix (standalone-stdio.ts, agentic_flow_agent)\nlet cmd = `npx --yes agentic-flow --agent \"${agent}\" --task \"${task}\"`;\nconst result = execSync(cmd, { encoding: 'utf-8', ... });\n```\n\nInvoking the MCP tool with:\n\n```json\n{\n  \"agent\": \"coder\",\n  \"task\": \"x\\\"; touch /tmp/INJECTED; id > /tmp/rce.txt; echo \\\"\"\n}\n```\n\nproduces, after interpolation:\n\n```\nnpx --yes agentic-flow --agent \"coder\" --task \"x\"; touch /tmp/INJECTED; id > /tmp/rce.txt; echo \"\"\n```\n\nWhen `execSync` hands that to `/bin/sh -c`, the shell parses three commands: the truncated `npx`, then `touch /tmp/INJECTED`, then `id > /tmp/rce.txt; echo \"\"`. The marker file `/tmp/INJECTED` is created and the user's `id` output is written to `/tmp/rce.txt`.\n\n## Patches\n\nFixed in [`agentic-flow@2.0.14`](https://www.npmjs.com/package/agentic-flow/v/2.0.14) — every affected call site rewritten to use `execFileSync(file, argv, { shell: false })` so attacker-controlled argv elements are passed straight to `execve(2)` without shell parsing.\n\nFix PR: ruvnet/agentic-flow#170 (merged at `0c2ec96`)\n\nA regression test (`tests/security/cwe-78-mcp-execsync.test.ts`) was added that statically scans every `src/mcp/**/*.ts` file and fails the build if any new `execSync()` call is reintroduced outside of a documented exemption, plus a behavioural smoke check that the canonical PoC payload remains inert when passed as an argv element to `execFileSync`.\n\n## Workarounds\n\nUpgrade to `agentic-flow >= 2.0.14`. There is no in-product configuration that mitigates this without upgrading.\n\n## Downstream pin\n\nThe `ruflo` / `claude-flow` / `@claude-flow/cli` packages bumped from `3.12.3` → `3.12.4` to pull the patched `agentic-flow`:\n\n- `ruflo@3.12.4`\n- `claude-flow@3.12.4`\n- `@claude-flow/cli@3.12.4`\n\nEnd users running any of `npx ruflo@latest`, `npx claude-flow@latest`, or `npx @claude-flow/cli@latest` are pinned to the fixed version.\n\n## Credit\n\nReported by **hackchang** via a well-scoped red-team report package (`npm_agentic-flow_report_package_20260618_163017.zip`) that included a sink inventory, a minimized PoC payload, and a clear explanation of why this was a partial-fix gap rather than intended behaviour. The sink inventory directly drove the single-grep pass that closed every reachable call site; the PoC payload became the behavioural smoke test that proves the canonical attack stays inert as an argv element.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "agentic-flow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.14"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.13"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ruvnet/agentic-flow/security/advisories/GHSA-vcv2-r9jh-99m5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruvnet/agentic-flow/issues/169"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruvnet/ruflo/issues/2414"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruvnet/agentic-flow/pull/170"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruvnet/ruflo/pull/2415"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruvnet/agentic-flow"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruvnet/ruflo/releases/tag/v3.12.4"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/agentic-flow/v/2.0.14"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-19T15:12:58Z",
    "nvd_published_at" : null
  }
}