@claude-flow/cli 3.38.20 → 3.38.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/helpers.manifest.json +3 -3
- package/.claude/helpers/hook-handler.cjs +17 -6
- package/catalog-manifest.json +4 -4
- package/dist/src/commands/memory.js +4 -0
- package/dist/src/commands/proxy-lifecycle.js +6 -5
- package/dist/src/mcp-tools/memory-tools.js +4 -0
- package/dist/src/memory/memory-initializer.d.ts +5 -0
- package/dist/src/memory/memory-initializer.js +37 -12
- package/dist/src/proxy/activation.d.ts +14 -0
- package/dist/src/proxy/activation.js +210 -0
- package/dist/src/proxy/install.js +3 -0
- package/dist/src/proxy/paths.d.ts +2 -0
- package/dist/src/proxy/paths.js +4 -0
- package/dist/src/ruvector/enhanced-model-router.js +25 -14
- package/node_modules/@claude-flow/codex/dist/cli.js +0 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +0 -0
- package/node_modules/@claude-flow/security/dist/input-validator.d.ts +6 -6
- package/package.json +1 -1
- package/dist/src/ruvector/lattice-wasm.d.ts +0 -14
- package/dist/src/ruvector/lattice-wasm.js +0 -144
- package/plugins/ruflo-metaharness/.claude-flow/daemon-state.json +0 -178
- package/plugins/ruflo-metaharness/.claude-flow/daemon.pid +0 -1
- package/plugins/ruflo-metaharness/.claude-flow/data/pending-insights.jsonl +0 -5
- package/plugins/ruflo-metaharness/.claude-flow/logs/daemon.log +0 -269
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783604774864_ozbujc_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783604774864_ozbujc_result.log +0 -108
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783605513587_ulvmpb_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783605513587_ulvmpb_result.log +0 -209
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783606368867_ahysui_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783606368867_ahysui_result.log +0 -192
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783607120257_lh05rb_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783607120257_lh05rb_result.log +0 -13
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608020362_j3096j_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608020362_j3096j_result.log +0 -120
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608776347_261b61_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608776347_261b61_result.log +0 -85
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783609621359_s5i6ye_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783609621359_s5i6ye_result.log +0 -13
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610087998_qihv9v_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610087998_qihv9v_result.log +0 -17
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610773920_qlzmxo_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610773920_qlzmxo_result.log +0 -17
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783611376090_xpqf1z_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783611376090_xpqf1z_result.log +0 -16
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612097184_9rqfor_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612097184_9rqfor_result.log +0 -138
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612811574_4u602j_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612811574_4u602j_result.log +0 -16
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783613750487_a46ttn_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783613750487_a46ttn_result.log +0 -107
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783614289360_figwc0_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783614289360_figwc0_result.log +0 -200
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615067640_l7tm6a_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615067640_l7tm6a_result.log +0 -54
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615825308_44nor5_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615825308_44nor5_result.log +0 -85
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_result.log +0 -266
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783617323039_fs3x5a_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783617323039_fs3x5a_result.log +0 -56
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618049184_1f4yah_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618049184_1f4yah_result.log +0 -96
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618793925_4ee7tf_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618793925_4ee7tf_result.log +0 -481
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783619642574_yjr4mm_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783619642574_yjr4mm_result.log +0 -104
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783620392771_oduto0_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783620392771_oduto0_result.log +0 -148
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621183670_gd0p1x_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621183670_gd0p1x_result.log +0 -111
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621738388_z4k48b_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621738388_z4k48b_result.log +0 -89
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783622493677_zwc35w_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783622493677_zwc35w_result.log +0 -207
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783604894861_v6n3ut_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783604894861_v6n3ut_result.log +0 -66
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783605934532_9h8ikb_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783605934532_9h8ikb_result.log +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783607181736_t12f4y_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783607181736_t12f4y_result.log +0 -78
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783608341266_zhk0fl_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783608341266_zhk0fl_result.log +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783609420180_7xw817_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783609420180_7xw817_result.log +0 -72
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783610535307_2pxofp_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783610535307_2pxofp_result.log +0 -17
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783611437445_ofwnpb_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783611437445_ofwnpb_result.log +0 -60
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783612556827_1cb112_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783612556827_1cb112_result.log +0 -56
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783613579531_18xiax_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783613579531_18xiax_result.log +0 -74
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783614650481_2zdz7w_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783614650481_2zdz7w_result.log +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783615742328_rjj69d_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783615742328_rjj69d_result.log +0 -65
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783616767230_1iad99_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783616767230_1iad99_result.log +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783617783537_rqagku_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783617783537_rqagku_result.log +0 -56
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783618817343_r1lbhr_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783618817343_r1lbhr_result.log +0 -65
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783619907773_8msfw3_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783619907773_8msfw3_result.log +0 -77
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783621009302_hybdum_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783621009302_hybdum_result.log +0 -64
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783622083681_nznpnx_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783622083681_nznpnx_result.log +0 -56
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783623208340_olsbaw_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783605134860_9jssz9_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783605134860_9jssz9_result.log +0 -69
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783606516743_zftbaa_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783606516743_zftbaa_result.log +0 -92
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783608038317_jrd66e_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783608038317_jrd66e_result.log +0 -92
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783609388416_mc3zoe_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783609388416_mc3zoe_result.log +0 -82
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783610821384_tzqvlb_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783610821384_tzqvlb_result.log +0 -17
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783612023285_buygpo_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783612023285_buygpo_result.log +0 -57
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783613599301_6f78cw_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783613599301_6f78cw_result.log +0 -60
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783615000844_v95ues_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783615000844_v95ues_result.log +0 -69
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783616341693_bl5d9o_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783616341693_bl5d9o_result.log +0 -64
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783617832831_ha6s8d_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783617832831_ha6s8d_result.log +0 -42
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783619384959_s5iiwf_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783619384959_s5iiwf_result.log +0 -47
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783620946263_d7ovai_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783620946263_d7ovai_result.log +0 -52
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783622473846_t839e5_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783622473846_t839e5_result.log +0 -96
- package/plugins/ruflo-metaharness/.claude-flow/metrics/backup.json +0 -7
- package/plugins/ruflo-metaharness/.claude-flow/metrics/codebase-map.json +0 -11
- package/plugins/ruflo-metaharness/.claude-flow/metrics/consolidation.json +0 -16
- package/plugins/ruflo-metaharness/.claude-flow/metrics/harness-loop.json +0 -83
- package/plugins/ruflo-metaharness/.claude-flow/metrics/performance.json +0 -55
- package/plugins/ruflo-metaharness/.claude-flow/metrics/security-audit.json +0 -206
- package/plugins/ruflo-metaharness/.claude-flow/metrics/test-gaps.json +0 -95
- package/plugins/ruflo-metaharness/.claude-flow/neural/stats.json +0 -6
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615825308_44nor5_result.log
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
[2026-07-09T16:52:04.760Z] RESULT
|
|
2
|
-
============================================================
|
|
3
|
-
{
|
|
4
|
-
"success": true,
|
|
5
|
-
"output": "Based on my comprehensive analysis of the ruflo-metaharness plugin codebase, here's the security vulnerability report:\n\n```json\n{\n \"vulnerabilities\": [\n {\n \"severity\": \"high\",\n \"file\": \"scripts/_harness.mjs\",\n \"line\": 198,\n \"description\": \"Shell parameter conditionally enabled on Windows platform. Line 198: 'shell: process.platform === \\\"win32\\\"' enables shell interpretation of arguments on Windows, increasing risk of command injection if arguments are not properly escaped.\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"scripts/_redblue.mjs\",\n \"line\": 110,\n \"description\": \"Environment variable inheritance from parent process allows credential leakage. Line 109-110: 'env: { ...process.env, ...(opts.env || {}) }' forwards all parent environment variables including potentially sensitive API keys (OPENROUTER_API_KEY, AWS credentials, etc.).\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/_invoke.mjs\",\n \"line\": 89,\n \"description\": \"Process environment variable controls cache location without validation. Line 89: 'process.env.RUFLO_METAHARNESS_CACHE_BASE' allows users to redirect cache to arbitrary locations including /tmp or world-writable directories.\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/mint.mjs\",\n \"line\": 47,\n \"description\": \"Temporary directory uses predictable timestamp-based naming. Line 47: 'tmpdir(), `ruflo-mint-${Date.now()}-${ARGS.name}`' can be race-conditioned by attackers to create symlinks or hijack directories.\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/redblue.mjs\",\n \"line\": 217,\n \"description\": \"User-controlled output file path written without sufficient validation. The 'resolve(ARGS.out)' call lacks validation against path traversal (../ sequences) or overwriting critical files.\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/_invoke.mjs\",\n \"line\": 76,\n \"description\": \"JSON parsing from untrusted subprocess output without size limit. parseTrailingJson() greedily parses JSON blocks without limiting object size, vulnerable to DoS attacks with large JSON payloads.\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/learn.mjs\",\n \"line\": 84,\n \"description\": \"User-provided METAHARNESS_REPO forwarded to subprocess with insufficient validation. The repo path is checked for existence but not validated against symlinks or escape sequences.\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/evolve.mjs\",\n \"line\": 114,\n \"description\": \"Weak input validation on numeric parameters. generations/children/concurrency are validated for ranges but lack explicit non-numeric input handling (though parseInt() handles gracefully).\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/_invoke.mjs\",\n \"line\": 172,\n \"description\": \"Package version string directly interpolated in npm command. Line 172: '`${pkg}@${pinVersion}`' - while pinVersion is hardcoded, this pattern could be unsafe if ever parameterized.\"\n }\n ],\n \"riskScore\": 48,\n \"recommendations\": [\n \"Set shell: false consistently across ALL platforms - remove Windows-specific shell: true conditions in _harness.mjs:198, _redblue.mjs:110, _darwin.mjs:85. Shell interpretation increases attack surface unnecessarily.\",\n \"Implement environment variable filtering - create a whitelist of ONLY safe variables (PATH, HOME) to forward to subprocesses. Never forward API keys, tokens, or AWS_* variables. Use: env: { PATH: process.env.PATH, HOME: process.env.HOME }\",\n \"Validate and restrict cache directory location - add checks ensuring RUFLO_METAHARNESS_CACHE_BASE is not /tmp, /var/tmp, or world-writable. Restrict to ~/.ruflo or explicitly allowed directories only.\",\n \"Use cryptographically secure temporary directory names - replace Date.now() with crypto.randomBytes(8).toString('hex'). Or better: use the 'tmp' npm package with secure options (mode: 0o700).\",\n \"Add path traversal validation for output files - normalize paths, verify they don't escape intended directories, and reject paths containing '..' or absolute paths outside home directory.\",\n \"Add size/depth limits to JSON parsing - modify parseTrailingJson() to fail safely if JSON exceeds 10MB or nesting depth > 50. Wrap in try-catch with timeout.\",\n \"Validate symlink-safety for METAHARNESS_REPO - add realpath() consistency checks in learn.mjs:84. Verify paths don't contain symlinks pointing outside intended boundaries.\",\n \"Add explicit numeric input validation - validate parseInt() results are within expected ranges BEFORE use. Add guard: if (isNaN(value)) throw new Error('...')\",\n \"Document and enforce no-shell policy in CI - add ESLint rule or grep check to detect shell: true in subprocess calls. Include rationale in code comments.\",\n \"Implement audit logging for sensitive operations - log file writes and path handling (sanitized) to stderr. Never log credentials or API keys.\",\n \"Pin npm package integrity - use npm's --save-exact and package-lock.json. Consider npm ci (clean install) instead of npm install to prevent version drift.\",\n \"Sanitize subprocess output before logging - the current truncation (lines 114, 115) is good but inadequate. Redact potential credentials (API_KEY=*****, PASSWORD=*****, etc.) from all output.\"\n ]\n}\n```\n\n## Summary\n\n**Risk Score: 48/100** — Moderate risk with several high-severity findings that could enable credential leakage and command injection on Windows platforms.\n\n**Key Issues:**\n1. **Credential Leakage (High)**: Environment variables containing API keys are blindly forwarded to subprocesses\n2. **Platform-Specific Risk (High)**: Windows platform enables shell interpretation, bypassing argument array safety\n3. **Privilege Escalation (Medium)**: Predictable temp directories and unvalidated cache locations\n4. **Injection Risks (Medium)**: Path traversal and symlink attacks are possible\n\n**Immediate Actions:**\n- Disable `shell: true` universally\n- Filter environment variables before subprocess calls\n- Validate all user-supplied paths and filenames\n- Add size limits to JSON parsing from untrusted sources\n",
|
|
6
|
-
"parsedOutput": {
|
|
7
|
-
"vulnerabilities": [
|
|
8
|
-
{
|
|
9
|
-
"severity": "high",
|
|
10
|
-
"file": "scripts/_harness.mjs",
|
|
11
|
-
"line": 198,
|
|
12
|
-
"description": "Shell parameter conditionally enabled on Windows platform. Line 198: 'shell: process.platform === \"win32\"' enables shell interpretation of arguments on Windows, increasing risk of command injection if arguments are not properly escaped."
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"severity": "high",
|
|
16
|
-
"file": "scripts/_redblue.mjs",
|
|
17
|
-
"line": 110,
|
|
18
|
-
"description": "Environment variable inheritance from parent process allows credential leakage. Line 109-110: 'env: { ...process.env, ...(opts.env || {}) }' forwards all parent environment variables including potentially sensitive API keys (OPENROUTER_API_KEY, AWS credentials, etc.)."
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"severity": "medium",
|
|
22
|
-
"file": "scripts/_invoke.mjs",
|
|
23
|
-
"line": 89,
|
|
24
|
-
"description": "Process environment variable controls cache location without validation. Line 89: 'process.env.RUFLO_METAHARNESS_CACHE_BASE' allows users to redirect cache to arbitrary locations including /tmp or world-writable directories."
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"severity": "medium",
|
|
28
|
-
"file": "scripts/mint.mjs",
|
|
29
|
-
"line": 47,
|
|
30
|
-
"description": "Temporary directory uses predictable timestamp-based naming. Line 47: 'tmpdir(), `ruflo-mint-${Date.now()}-${ARGS.name}`' can be race-conditioned by attackers to create symlinks or hijack directories."
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"severity": "medium",
|
|
34
|
-
"file": "scripts/redblue.mjs",
|
|
35
|
-
"line": 217,
|
|
36
|
-
"description": "User-controlled output file path written without sufficient validation. The 'resolve(ARGS.out)' call lacks validation against path traversal (../ sequences) or overwriting critical files."
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"severity": "medium",
|
|
40
|
-
"file": "scripts/_invoke.mjs",
|
|
41
|
-
"line": 76,
|
|
42
|
-
"description": "JSON parsing from untrusted subprocess output without size limit. parseTrailingJson() greedily parses JSON blocks without limiting object size, vulnerable to DoS attacks with large JSON payloads."
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"severity": "medium",
|
|
46
|
-
"file": "scripts/learn.mjs",
|
|
47
|
-
"line": 84,
|
|
48
|
-
"description": "User-provided METAHARNESS_REPO forwarded to subprocess with insufficient validation. The repo path is checked for existence but not validated against symlinks or escape sequences."
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"severity": "low",
|
|
52
|
-
"file": "scripts/evolve.mjs",
|
|
53
|
-
"line": 114,
|
|
54
|
-
"description": "Weak input validation on numeric parameters. generations/children/concurrency are validated for ranges but lack explicit non-numeric input handling (though parseInt() handles gracefully)."
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"severity": "low",
|
|
58
|
-
"file": "scripts/_invoke.mjs",
|
|
59
|
-
"line": 172,
|
|
60
|
-
"description": "Package version string directly interpolated in npm command. Line 172: '`${pkg}@${pinVersion}`' - while pinVersion is hardcoded, this pattern could be unsafe if ever parameterized."
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"riskScore": 48,
|
|
64
|
-
"recommendations": [
|
|
65
|
-
"Set shell: false consistently across ALL platforms - remove Windows-specific shell: true conditions in _harness.mjs:198, _redblue.mjs:110, _darwin.mjs:85. Shell interpretation increases attack surface unnecessarily.",
|
|
66
|
-
"Implement environment variable filtering - create a whitelist of ONLY safe variables (PATH, HOME) to forward to subprocesses. Never forward API keys, tokens, or AWS_* variables. Use: env: { PATH: process.env.PATH, HOME: process.env.HOME }",
|
|
67
|
-
"Validate and restrict cache directory location - add checks ensuring RUFLO_METAHARNESS_CACHE_BASE is not /tmp, /var/tmp, or world-writable. Restrict to ~/.ruflo or explicitly allowed directories only.",
|
|
68
|
-
"Use cryptographically secure temporary directory names - replace Date.now() with crypto.randomBytes(8).toString('hex'). Or better: use the 'tmp' npm package with secure options (mode: 0o700).",
|
|
69
|
-
"Add path traversal validation for output files - normalize paths, verify they don't escape intended directories, and reject paths containing '..' or absolute paths outside home directory.",
|
|
70
|
-
"Add size/depth limits to JSON parsing - modify parseTrailingJson() to fail safely if JSON exceeds 10MB or nesting depth > 50. Wrap in try-catch with timeout.",
|
|
71
|
-
"Validate symlink-safety for METAHARNESS_REPO - add realpath() consistency checks in learn.mjs:84. Verify paths don't contain symlinks pointing outside intended boundaries.",
|
|
72
|
-
"Add explicit numeric input validation - validate parseInt() results are within expected ranges BEFORE use. Add guard: if (isNaN(value)) throw new Error('...')",
|
|
73
|
-
"Document and enforce no-shell policy in CI - add ESLint rule or grep check to detect shell: true in subprocess calls. Include rationale in code comments.",
|
|
74
|
-
"Implement audit logging for sensitive operations - log file writes and path handling (sanitized) to stderr. Never log credentials or API keys.",
|
|
75
|
-
"Pin npm package integrity - use npm's --save-exact and package-lock.json. Consider npm ci (clean install) instead of npm install to prevent version drift.",
|
|
76
|
-
"Sanitize subprocess output before logging - the current truncation (lines 114, 115) is good but inadequate. Redact potential credentials (API_KEY=*****, PASSWORD=*****, etc.) from all output."
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
"durationMs": 99452,
|
|
80
|
-
"model": "haiku",
|
|
81
|
-
"sandboxMode": "strict",
|
|
82
|
-
"workerType": "audit",
|
|
83
|
-
"timestamp": "2026-07-09T16:52:04.760Z",
|
|
84
|
-
"executionId": "audit_1783615825308_44nor5"
|
|
85
|
-
}
|
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_prompt.log
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[2026-07-09T17:02:04.789Z] PROMPT
|
|
2
|
-
============================================================
|
|
3
|
-
Analyze this codebase for security vulnerabilities:
|
|
4
|
-
- Check for hardcoded secrets (API keys, passwords)
|
|
5
|
-
- Identify SQL injection risks
|
|
6
|
-
- Find XSS vulnerabilities
|
|
7
|
-
- Check for insecure dependencies
|
|
8
|
-
- Identify authentication/authorization issues
|
|
9
|
-
|
|
10
|
-
Provide a JSON report with:
|
|
11
|
-
{
|
|
12
|
-
"vulnerabilities": [{ "severity": "high|medium|low", "file": "...", "line": N, "description": "..." }],
|
|
13
|
-
"riskScore": 0-100,
|
|
14
|
-
"recommendations": ["..."]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
## Instructions
|
|
18
|
-
|
|
19
|
-
Analyze the codebase and provide your response following the format specified in the task.
|
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_result.log
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
[2026-07-09T17:05:23.031Z] RESULT
|
|
2
|
-
============================================================
|
|
3
|
-
{
|
|
4
|
-
"success": true,
|
|
5
|
-
"output": "Based on the comprehensive security analysis, here's the JSON security audit report:\n\n```json\n{\n \"vulnerabilities\": [\n {\n \"severity\": \"high\",\n \"file\": \"scripts/_harness.mjs\",\n \"line\": 142,\n \"description\": \"Environment variable credential leakage - subprocess inherits all parent process env vars including potentially sensitive API keys (OPENROUTER_API_KEY, AWS credentials, etc.)\",\n \"cwe\": \"CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code\",\n \"remediation\": \"Create whitelist of safe env variables - only forward PATH, HOME, and explicitly required vars\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"scripts/_harness.mjs\",\n \"line\": 197,\n \"description\": \"Environment variable credential leakage in subprocess invocation\",\n \"cwe\": \"CWE-95\",\n \"remediation\": \"Use environment variable whitelist in spawn options\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"scripts/_darwin.mjs\",\n \"line\": 85,\n \"description\": \"Environment variable credential leakage in Darwin-specific subprocess call\",\n \"cwe\": \"CWE-95\",\n \"remediation\": \"Filter environment variables before passing to subprocess\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"scripts/_darwin.mjs\",\n \"line\": 128,\n \"description\": \"Environment variable credential leakage in Darwin subprocess invocation\",\n \"cwe\": \"CWE-95\",\n \"remediation\": \"Implement environment variable filtering\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"scripts/_redblue.mjs\",\n \"line\": 109,\n \"description\": \"Environment variable credential leakage exposing secrets to subprocess\",\n \"cwe\": \"CWE-95\",\n \"remediation\": \"Use env whitelist pattern\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"scripts/test-with-openrouter.mjs\",\n \"line\": 112,\n \"description\": \"Environment variable credential leakage - OPENROUTER_API_KEY exposed to subprocess\",\n \"cwe\": \"CWE-95\",\n \"remediation\": \"Pass only required env vars explicitly\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"scripts/test-with-openrouter.mjs\",\n \"line\": 122,\n \"description\": \"Environment variable credential leakage in subprocess invocation\",\n \"cwe\": \"CWE-95\",\n \"remediation\": \"Filter sensitive credentials from subprocess environment\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/_darwin.mjs\",\n \"line\": 86,\n \"description\": \"Conditional shell interpretation on Windows (shell: true when win32) increases command injection risk if shell metacharacters appear in arguments\",\n \"cwe\": \"CWE-78: Improper Neutralization of Special Elements used in an OS Command\",\n \"remediation\": \"Set shell: false universally; if shell needed, use proper escaping libraries\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/_darwin.mjs\",\n \"line\": 129,\n \"description\": \"Windows shell parameter enabled - potential command injection vector\",\n \"cwe\": \"CWE-78\",\n \"remediation\": \"Disable shell interpretation; use array argument passing only\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/_redblue.mjs\",\n \"line\": 110,\n \"description\": \"Conditional shell enabled on Windows platform\",\n \"cwe\": \"CWE-78\",\n \"remediation\": \"Use shell: false consistently across platforms\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/_invoke.mjs\",\n \"line\": 177,\n \"description\": \"Shell parameter conditional on Windows - command injection risk\",\n \"cwe\": \"CWE-78\",\n \"remediation\": \"Remove shell: process.platform === 'win32' condition\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/audit-trend.mjs\",\n \"line\": 68,\n \"description\": \"Windows shell interpretation enabled in subprocess\",\n \"cwe\": \"CWE-78\",\n \"remediation\": \"Set shell: false\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/audit-list.mjs\",\n \"line\": 49,\n \"description\": \"Shell interpretation on Windows - command injection surface\",\n \"cwe\": \"CWE-78\",\n \"remediation\": \"Remove platform-conditional shell parameter\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/audit-list.mjs\",\n \"line\": 60,\n \"description\": \"Conditional shell parameter on Windows\",\n \"cwe\": \"CWE-78\",\n \"remediation\": \"Disable shell interpretation\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/similarity.mjs\",\n \"line\": 72,\n \"description\": \"Windows shell enabled - potential shell injection risk\",\n \"cwe\": \"CWE-78\",\n \"remediation\": \"Use shell: false\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/oia-audit.mjs\",\n \"line\": 105,\n \"description\": \"Conditional shell parameter on Windows increases command injection risk\",\n \"cwe\": \"CWE-78\",\n \"remediation\": \"Remove platform-dependent shell parameter\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/mint.mjs\",\n \"line\": 47,\n \"description\": \"Predictable temporary directory naming using Date.now() - enables TOCTOU race condition and symlink attacks\",\n \"cwe\": \"CWE-377: Insecure Temporary File\",\n \"remediation\": \"Use mkdtempSync(join(tmpdir(), 'ruflo-mint-')) instead of Date.now()\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/evolve.mjs\",\n \"line\": 97,\n \"description\": \"Unvalidated user-controlled URL parameter (--ruvllm-url) passed directly to CLI - SSRF/injection risk\",\n \"cwe\": \"CWE-95: Improper URL Validation\",\n \"remediation\": \"Validate URL using new URL() constructor and check protocol is http/https\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/evolve.mjs\",\n \"line\": 335,\n \"description\": \"Unvalidated URL forwarded to downstream CLI\",\n \"cwe\": \"CWE-95\",\n \"remediation\": \"Add URL validation before passing to subprocess\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/redblue.mjs\",\n \"line\": 217,\n \"description\": \"Insufficient path traversal validation - resolve() alone doesn't prevent symlink or ../ attacks when reading files\",\n \"cwe\": \"CWE-22: Improper Limitation of a Pathname to a Restricted Directory\",\n \"remediation\": \"Add path containment check: ensure resolved path starts with allowedBase\"\n }\n ],\n \"riskScore\": 72,\n \"riskLevel\": \"HIGH\",\n \"summary\": {\n \"totalVulnerabilities\": 20,\n \"highSeverity\": 7,\n \"mediumSeverity\": 13,\n \"lowSeverity\": 0,\n \"projectType\": \"Node.js CLI Plugin\",\n \"auditDate\": \"2026-07-09\"\n },\n \"recommendations\": [\n {\n \"priority\": 1,\n \"title\": \"Implement Environment Variable Whitelist\",\n \"description\": \"Create a function to filter subprocess environment to only include necessary variables (PATH, HOME, NODE_ENV) instead of forwarding all parent process env vars\",\n \"affectedFiles\": 7,\n \"estimatedEffort\": \"Low\",\n \"securityImpact\": \"High - Prevents credential leakage to compromised npm packages\"\n },\n {\n \"priority\": 2,\n \"title\": \"Disable Shell Interpretation Universally\",\n \"description\": \"Change all subprocess invocations to use shell: false consistently. The array-based argument passing is safer than relying on shell parameter conditions\",\n \"affectedFiles\": 9,\n \"estimatedEffort\": \"Low\",\n \"securityImpact\": \"Medium - Reduces command injection attack surface on Windows\"\n },\n {\n \"priority\": 3,\n \"title\": \"Use Secure Temporary Directory Creation\",\n \"description\": \"Replace Date.now()-based temp directory naming with mkdtempSync() which provides cryptographic randomness and atomic creation\",\n \"affectedFiles\": 1,\n \"estimatedEffort\": \"Very Low\",\n \"securityImpact\": \"Medium - Prevents TOCTOU race conditions and symlink hijacking\"\n },\n {\n \"priority\": 4,\n \"title\": \"Validate User-Controlled URL Parameters\",\n \"description\": \"Add URL validation using new URL() constructor before accepting --ruvllm-url or similar parameters\",\n \"affectedFiles\": 1,\n \"estimatedEffort\": \"Low\",\n \"securityImpact\": \"Medium - Prevents SSRF and URL-based injection attacks\"\n },\n {\n \"priority\": 5,\n \"title\": \"Implement Path Containment Validation\",\n \"description\": \"Add checks to ensure resolved file paths remain within intended directories, preventing symlink and ../ attacks\",\n \"affectedFiles\": 1,\n \"estimatedEffort\": \"Low\",\n \"securityImpact\": \"Medium - Prevents directory traversal attacks\"\n },\n {\n \"priority\": 6,\n \"title\": \"Add Input Validation Framework\",\n \"description\": \"Create a centralized input validation module for CLI parameters to reduce scattered validation logic\",\n \"affectedFiles\": \"Multiple\",\n \"estimatedEffort\": \"Medium\",\n \"securityImpact\": \"High - Improves maintainability and consistency of security checks\"\n },\n {\n \"priority\": 7,\n \"title\": \"Security Test Suite\",\n \"description\": \"Add tests for command injection, path traversal, and environment variable handling\",\n \"affectedFiles\": \"Test suite\",\n \"estimatedEffort\": \"Medium\",\n \"securityImpact\": \"High - Prevents regression of security vulnerabilities\"\n }\n ],\n \"positiveFindings\": [\n \"Most temporary directories correctly use mkdtempSync() for secure creation\",\n \"JSON parsing includes proper try-catch error handling\",\n \"Arguments passed as arrays rather than string concatenation (safe pattern)\",\n \"File existence checks before read operations\",\n \"Graceful degradation for missing optional dependencies\",\n \"No SQL injection vectors found (CLI tool, no database)\",\n \"No XSS vulnerabilities found (CLI tool, no web UI)\",\n \"No hardcoded API keys or secrets in source code\"\n ],\n \"nextSteps\": [\n \"1. Create environment variable whitelist utility function\",\n \"2. Audit all spawn/exec calls and apply whitelist\",\n \"3. Globally set shell: false in all subprocess options\",\n \"4. Replace all Date.now() temp directory patterns\",\n \"5. Add URL validation for user-supplied URL parameters\",\n \"6. Implement path containment checks for file operations\",\n \"7. Create security test suite covering injection vectors\",\n \"8. Run static analysis with ESLint security plugin\",\n \"9. Perform penetration testing before production release\",\n \"10. Set up security scanning in CI/CD pipeline\"\n ]\n}\n```\n\n## Key Findings Summary\n\n**Risk Score: 72/100 (HIGH)**\n\n### Critical Issues:\n1. **Environment Variable Leakage (7 instances)** - Secrets like API keys are forwarded to subprocesses, exposing them if npm packages are compromised\n2. **Shell Interpretation on Windows (9 instances)** - Enables command injection if shell metacharacters appear in arguments\n3. **Path Traversal Risk** - Insufficient validation when reading files could allow accessing files outside intended directories\n\n### Recommended Immediate Actions:\n- Filter environment variables before subprocess invocation\n- Set `shell: false` universally across all subprocess calls\n- Replace predictable temp directory naming with `mkdtempSync()`\n\nThe codebase follows good practices (array args, try-catch blocks, existence checks) but these security gaps should be addressed before production deployment.\n",
|
|
6
|
-
"parsedOutput": {
|
|
7
|
-
"vulnerabilities": [
|
|
8
|
-
{
|
|
9
|
-
"severity": "high",
|
|
10
|
-
"file": "scripts/_harness.mjs",
|
|
11
|
-
"line": 142,
|
|
12
|
-
"description": "Environment variable credential leakage - subprocess inherits all parent process env vars including potentially sensitive API keys (OPENROUTER_API_KEY, AWS credentials, etc.)",
|
|
13
|
-
"cwe": "CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code",
|
|
14
|
-
"remediation": "Create whitelist of safe env variables - only forward PATH, HOME, and explicitly required vars"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"severity": "high",
|
|
18
|
-
"file": "scripts/_harness.mjs",
|
|
19
|
-
"line": 197,
|
|
20
|
-
"description": "Environment variable credential leakage in subprocess invocation",
|
|
21
|
-
"cwe": "CWE-95",
|
|
22
|
-
"remediation": "Use environment variable whitelist in spawn options"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"severity": "high",
|
|
26
|
-
"file": "scripts/_darwin.mjs",
|
|
27
|
-
"line": 85,
|
|
28
|
-
"description": "Environment variable credential leakage in Darwin-specific subprocess call",
|
|
29
|
-
"cwe": "CWE-95",
|
|
30
|
-
"remediation": "Filter environment variables before passing to subprocess"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"severity": "high",
|
|
34
|
-
"file": "scripts/_darwin.mjs",
|
|
35
|
-
"line": 128,
|
|
36
|
-
"description": "Environment variable credential leakage in Darwin subprocess invocation",
|
|
37
|
-
"cwe": "CWE-95",
|
|
38
|
-
"remediation": "Implement environment variable filtering"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"severity": "high",
|
|
42
|
-
"file": "scripts/_redblue.mjs",
|
|
43
|
-
"line": 109,
|
|
44
|
-
"description": "Environment variable credential leakage exposing secrets to subprocess",
|
|
45
|
-
"cwe": "CWE-95",
|
|
46
|
-
"remediation": "Use env whitelist pattern"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"severity": "high",
|
|
50
|
-
"file": "scripts/test-with-openrouter.mjs",
|
|
51
|
-
"line": 112,
|
|
52
|
-
"description": "Environment variable credential leakage - OPENROUTER_API_KEY exposed to subprocess",
|
|
53
|
-
"cwe": "CWE-95",
|
|
54
|
-
"remediation": "Pass only required env vars explicitly"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"severity": "high",
|
|
58
|
-
"file": "scripts/test-with-openrouter.mjs",
|
|
59
|
-
"line": 122,
|
|
60
|
-
"description": "Environment variable credential leakage in subprocess invocation",
|
|
61
|
-
"cwe": "CWE-95",
|
|
62
|
-
"remediation": "Filter sensitive credentials from subprocess environment"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"severity": "medium",
|
|
66
|
-
"file": "scripts/_darwin.mjs",
|
|
67
|
-
"line": 86,
|
|
68
|
-
"description": "Conditional shell interpretation on Windows (shell: true when win32) increases command injection risk if shell metacharacters appear in arguments",
|
|
69
|
-
"cwe": "CWE-78: Improper Neutralization of Special Elements used in an OS Command",
|
|
70
|
-
"remediation": "Set shell: false universally; if shell needed, use proper escaping libraries"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"severity": "medium",
|
|
74
|
-
"file": "scripts/_darwin.mjs",
|
|
75
|
-
"line": 129,
|
|
76
|
-
"description": "Windows shell parameter enabled - potential command injection vector",
|
|
77
|
-
"cwe": "CWE-78",
|
|
78
|
-
"remediation": "Disable shell interpretation; use array argument passing only"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"severity": "medium",
|
|
82
|
-
"file": "scripts/_redblue.mjs",
|
|
83
|
-
"line": 110,
|
|
84
|
-
"description": "Conditional shell enabled on Windows platform",
|
|
85
|
-
"cwe": "CWE-78",
|
|
86
|
-
"remediation": "Use shell: false consistently across platforms"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"severity": "medium",
|
|
90
|
-
"file": "scripts/_invoke.mjs",
|
|
91
|
-
"line": 177,
|
|
92
|
-
"description": "Shell parameter conditional on Windows - command injection risk",
|
|
93
|
-
"cwe": "CWE-78",
|
|
94
|
-
"remediation": "Remove shell: process.platform === 'win32' condition"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"severity": "medium",
|
|
98
|
-
"file": "scripts/audit-trend.mjs",
|
|
99
|
-
"line": 68,
|
|
100
|
-
"description": "Windows shell interpretation enabled in subprocess",
|
|
101
|
-
"cwe": "CWE-78",
|
|
102
|
-
"remediation": "Set shell: false"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"severity": "medium",
|
|
106
|
-
"file": "scripts/audit-list.mjs",
|
|
107
|
-
"line": 49,
|
|
108
|
-
"description": "Shell interpretation on Windows - command injection surface",
|
|
109
|
-
"cwe": "CWE-78",
|
|
110
|
-
"remediation": "Remove platform-conditional shell parameter"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"severity": "medium",
|
|
114
|
-
"file": "scripts/audit-list.mjs",
|
|
115
|
-
"line": 60,
|
|
116
|
-
"description": "Conditional shell parameter on Windows",
|
|
117
|
-
"cwe": "CWE-78",
|
|
118
|
-
"remediation": "Disable shell interpretation"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"severity": "medium",
|
|
122
|
-
"file": "scripts/similarity.mjs",
|
|
123
|
-
"line": 72,
|
|
124
|
-
"description": "Windows shell enabled - potential shell injection risk",
|
|
125
|
-
"cwe": "CWE-78",
|
|
126
|
-
"remediation": "Use shell: false"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"severity": "medium",
|
|
130
|
-
"file": "scripts/oia-audit.mjs",
|
|
131
|
-
"line": 105,
|
|
132
|
-
"description": "Conditional shell parameter on Windows increases command injection risk",
|
|
133
|
-
"cwe": "CWE-78",
|
|
134
|
-
"remediation": "Remove platform-dependent shell parameter"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"severity": "medium",
|
|
138
|
-
"file": "scripts/mint.mjs",
|
|
139
|
-
"line": 47,
|
|
140
|
-
"description": "Predictable temporary directory naming using Date.now() - enables TOCTOU race condition and symlink attacks",
|
|
141
|
-
"cwe": "CWE-377: Insecure Temporary File",
|
|
142
|
-
"remediation": "Use mkdtempSync(join(tmpdir(), 'ruflo-mint-')) instead of Date.now()"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"severity": "medium",
|
|
146
|
-
"file": "scripts/evolve.mjs",
|
|
147
|
-
"line": 97,
|
|
148
|
-
"description": "Unvalidated user-controlled URL parameter (--ruvllm-url) passed directly to CLI - SSRF/injection risk",
|
|
149
|
-
"cwe": "CWE-95: Improper URL Validation",
|
|
150
|
-
"remediation": "Validate URL using new URL() constructor and check protocol is http/https"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"severity": "medium",
|
|
154
|
-
"file": "scripts/evolve.mjs",
|
|
155
|
-
"line": 335,
|
|
156
|
-
"description": "Unvalidated URL forwarded to downstream CLI",
|
|
157
|
-
"cwe": "CWE-95",
|
|
158
|
-
"remediation": "Add URL validation before passing to subprocess"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
"severity": "medium",
|
|
162
|
-
"file": "scripts/redblue.mjs",
|
|
163
|
-
"line": 217,
|
|
164
|
-
"description": "Insufficient path traversal validation - resolve() alone doesn't prevent symlink or ../ attacks when reading files",
|
|
165
|
-
"cwe": "CWE-22: Improper Limitation of a Pathname to a Restricted Directory",
|
|
166
|
-
"remediation": "Add path containment check: ensure resolved path starts with allowedBase"
|
|
167
|
-
}
|
|
168
|
-
],
|
|
169
|
-
"riskScore": 72,
|
|
170
|
-
"riskLevel": "HIGH",
|
|
171
|
-
"summary": {
|
|
172
|
-
"totalVulnerabilities": 20,
|
|
173
|
-
"highSeverity": 7,
|
|
174
|
-
"mediumSeverity": 13,
|
|
175
|
-
"lowSeverity": 0,
|
|
176
|
-
"projectType": "Node.js CLI Plugin",
|
|
177
|
-
"auditDate": "2026-07-09"
|
|
178
|
-
},
|
|
179
|
-
"recommendations": [
|
|
180
|
-
{
|
|
181
|
-
"priority": 1,
|
|
182
|
-
"title": "Implement Environment Variable Whitelist",
|
|
183
|
-
"description": "Create a function to filter subprocess environment to only include necessary variables (PATH, HOME, NODE_ENV) instead of forwarding all parent process env vars",
|
|
184
|
-
"affectedFiles": 7,
|
|
185
|
-
"estimatedEffort": "Low",
|
|
186
|
-
"securityImpact": "High - Prevents credential leakage to compromised npm packages"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"priority": 2,
|
|
190
|
-
"title": "Disable Shell Interpretation Universally",
|
|
191
|
-
"description": "Change all subprocess invocations to use shell: false consistently. The array-based argument passing is safer than relying on shell parameter conditions",
|
|
192
|
-
"affectedFiles": 9,
|
|
193
|
-
"estimatedEffort": "Low",
|
|
194
|
-
"securityImpact": "Medium - Reduces command injection attack surface on Windows"
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"priority": 3,
|
|
198
|
-
"title": "Use Secure Temporary Directory Creation",
|
|
199
|
-
"description": "Replace Date.now()-based temp directory naming with mkdtempSync() which provides cryptographic randomness and atomic creation",
|
|
200
|
-
"affectedFiles": 1,
|
|
201
|
-
"estimatedEffort": "Very Low",
|
|
202
|
-
"securityImpact": "Medium - Prevents TOCTOU race conditions and symlink hijacking"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"priority": 4,
|
|
206
|
-
"title": "Validate User-Controlled URL Parameters",
|
|
207
|
-
"description": "Add URL validation using new URL() constructor before accepting --ruvllm-url or similar parameters",
|
|
208
|
-
"affectedFiles": 1,
|
|
209
|
-
"estimatedEffort": "Low",
|
|
210
|
-
"securityImpact": "Medium - Prevents SSRF and URL-based injection attacks"
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"priority": 5,
|
|
214
|
-
"title": "Implement Path Containment Validation",
|
|
215
|
-
"description": "Add checks to ensure resolved file paths remain within intended directories, preventing symlink and ../ attacks",
|
|
216
|
-
"affectedFiles": 1,
|
|
217
|
-
"estimatedEffort": "Low",
|
|
218
|
-
"securityImpact": "Medium - Prevents directory traversal attacks"
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
"priority": 6,
|
|
222
|
-
"title": "Add Input Validation Framework",
|
|
223
|
-
"description": "Create a centralized input validation module for CLI parameters to reduce scattered validation logic",
|
|
224
|
-
"affectedFiles": "Multiple",
|
|
225
|
-
"estimatedEffort": "Medium",
|
|
226
|
-
"securityImpact": "High - Improves maintainability and consistency of security checks"
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
"priority": 7,
|
|
230
|
-
"title": "Security Test Suite",
|
|
231
|
-
"description": "Add tests for command injection, path traversal, and environment variable handling",
|
|
232
|
-
"affectedFiles": "Test suite",
|
|
233
|
-
"estimatedEffort": "Medium",
|
|
234
|
-
"securityImpact": "High - Prevents regression of security vulnerabilities"
|
|
235
|
-
}
|
|
236
|
-
],
|
|
237
|
-
"positiveFindings": [
|
|
238
|
-
"Most temporary directories correctly use mkdtempSync() for secure creation",
|
|
239
|
-
"JSON parsing includes proper try-catch error handling",
|
|
240
|
-
"Arguments passed as arrays rather than string concatenation (safe pattern)",
|
|
241
|
-
"File existence checks before read operations",
|
|
242
|
-
"Graceful degradation for missing optional dependencies",
|
|
243
|
-
"No SQL injection vectors found (CLI tool, no database)",
|
|
244
|
-
"No XSS vulnerabilities found (CLI tool, no web UI)",
|
|
245
|
-
"No hardcoded API keys or secrets in source code"
|
|
246
|
-
],
|
|
247
|
-
"nextSteps": [
|
|
248
|
-
"1. Create environment variable whitelist utility function",
|
|
249
|
-
"2. Audit all spawn/exec calls and apply whitelist",
|
|
250
|
-
"3. Globally set shell: false in all subprocess options",
|
|
251
|
-
"4. Replace all Date.now() temp directory patterns",
|
|
252
|
-
"5. Add URL validation for user-supplied URL parameters",
|
|
253
|
-
"6. Implement path containment checks for file operations",
|
|
254
|
-
"7. Create security test suite covering injection vectors",
|
|
255
|
-
"8. Run static analysis with ESLint security plugin",
|
|
256
|
-
"9. Perform penetration testing before production release",
|
|
257
|
-
"10. Set up security scanning in CI/CD pipeline"
|
|
258
|
-
]
|
|
259
|
-
},
|
|
260
|
-
"durationMs": 198260,
|
|
261
|
-
"model": "haiku",
|
|
262
|
-
"sandboxMode": "strict",
|
|
263
|
-
"workerType": "audit",
|
|
264
|
-
"timestamp": "2026-07-09T17:05:23.031Z",
|
|
265
|
-
"executionId": "audit_1783616524771_ut1ftw"
|
|
266
|
-
}
|
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783617323039_fs3x5a_prompt.log
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[2026-07-09T17:15:23.054Z] PROMPT
|
|
2
|
-
============================================================
|
|
3
|
-
Analyze this codebase for security vulnerabilities:
|
|
4
|
-
- Check for hardcoded secrets (API keys, passwords)
|
|
5
|
-
- Identify SQL injection risks
|
|
6
|
-
- Find XSS vulnerabilities
|
|
7
|
-
- Check for insecure dependencies
|
|
8
|
-
- Identify authentication/authorization issues
|
|
9
|
-
|
|
10
|
-
Provide a JSON report with:
|
|
11
|
-
{
|
|
12
|
-
"vulnerabilities": [{ "severity": "high|medium|low", "file": "...", "line": N, "description": "..." }],
|
|
13
|
-
"riskScore": 0-100,
|
|
14
|
-
"recommendations": ["..."]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
## Instructions
|
|
18
|
-
|
|
19
|
-
Analyze the codebase and provide your response following the format specified in the task.
|
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783617323039_fs3x5a_result.log
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
[2026-07-09T17:17:29.174Z] RESULT
|
|
2
|
-
============================================================
|
|
3
|
-
{
|
|
4
|
-
"success": true,
|
|
5
|
-
"output": "Based on my comprehensive security analysis of the ruflo-metaharness plugin codebase, here's the security assessment:\n\n```json\n{\n \"vulnerabilities\": [\n {\n \"severity\": \"medium\",\n \"file\": \"scripts/_invoke.mjs\",\n \"line\": 172,\n \"description\": \"Unsafe npm package version handling - pinVersion passed directly to npm install without validation. While currently a constant, the pattern could allow version string injection.\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/gepa.mjs\",\n \"line\": 98,\n \"description\": \"Path traversal vulnerability - user-supplied file paths (--path, --transcript) passed to readFileSync without explicit traversal validation. Existence checked but not path normalization.\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/learn.mjs\",\n \"line\": 68,\n \"description\": \"Insufficient repo path validation - only existsSync check, doesn't verify it's a directory or validate symlinks. Could accept symbolic links to sensitive locations.\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/learn.mjs\",\n \"line\": 84,\n \"description\": \"Environment variable exposure - METAHARNESS_REPO passed to subprocess without sanitization. Spreads entire process.env which could expose sensitive variables.\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/_invoke.mjs\",\n \"line\": 78,\n \"description\": \"ReDoS vulnerability in JSON parsing - regex /\\\\{[\\\\s\\\\S]*?\\\\}/g vulnerable to denial of service with pathological input containing many nested braces.\"\n }\n ],\n \"riskScore\": 28,\n \"recommendations\": [\n \"Add comprehensive input validation for all user-supplied arguments (paths, versions, package names) using whitelist patterns\",\n \"Use explicit environment variable allowlist when spawning subprocesses - never spread entire process.env\",\n \"Implement path traversal protection: use path.resolve() and verify paths stay within expected boundaries\",\n \"Add size limits and timeouts to JSON parsing to prevent ReDoS attacks\",\n \"Validate version strings with strict regex: /^~\\\\d+\\\\.\\\\d+\\\\.\\\\d+$/ before passing to npm\",\n \"Verify file paths are directories (fs.statSync) and resolve symlinks (path.realpath) before use\",\n \"Change default sandbox configuration in evolve.mjs from 'real' to 'mock' for safer defaults\"\n ]\n}\n```\n\n## Key Findings:\n\n**Strengths:**\n- ✅ All subprocess spawns use `shell: false` (secure)\n- ✅ No hardcoded secrets, API keys, or credentials\n- ✅ No SQL injection risks (no database operations)\n- ✅ Pinned package versions prevent supply chain attacks\n- ✅ Proper use of argv arrays instead of string concatenation\n- ✅ Subprocess timeouts prevent denial of service\n\n**Weaknesses:**\n- ⚠️ Input validation gaps in path handling\n- ⚠️ Environment variable handling spreads entire `process.env`\n- ⚠️ ReDoS vulnerability in JSON parsing regex\n- ⚠️ Path traversal checks incomplete\n- ⚠️ No symlink resolution verification\n\n**Risk Assessment:** The plugin has a **low-to-medium risk profile** (28/100). No critical vulnerabilities were discovered. Primary concerns are input validation and environment variable handling—both straightforward to remediate.\n",
|
|
6
|
-
"parsedOutput": {
|
|
7
|
-
"vulnerabilities": [
|
|
8
|
-
{
|
|
9
|
-
"severity": "medium",
|
|
10
|
-
"file": "scripts/_invoke.mjs",
|
|
11
|
-
"line": 172,
|
|
12
|
-
"description": "Unsafe npm package version handling - pinVersion passed directly to npm install without validation. While currently a constant, the pattern could allow version string injection."
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"severity": "low",
|
|
16
|
-
"file": "scripts/gepa.mjs",
|
|
17
|
-
"line": 98,
|
|
18
|
-
"description": "Path traversal vulnerability - user-supplied file paths (--path, --transcript) passed to readFileSync without explicit traversal validation. Existence checked but not path normalization."
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"severity": "low",
|
|
22
|
-
"file": "scripts/learn.mjs",
|
|
23
|
-
"line": 68,
|
|
24
|
-
"description": "Insufficient repo path validation - only existsSync check, doesn't verify it's a directory or validate symlinks. Could accept symbolic links to sensitive locations."
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"severity": "low",
|
|
28
|
-
"file": "scripts/learn.mjs",
|
|
29
|
-
"line": 84,
|
|
30
|
-
"description": "Environment variable exposure - METAHARNESS_REPO passed to subprocess without sanitization. Spreads entire process.env which could expose sensitive variables."
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"severity": "low",
|
|
34
|
-
"file": "scripts/_invoke.mjs",
|
|
35
|
-
"line": 78,
|
|
36
|
-
"description": "ReDoS vulnerability in JSON parsing - regex /\\{[\\s\\S]*?\\}/g vulnerable to denial of service with pathological input containing many nested braces."
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
"riskScore": 28,
|
|
40
|
-
"recommendations": [
|
|
41
|
-
"Add comprehensive input validation for all user-supplied arguments (paths, versions, package names) using whitelist patterns",
|
|
42
|
-
"Use explicit environment variable allowlist when spawning subprocesses - never spread entire process.env",
|
|
43
|
-
"Implement path traversal protection: use path.resolve() and verify paths stay within expected boundaries",
|
|
44
|
-
"Add size limits and timeouts to JSON parsing to prevent ReDoS attacks",
|
|
45
|
-
"Validate version strings with strict regex: /^~\\d+\\.\\d+\\.\\d+$/ before passing to npm",
|
|
46
|
-
"Verify file paths are directories (fs.statSync) and resolve symlinks (path.realpath) before use",
|
|
47
|
-
"Change default sandbox configuration in evolve.mjs from 'real' to 'mock' for safer defaults"
|
|
48
|
-
]
|
|
49
|
-
},
|
|
50
|
-
"durationMs": 126135,
|
|
51
|
-
"model": "haiku",
|
|
52
|
-
"sandboxMode": "strict",
|
|
53
|
-
"workerType": "audit",
|
|
54
|
-
"timestamp": "2026-07-09T17:17:29.174Z",
|
|
55
|
-
"executionId": "audit_1783617323039_fs3x5a"
|
|
56
|
-
}
|
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618049184_1f4yah_prompt.log
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[2026-07-09T17:27:29.199Z] PROMPT
|
|
2
|
-
============================================================
|
|
3
|
-
Analyze this codebase for security vulnerabilities:
|
|
4
|
-
- Check for hardcoded secrets (API keys, passwords)
|
|
5
|
-
- Identify SQL injection risks
|
|
6
|
-
- Find XSS vulnerabilities
|
|
7
|
-
- Check for insecure dependencies
|
|
8
|
-
- Identify authentication/authorization issues
|
|
9
|
-
|
|
10
|
-
Provide a JSON report with:
|
|
11
|
-
{
|
|
12
|
-
"vulnerabilities": [{ "severity": "high|medium|low", "file": "...", "line": N, "description": "..." }],
|
|
13
|
-
"riskScore": 0-100,
|
|
14
|
-
"recommendations": ["..."]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
## Instructions
|
|
18
|
-
|
|
19
|
-
Analyze the codebase and provide your response following the format specified in the task.
|