mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-25 22:53:17 +09:00
* fix(security): patch CVEs, shell injection, SSRF in ruflo
CWE-78 Shell Injection (9 execSync → execFileSync conversions):
- .claude/helpers/github-safe.js: replace execSync(`gh ${args.join(' ')}`)
with execFileSync('gh', args) in no-body and non-body code paths; the
body-with-file path already used a tempfile but still joined args into
a shell string for the final gh invocation.
- v3/@claude-flow/cli/.claude/helpers/github-safe.js: same fix (init-
template copy mirrors the dogfood helper).
- v3/@claude-flow/mcp/.claude/helpers/github-safe.js: older variant
without body-cap; apply execFileSync throughout.
- scripts/audit-supply-chain.mjs: execSync(`npm view "${name}"`) →
execFileSync('npm', ['view', name, ...]) so a malicious package name
in the allowlist JSON cannot inject shell commands.
- scripts/track-clones.mjs: execSync(`gh api repos/${repo}/...`) →
execFileSync('gh', ['api', `repos/${repo}/...`]).
- plugins/ruflo-core/scripts/witness/perf.mjs: six execSync calls in
benchmark runners (git rev-parse, pnpm pack ×2, npm init, npm pkg
set, npm install <tarball>, node verify.mjs) converted to
execFileSync with split argv arrays.
- v3/@claude-flow/browser/tests/e2e/browser-e2e.test.ts: execSync with
template-literal command string replaced by execFileSync with a
split-on-whitespace argv array.
CWE-918 SSRF (2 callCloudFunction guards):
- ruflo/src/mcp-bridge/index.js: add assertSafeUrl() before every
callCloudFunction call — rejects non-HTTPS schemes and private/
loopback IP ranges (10.x, 172.16-31.x, 192.168.x, 127.x, ::1,
fc/fd ULA, localhost, *.local).
- ruflo/src/ruvocal/mcp-bridge/index.js: identical guard applied to
the ruvocal variant of callCloudFunction.
npm audit: 0 vulnerabilities (package.json overrides already cover all
known CVEs; confirmed clean on this audit run).
All 10 github-safe injection smoke tests pass. No new test file failures
introduced vs pre-patch baseline (verified via vitest diff).
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix(supply-chain): use execFileSync instead of undefined execSync in runCveAudit
The import on line 35 only brought in `execFileSync` from `node:child_process`,
but `runCveAudit` called the never-imported `execSync`, causing a ReferenceError
on every audit run and reporting 2 spurious CVE findings (one per audited package).
Replace `execSync('npm audit ...')` with `execFileSync('npm', [...args])` to
match the already-correct pattern used in `runPublisherTrustAudit` (line 303).
This also provides the CWE-78 shell-injection mitigation already documented in
that function's comment.
Full audit now exits 0: 0 CVE, 0 lockfile, 0 allowlist, 0 typosquat findings.
Co-Authored-By: claude-flow <ruv@ruv.net>
ruflo-core
Foundation plugin. Registers the ruflo MCP server (300+ tools), provides three generalist agents (coder, researcher, reviewer), three first-run helpers (init-project, ruflo-doctor, discover-plugins), and a curated catalog covering all 30+ sibling plugins.
Install
/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-core@ruflo
What's Included
- MCP Server: 300+ tools via
@claude-flow/cli(memory, agentdb, embeddings, hooks, neural, autopilot, browser, aidefence, agent, swarm, system, terminal, github, daa, coordination, performance, workflow, …) - CLI Commands: 26 commands with 140+ subcommands for agent orchestration
- 3-Tier Model Routing: Agent Booster (WASM), Haiku, Sonnet/Opus with automatic cost optimization
- Session Management: Persistent sessions with cross-conversation learning
- Hooks: PreToolUse / PostToolUse / PreCompact / Stop wired to claude-flow's auto-routing + learning loop. Defined at
plugins/ruflo-core/hooks/hooks.jsonso the per-plugin loader picks them up on/plugin install ruflo-core@ruflo(per-plugin layout — fixes #1748 Issue 1; the marketplace-root copy at.claude-plugin/hooks/hooks.jsonis preserved forclaude --plugin-dir <repo-root>users).
Configuration
The MCP server starts automatically when this plugin is active. Override environment variables in .mcp.json as needed.
Compatibility
- CLI: pinned to
@claude-flow/cliv3.6 major+minor. The.mcp.jsoninvocation uses@latestfor dynamic resolution; the smoke contract verifies the resolved CLI matches the v3.6 line. - Verification:
bash plugins/ruflo-core/scripts/smoke.shis the contract.
MCP server contract
The registered ruflo MCP server exposes 300+ tools across these families. Runtime truth is mcp tool call mcp_status:
| Family | Notable tools | Plugin documenting it |
|---|---|---|
memory_* |
memory_store, _search, _search_unified, _import_claude, _bridge_status |
ruflo-rag-memory |
agentdb_* |
15 tools for hierarchical / pattern / causal storage | ruflo-agentdb |
embeddings_* |
10 tools incl. RaBitQ 32× quantization | ruflo-agentdb, ruflo-ruvector |
hooks_* (incl. hooks_intelligence_*) |
19+ tools — routing, learning, transfer, metrics, explain | ruflo-intelligence, ruflo-autopilot |
aidefence_* |
6 tools — PII / prompt-injection / sanitization | ruflo-aidefence |
neural_* |
6 tools — train, predict, patterns, compress | ruflo-intelligence |
autopilot_* |
10 tools — autonomous loops + learning | ruflo-autopilot |
browser_* (+ new browser_session_*) |
23 + 5 = 28 tools — Playwright + RVF lifecycle | ruflo-browser |
ruvllm_sona_* / ruvllm_microlora_* |
4 tools — adaptive learning | ruflo-intelligence, ruflo-ruvllm |
agent_*, swarm_* |
spawn, list, status, orchestrate | ruflo-swarm |
system_*, terminal_* |
system + terminal session ops | this plugin |
For every other plugin's tool surface, see its docs/adrs/0001-*.md.
Sibling contracts
This foundation plugin defers to seven sibling ADRs that own specific cross-cutting contracts. New plugins (and consumers of ruflo-core) should reference these instead of re-deriving:
| Contract | Owner |
|---|---|
| Pinning + smoke as contract (general pattern) | ruflo-ruvector ADR-0001 |
Namespace convention (<plugin-stem>-<intent>, reserved namespaces) |
ruflo-agentdb ADR-0001 |
| Session-as-skill architecture (RVF + trajectory + 3 AIDefence gates) | ruflo-browser ADR-0001 |
| 4-step intelligence pipeline (RETRIEVE → JUDGE → DISTILL → CONSOLIDATE) | ruflo-intelligence ADR-0001 |
| 3-gate AIDefence pattern (PII pre-storage, sanitization, prompt-injection) | ruflo-aidefence ADR-0001 |
| 270s cache-aware /loop heartbeat | ruflo-autopilot ADR-0001 |
| ADR plugin contract (token-optimization via REFERENCE.md) | ruflo-adr ADR-0001 |
Verification
bash plugins/ruflo-core/scripts/smoke.sh
# Expected: "10 passed, 0 failed"