@claude-flow/cli 3.38.11 → 3.38.13
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/.proven-config-version +1 -0
- package/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/helpers.manifest.json +2 -2
- package/.claude/helpers/statusline.cjs +0 -0
- package/.claude/proven-config.json +42 -0
- package/catalog-manifest.json +4 -4
- package/dist/src/commands/hooks.js +3 -2
- package/dist/src/init/executor.d.ts +6 -0
- package/dist/src/init/executor.js +5 -3
- package/dist/src/init/settings-generator.js +6 -2
- package/dist/src/mcp-tools/hooks-tools.js +6 -1
- package/dist/src/ruvector/lattice-wasm.d.ts +14 -0
- package/dist/src/ruvector/lattice-wasm.js +144 -0
- package/dist/src/services/flywheel-receipt.d.ts +10 -0
- package/dist/src/services/flywheel-receipt.js +82 -7
- package/dist/src/services/flywheel-transaction.js +10 -1
- 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/plugins/ruflo-metaharness/.claude-flow/daemon-state.json +178 -0
- package/plugins/ruflo-metaharness/.claude-flow/daemon.pid +1 -0
- package/plugins/ruflo-metaharness/.claude-flow/data/pending-insights.jsonl +5 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/daemon.log +269 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783604774864_ozbujc_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783604774864_ozbujc_result.log +108 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783605513587_ulvmpb_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783605513587_ulvmpb_result.log +209 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783606368867_ahysui_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783606368867_ahysui_result.log +192 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783607120257_lh05rb_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783607120257_lh05rb_result.log +13 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608020362_j3096j_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608020362_j3096j_result.log +120 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608776347_261b61_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608776347_261b61_result.log +85 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783609621359_s5i6ye_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783609621359_s5i6ye_result.log +13 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610087998_qihv9v_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610087998_qihv9v_result.log +17 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610773920_qlzmxo_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610773920_qlzmxo_result.log +17 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783611376090_xpqf1z_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783611376090_xpqf1z_result.log +16 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612097184_9rqfor_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612097184_9rqfor_result.log +138 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612811574_4u602j_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612811574_4u602j_result.log +16 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783613750487_a46ttn_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783613750487_a46ttn_result.log +107 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783614289360_figwc0_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783614289360_figwc0_result.log +200 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615067640_l7tm6a_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615067640_l7tm6a_result.log +54 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615825308_44nor5_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615825308_44nor5_result.log +85 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_result.log +266 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783617323039_fs3x5a_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783617323039_fs3x5a_result.log +56 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618049184_1f4yah_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618049184_1f4yah_result.log +96 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618793925_4ee7tf_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618793925_4ee7tf_result.log +481 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783619642574_yjr4mm_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783619642574_yjr4mm_result.log +104 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783620392771_oduto0_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783620392771_oduto0_result.log +148 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621183670_gd0p1x_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621183670_gd0p1x_result.log +111 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621738388_z4k48b_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621738388_z4k48b_result.log +89 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783622493677_zwc35w_prompt.log +19 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783622493677_zwc35w_result.log +207 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783604894861_v6n3ut_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783604894861_v6n3ut_result.log +66 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783605934532_9h8ikb_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783605934532_9h8ikb_result.log +68 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783607181736_t12f4y_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783607181736_t12f4y_result.log +78 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783608341266_zhk0fl_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783608341266_zhk0fl_result.log +68 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783609420180_7xw817_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783609420180_7xw817_result.log +72 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783610535307_2pxofp_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783610535307_2pxofp_result.log +17 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783611437445_ofwnpb_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783611437445_ofwnpb_result.log +60 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783612556827_1cb112_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783612556827_1cb112_result.log +56 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783613579531_18xiax_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783613579531_18xiax_result.log +74 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783614650481_2zdz7w_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783614650481_2zdz7w_result.log +68 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783615742328_rjj69d_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783615742328_rjj69d_result.log +65 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783616767230_1iad99_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783616767230_1iad99_result.log +68 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783617783537_rqagku_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783617783537_rqagku_result.log +56 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783618817343_r1lbhr_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783618817343_r1lbhr_result.log +65 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783619907773_8msfw3_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783619907773_8msfw3_result.log +77 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783621009302_hybdum_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783621009302_hybdum_result.log +64 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783622083681_nznpnx_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783622083681_nznpnx_result.log +56 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783623208340_olsbaw_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783605134860_9jssz9_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783605134860_9jssz9_result.log +69 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783606516743_zftbaa_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783606516743_zftbaa_result.log +92 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783608038317_jrd66e_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783608038317_jrd66e_result.log +92 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783609388416_mc3zoe_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783609388416_mc3zoe_result.log +82 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783610821384_tzqvlb_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783610821384_tzqvlb_result.log +17 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783612023285_buygpo_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783612023285_buygpo_result.log +57 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783613599301_6f78cw_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783613599301_6f78cw_result.log +60 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783615000844_v95ues_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783615000844_v95ues_result.log +69 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783616341693_bl5d9o_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783616341693_bl5d9o_result.log +64 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783617832831_ha6s8d_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783617832831_ha6s8d_result.log +42 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783619384959_s5iiwf_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783619384959_s5iiwf_result.log +47 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783620946263_d7ovai_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783620946263_d7ovai_result.log +52 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783622473846_t839e5_prompt.log +14 -0
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783622473846_t839e5_result.log +96 -0
- package/plugins/ruflo-metaharness/.claude-flow/metrics/backup.json +7 -0
- package/plugins/ruflo-metaharness/.claude-flow/metrics/codebase-map.json +11 -0
- package/plugins/ruflo-metaharness/.claude-flow/metrics/consolidation.json +16 -0
- package/plugins/ruflo-metaharness/.claude-flow/metrics/harness-loop.json +83 -0
- package/plugins/ruflo-metaharness/.claude-flow/metrics/performance.json +55 -0
- package/plugins/ruflo-metaharness/.claude-flow/metrics/security-audit.json +206 -0
- package/plugins/ruflo-metaharness/.claude-flow/metrics/test-gaps.json +95 -0
- package/plugins/ruflo-metaharness/.claude-flow/neural/stats.json +6 -0
- package/plugins/ruflo-metaharness/skills/harness-gepa/SKILL.md +1 -1
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_prompt.log
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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.
|
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618049184_1f4yah_result.log
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
[2026-07-09T17:29:53.962Z] RESULT
|
|
2
|
+
============================================================
|
|
3
|
+
{
|
|
4
|
+
"success": true,
|
|
5
|
+
"output": "Based on my comprehensive security analysis of the ruflo-metaharness plugin codebase, here is the security audit report:\n\n```json\n{\n \"vulnerabilities\": [\n {\n \"severity\": \"low\",\n \"file\": \"scripts/test-with-openrouter.mjs\",\n \"line\": 109,\n \"description\": \"Use of @latest version specifier with npx (supply chain risk). The script spawns `npx -y -p metaharness@latest` which could execute arbitrary code if the npm registry is compromised. While this is a test file, it contradicts the security practice of version pinning used in production code (_harness.mjs uses ~0.3.0 pinned ranges).\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/oia-audit.mjs\",\n \"line\": 38,\n \"description\": \"Hardcoded @latest version reference in CLI_PKG variable. Uses '@claude-flow/cli@latest' for memory store operations. While not directly executed as code, this could be vulnerable if the package source is compromised. Should use pinned semver range.\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/_invoke.mjs\",\n \"line\": 177,\n \"description\": \"Shell enabled on Windows platform (shell: process.platform === 'win32'). Although arguments are passed as arrays (preventing direct injection), using shell on Windows can introduce subtle escaping issues. Consider using a Windows-safe wrapper or disabling shell entirely with proper escaping.\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"scripts/test-with-openrouter.mjs\",\n \"line\": 132,\n \"description\": \"Potential unvalidated GCP credential handling. The `fetchSecretFromGcp` function executes `gcloud secrets` without validating the response length or format before returning. While this is test code with proper error handling, production credential flows should have stricter validation.\"\n }\n ],\n \"riskScore\": 18,\n \"security_strengths\": [\n \"Strong version pinning strategy in production code (uses ~X.Y.Z ranges instead of @latest) prevents supply chain attacks\",\n \"Consistent use of shell: false in spawnSync/spawn calls prevents shell injection attacks\",\n \"Arguments passed as arrays rather than shell command strings throughout the codebase\",\n \"Graceful degradation pattern ensures plugin fails safely when upstream packages are unavailable\",\n \"No eval(), Function(), or dynamic code execution patterns found\",\n \"Proper subprocess timeout management (60s default) prevents resource exhaustion\",\n \"Input validation on file paths and argument parsing\",\n \"Upstream safety boundaries documented and preserved (no shell, no eval, no arbitrary network in redblue/darwin)\",\n \"No hardcoded API keys or credentials in source code (uses environment variables via process.env)\"\n ],\n \"recommendations\": [\n \"Replace @latest version references in test-with-openrouter.mjs (lines 109, 118) with pinned semver ranges matching production standards. Example: 'metaharness@~0.3.0'\",\n \"Update oia-audit.mjs line 38 to use pinned version: Change '@claude-flow/cli@latest' to '@claude-flow/cli@~3.0.0' (or appropriate stable version)\",\n \"For the test file's GCP integration, add response validation: Check that fetched secrets are within expected length bounds (20-500 chars) before returning\",\n \"Consider adding a Windows-specific spawnSync wrapper that doesn't rely on shell parameter for better cross-platform consistency\",\n \"Add an ADR or security-policy document explaining why test files use @latest while production uses pinned versions, and migrate tests to pinned versions for consistency\",\n \"Implement dependency scanning in CI to detect known vulnerabilities in optionalDependencies (@metaharness/*, @claude-flow/*)\",\n \"Verify that all external package.json references are resolved through the safe node_modules resolution path in _invoke.mjs\",\n \"Document the graceful degradation security model as a design principle in the README\"\n ],\n \"owasp_coverage\": {\n \"A1_Injection\": \"✓ PASS — No SQL/command injection risks. Shell disabled, arguments as arrays, no eval/Function\",\n \"A2_Authentication\": \"✓ PASS — No auth logic in this plugin; delegates to upstream\",\n \"A3_Sensitive_Data_Exposure\": \"✓ PASS — No hardcoded secrets. Uses process.env for credentials\",\n \"A4_XXE\": \"✓ PASS — No XML parsing; JSON parsing only\",\n \"A5_Access_Control\": \"⚠ PARTIAL — Plugin relies on upstream access control; no internal access validation\",\n \"A6_Security_Misconfiguration\": \"⚠ LOW RISK — Test file uses @latest (should use pinned), but isolated to test code\",\n \"A7_XSS\": \"✓ PASS — No web/UI code; CLI only\",\n \"A8_Insecure_Deserialization\": \"✓ PASS — Strict JSON.parse() with try-catch, no untrusted object deserialization\",\n \"A9_Vulnerable_Dependencies\": \"⚠ REVIEW — optionalDependencies should be scanned; version pins are present\",\n \"A10_Logging_Monitoring\": \"⚠ PARTIAL — Logs to stdout/stderr; no security-specific audit logging\"\n },\n \"compliance_notes\": {\n \"ADR-150_adherence\": \"✓ PASS — Architectural constraint 'MetaHarness must remain removable' is enforced. Graceful degradation on missing packages.\",\n \"version_pinning\": \"⚠ PARTIAL — Production code follows tilde-range pinning; test code uses @latest\",\n \"subprocess_safety\": \"✓ PASS — All subprocess invocations use shell:false with array arguments\",\n \"error_handling\": \"✓ PASS — Consistent degraded result handling across the codebase\"\n },\n \"tested_files\": [\n \"scripts/_harness.mjs\",\n \"scripts/_redblue.mjs\",\n \"scripts/_invoke.mjs\",\n \"scripts/oia-audit.mjs\",\n \"scripts/learn.mjs\",\n \"scripts/evolve.mjs\",\n \"scripts/test-with-openrouter.mjs\",\n \"scripts/test-similarity.mjs\",\n \"scripts/redblue.mjs\",\n \".claude-plugin/plugin.json\"\n ],\n \"scan_date\": \"2025-07-09\",\n \"scanner\": \"Claude Code Security Auditor\",\n \"project_type\": \"Node.js CLI Plugin\",\n \"summary\": \"The ruflo-metaharness plugin demonstrates strong security practices with consistent version pinning, proper subprocess isolation, and graceful degradation patterns. Security risks are minimal and primarily limited to test code that uses @latest version specifiers. No critical vulnerabilities were found. The plugin correctly implements ADR-150's architectural constraint of remaining an optional augmentation. Recommended remediation focuses on aligning test code practices with production standards and adding minor validation improvements.\"\n}\n```\n\n## Key Security Findings\n\n**Risk Score: 18/100 (Low Risk)**\n\n### Strengths:\n- ✅ **Version Pinning**: Production code uses `~X.Y.Z` ranges, preventing supply chain attacks from @latest compromises\n- ✅ **Safe Subprocess Execution**: Consistent use of `shell: false` with array arguments prevents shell injection\n- ✅ **No Dynamic Code Execution**: Zero instances of `eval()`, `Function()`, or dynamic imports\n- ✅ **Graceful Degradation**: Properly handles missing optional dependencies without crashing\n- ✅ **No Hardcoded Secrets**: All credentials fetched from `process.env`\n\n### Vulnerabilities:\n1. **Test File @latest Usage** (Low) - `test-with-openrouter.mjs` uses `@latest` version specifiers\n2. **Hardcoded @latest in CLI_PKG** (Low) - `oia-audit.mjs` references `@claude-flow/cli@latest`\n3. **Windows Shell Usage** (Low) - `_invoke.mjs` enables shell on Windows platform\n4. **Minimal Input Validation** (Low) - GCP credential fetching lacks response length validation\n\nAll vulnerabilities are **low severity** and primarily affect test/non-critical code paths.\n",
|
|
6
|
+
"parsedOutput": {
|
|
7
|
+
"vulnerabilities": [
|
|
8
|
+
{
|
|
9
|
+
"severity": "low",
|
|
10
|
+
"file": "scripts/test-with-openrouter.mjs",
|
|
11
|
+
"line": 109,
|
|
12
|
+
"description": "Use of @latest version specifier with npx (supply chain risk). The script spawns `npx -y -p metaharness@latest` which could execute arbitrary code if the npm registry is compromised. While this is a test file, it contradicts the security practice of version pinning used in production code (_harness.mjs uses ~0.3.0 pinned ranges)."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"severity": "low",
|
|
16
|
+
"file": "scripts/oia-audit.mjs",
|
|
17
|
+
"line": 38,
|
|
18
|
+
"description": "Hardcoded @latest version reference in CLI_PKG variable. Uses '@claude-flow/cli@latest' for memory store operations. While not directly executed as code, this could be vulnerable if the package source is compromised. Should use pinned semver range."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"severity": "low",
|
|
22
|
+
"file": "scripts/_invoke.mjs",
|
|
23
|
+
"line": 177,
|
|
24
|
+
"description": "Shell enabled on Windows platform (shell: process.platform === 'win32'). Although arguments are passed as arrays (preventing direct injection), using shell on Windows can introduce subtle escaping issues. Consider using a Windows-safe wrapper or disabling shell entirely with proper escaping."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"severity": "low",
|
|
28
|
+
"file": "scripts/test-with-openrouter.mjs",
|
|
29
|
+
"line": 132,
|
|
30
|
+
"description": "Potential unvalidated GCP credential handling. The `fetchSecretFromGcp` function executes `gcloud secrets` without validating the response length or format before returning. While this is test code with proper error handling, production credential flows should have stricter validation."
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"riskScore": 18,
|
|
34
|
+
"security_strengths": [
|
|
35
|
+
"Strong version pinning strategy in production code (uses ~X.Y.Z ranges instead of @latest) prevents supply chain attacks",
|
|
36
|
+
"Consistent use of shell: false in spawnSync/spawn calls prevents shell injection attacks",
|
|
37
|
+
"Arguments passed as arrays rather than shell command strings throughout the codebase",
|
|
38
|
+
"Graceful degradation pattern ensures plugin fails safely when upstream packages are unavailable",
|
|
39
|
+
"No eval(), Function(), or dynamic code execution patterns found",
|
|
40
|
+
"Proper subprocess timeout management (60s default) prevents resource exhaustion",
|
|
41
|
+
"Input validation on file paths and argument parsing",
|
|
42
|
+
"Upstream safety boundaries documented and preserved (no shell, no eval, no arbitrary network in redblue/darwin)",
|
|
43
|
+
"No hardcoded API keys or credentials in source code (uses environment variables via process.env)"
|
|
44
|
+
],
|
|
45
|
+
"recommendations": [
|
|
46
|
+
"Replace @latest version references in test-with-openrouter.mjs (lines 109, 118) with pinned semver ranges matching production standards. Example: 'metaharness@~0.3.0'",
|
|
47
|
+
"Update oia-audit.mjs line 38 to use pinned version: Change '@claude-flow/cli@latest' to '@claude-flow/cli@~3.0.0' (or appropriate stable version)",
|
|
48
|
+
"For the test file's GCP integration, add response validation: Check that fetched secrets are within expected length bounds (20-500 chars) before returning",
|
|
49
|
+
"Consider adding a Windows-specific spawnSync wrapper that doesn't rely on shell parameter for better cross-platform consistency",
|
|
50
|
+
"Add an ADR or security-policy document explaining why test files use @latest while production uses pinned versions, and migrate tests to pinned versions for consistency",
|
|
51
|
+
"Implement dependency scanning in CI to detect known vulnerabilities in optionalDependencies (@metaharness/*, @claude-flow/*)",
|
|
52
|
+
"Verify that all external package.json references are resolved through the safe node_modules resolution path in _invoke.mjs",
|
|
53
|
+
"Document the graceful degradation security model as a design principle in the README"
|
|
54
|
+
],
|
|
55
|
+
"owasp_coverage": {
|
|
56
|
+
"A1_Injection": "✓ PASS — No SQL/command injection risks. Shell disabled, arguments as arrays, no eval/Function",
|
|
57
|
+
"A2_Authentication": "✓ PASS — No auth logic in this plugin; delegates to upstream",
|
|
58
|
+
"A3_Sensitive_Data_Exposure": "✓ PASS — No hardcoded secrets. Uses process.env for credentials",
|
|
59
|
+
"A4_XXE": "✓ PASS — No XML parsing; JSON parsing only",
|
|
60
|
+
"A5_Access_Control": "⚠ PARTIAL — Plugin relies on upstream access control; no internal access validation",
|
|
61
|
+
"A6_Security_Misconfiguration": "⚠ LOW RISK — Test file uses @latest (should use pinned), but isolated to test code",
|
|
62
|
+
"A7_XSS": "✓ PASS — No web/UI code; CLI only",
|
|
63
|
+
"A8_Insecure_Deserialization": "✓ PASS — Strict JSON.parse() with try-catch, no untrusted object deserialization",
|
|
64
|
+
"A9_Vulnerable_Dependencies": "⚠ REVIEW — optionalDependencies should be scanned; version pins are present",
|
|
65
|
+
"A10_Logging_Monitoring": "⚠ PARTIAL — Logs to stdout/stderr; no security-specific audit logging"
|
|
66
|
+
},
|
|
67
|
+
"compliance_notes": {
|
|
68
|
+
"ADR-150_adherence": "✓ PASS — Architectural constraint 'MetaHarness must remain removable' is enforced. Graceful degradation on missing packages.",
|
|
69
|
+
"version_pinning": "⚠ PARTIAL — Production code follows tilde-range pinning; test code uses @latest",
|
|
70
|
+
"subprocess_safety": "✓ PASS — All subprocess invocations use shell:false with array arguments",
|
|
71
|
+
"error_handling": "✓ PASS — Consistent degraded result handling across the codebase"
|
|
72
|
+
},
|
|
73
|
+
"tested_files": [
|
|
74
|
+
"scripts/_harness.mjs",
|
|
75
|
+
"scripts/_redblue.mjs",
|
|
76
|
+
"scripts/_invoke.mjs",
|
|
77
|
+
"scripts/oia-audit.mjs",
|
|
78
|
+
"scripts/learn.mjs",
|
|
79
|
+
"scripts/evolve.mjs",
|
|
80
|
+
"scripts/test-with-openrouter.mjs",
|
|
81
|
+
"scripts/test-similarity.mjs",
|
|
82
|
+
"scripts/redblue.mjs",
|
|
83
|
+
".claude-plugin/plugin.json"
|
|
84
|
+
],
|
|
85
|
+
"scan_date": "2025-07-09",
|
|
86
|
+
"scanner": "Claude Code Security Auditor",
|
|
87
|
+
"project_type": "Node.js CLI Plugin",
|
|
88
|
+
"summary": "The ruflo-metaharness plugin demonstrates strong security practices with consistent version pinning, proper subprocess isolation, and graceful degradation patterns. Security risks are minimal and primarily limited to test code that uses @latest version specifiers. No critical vulnerabilities were found. The plugin correctly implements ADR-150's architectural constraint of remaining an optional augmentation. Recommended remediation focuses on aligning test code practices with production standards and adding minor validation improvements."
|
|
89
|
+
},
|
|
90
|
+
"durationMs": 144778,
|
|
91
|
+
"model": "haiku",
|
|
92
|
+
"sandboxMode": "strict",
|
|
93
|
+
"workerType": "audit",
|
|
94
|
+
"timestamp": "2026-07-09T17:29:53.962Z",
|
|
95
|
+
"executionId": "audit_1783618049184_1f4yah"
|
|
96
|
+
}
|
package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618793925_4ee7tf_prompt.log
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[2026-07-09T17:39:53.947Z] 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.
|