GitHub Advisoryadvisory · npm
GHSA-vcv2-r9jh-99m5 Agentic-Flow: OS Command Injection in agentic-flow MCP server tools via unsanitized tool-parameter interpolation into execSync
HIGH
Official page ↗
- Ecosystem
- npm
- Packages
- agentic-flow
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-78
- Reviewed
- 2026-06-19
Affected packages
• npm agentic-flow: < 2.0.14 → fixed in 2.0.14
Description
Summary
`agentic-flow` versions ` /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 `[email protected]` — 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`:
• `[email protected]`
• `[email protected]`
• `@claude-flow/[email protected]`
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.
Related
Weakness · CWE (1)
- CWE-78 Improper Neutralization of Special Elements used in an OS Command weakness
References
- https://github.com/ruvnet/agentic-flow/security/advisories/GHSA-vcv2-r9jh-99m5 web
- https://github.com/ruvnet/agentic-flow/issues/169 web
- https://github.com/ruvnet/ruflo/issues/2414 web
- https://github.com/ruvnet/agentic-flow/pull/170 web
- https://github.com/ruvnet/ruflo/pull/2415 web
- https://github.com/ruvnet/agentic-flow package
- https://github.com/ruvnet/ruflo/releases/tag/v3.12.4 web
- https://www.npmjs.com/package/agentic-flow/v/2.0.14 web