@claude-flow/shared 3.0.0-alpha.1 → 3.0.0-alpha.8
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-flow/daemon-state.json +135 -0
- package/.claude-flow/data/pending-insights.jsonl +2 -0
- package/.claude-flow/data/ranked-context.json +5 -0
- package/.claude-flow/logs/daemon.log +45 -0
- package/.claude-flow/logs/headless/audit_1777379186972_h5un5x_prompt.log +3210 -0
- package/.claude-flow/logs/headless/audit_1777379186972_h5un5x_result.log +117 -0
- package/.claude-flow/logs/headless/audit_1777379816437_w0eaul_prompt.log +3210 -0
- package/.claude-flow/logs/headless/audit_1777379816437_w0eaul_result.log +53 -0
- package/.claude-flow/logs/headless/audit_1777380440097_621y8m_prompt.log +3210 -0
- package/.claude-flow/logs/headless/audit_1777380440097_621y8m_result.log +75 -0
- package/.claude-flow/logs/headless/optimize_1777379306973_an4lmy_prompt.log +3504 -0
- package/.claude-flow/logs/headless/optimize_1777379306973_an4lmy_result.log +166 -0
- package/.claude-flow/logs/headless/optimize_1777380274732_apxz3s_prompt.log +3504 -0
- package/.claude-flow/logs/headless/optimize_1777380274732_apxz3s_result.log +219 -0
- package/.claude-flow/logs/headless/testgaps_1777379546969_dvf2a1_prompt.log +3189 -0
- package/.claude-flow/logs/headless/testgaps_1777379546969_dvf2a1_result.log +155 -0
- package/.claude-flow/metrics/codebase-map.json +11 -0
- package/.claude-flow/metrics/consolidation.json +6 -0
- package/.claude-flow/sessions/current.json +13 -0
- package/.swarm/hnsw.index +0 -0
- package/.swarm/hnsw.metadata.json +1 -0
- package/.swarm/memory.db +0 -0
- package/.swarm/memory.db-shm +0 -0
- package/.swarm/memory.db-wal +0 -0
- package/.swarm/schema.sql +305 -0
- package/dist/core/config/loader.d.ts.map +1 -1
- package/dist/core/config/loader.js +17 -1
- package/dist/core/config/loader.js.map +1 -1
- package/dist/core/config/schema.d.ts +697 -103
- package/dist/core/config/schema.d.ts.map +1 -1
- package/dist/core/config/schema.js +3 -1
- package/dist/core/config/schema.js.map +1 -1
- package/dist/events/event-store.d.ts.map +1 -1
- package/dist/events/event-store.js +20 -9
- package/dist/events/event-store.js.map +1 -1
- package/dist/events/example-usage.js +1 -1
- package/dist/events/example-usage.js.map +1 -1
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +2 -0
- package/dist/events/index.js.map +1 -1
- package/dist/events/rvf-event-log.d.ts +82 -0
- package/dist/events/rvf-event-log.d.ts.map +1 -0
- package/dist/events/rvf-event-log.js +340 -0
- package/dist/events/rvf-event-log.js.map +1 -0
- package/dist/hooks/example-usage.js +3 -3
- package/dist/hooks/example-usage.js.map +1 -1
- package/dist/hooks/executor.d.ts.map +1 -1
- package/dist/hooks/executor.js +7 -4
- package/dist/hooks/executor.js.map +1 -1
- package/dist/hooks/verify-exports.test.js +6 -6
- package/dist/hooks/verify-exports.test.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +3 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/types.d.ts +4 -6
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js.map +1 -1
- package/dist/plugins/official/hive-mind-plugin.js +2 -2
- package/dist/plugins/official/hive-mind-plugin.js.map +1 -1
- package/dist/plugins/official/maestro-plugin.js +3 -3
- package/dist/plugins/official/maestro-plugin.js.map +1 -1
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +7 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/v3-progress.service.d.ts +124 -0
- package/dist/services/v3-progress.service.d.ts.map +1 -0
- package/dist/services/v3-progress.service.js +402 -0
- package/dist/services/v3-progress.service.js.map +1 -0
- package/package.json +12 -3
- package/ruvector.db +0 -0
- package/src/core/config/loader.ts +17 -1
- package/src/core/config/schema.ts +3 -1
- package/src/events/event-store.ts +18 -9
- package/src/events/example-usage.ts +1 -1
- package/src/events/index.ts +4 -0
- package/src/events/rvf-event-log.ts +427 -0
- package/src/hooks/example-usage.ts +3 -3
- package/src/hooks/executor.ts +7 -5
- package/src/hooks/verify-exports.test.ts +6 -6
- package/src/index.ts +5 -0
- package/src/mcp/server.ts +3 -6
- package/src/mcp/types.ts +4 -6
- package/src/plugins/official/hive-mind-plugin.ts +2 -2
- package/src/plugins/official/maestro-plugin.ts +3 -3
- package/src/services/index.ts +16 -0
- package/src/services/v3-progress.service.ts +505 -0
- package/tmp.json +0 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/.agentic-flow/intelligence.json +0 -16
- package/__tests__/coverage/base.css +0 -224
- package/__tests__/coverage/block-navigation.js +0 -87
- package/__tests__/coverage/coverage-final.json +0 -50
- package/__tests__/coverage/favicon.png +0 -0
- package/__tests__/coverage/index.html +0 -326
- package/__tests__/coverage/lcov-report/base.css +0 -224
- package/__tests__/coverage/lcov-report/block-navigation.js +0 -87
- package/__tests__/coverage/lcov-report/favicon.png +0 -0
- package/__tests__/coverage/lcov-report/index.html +0 -326
- package/__tests__/coverage/lcov-report/prettify.css +0 -1
- package/__tests__/coverage/lcov-report/prettify.js +0 -2
- package/__tests__/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/__tests__/coverage/lcov-report/sorter.js +0 -210
- package/__tests__/coverage/lcov-report/src/core/config/defaults.ts.html +0 -706
- package/__tests__/coverage/lcov-report/src/core/config/index.html +0 -161
- package/__tests__/coverage/lcov-report/src/core/config/loader.ts.html +0 -898
- package/__tests__/coverage/lcov-report/src/core/config/schema.ts.html +0 -649
- package/__tests__/coverage/lcov-report/src/core/config/validator.ts.html +0 -712
- package/__tests__/coverage/lcov-report/src/core/event-bus.ts.html +0 -793
- package/__tests__/coverage/lcov-report/src/core/index.html +0 -116
- package/__tests__/coverage/lcov-report/src/core/interfaces/event.interface.ts.html +0 -886
- package/__tests__/coverage/lcov-report/src/core/interfaces/index.html +0 -116
- package/__tests__/coverage/lcov-report/src/core/orchestrator/event-coordinator.ts.html +0 -451
- package/__tests__/coverage/lcov-report/src/core/orchestrator/health-monitor.ts.html +0 -727
- package/__tests__/coverage/lcov-report/src/core/orchestrator/index.html +0 -176
- package/__tests__/coverage/lcov-report/src/core/orchestrator/lifecycle-manager.ts.html +0 -874
- package/__tests__/coverage/lcov-report/src/core/orchestrator/session-manager.ts.html +0 -922
- package/__tests__/coverage/lcov-report/src/core/orchestrator/task-manager.ts.html +0 -1036
- package/__tests__/coverage/lcov-report/src/events/domain-events.ts.html +0 -1837
- package/__tests__/coverage/lcov-report/src/events/event-store.ts.html +0 -1849
- package/__tests__/coverage/lcov-report/src/events/example-usage.ts.html +0 -964
- package/__tests__/coverage/lcov-report/src/events/index.html +0 -176
- package/__tests__/coverage/lcov-report/src/events/projections.ts.html +0 -1768
- package/__tests__/coverage/lcov-report/src/events/state-reconstructor.ts.html +0 -1132
- package/__tests__/coverage/lcov-report/src/events.ts.html +0 -1186
- package/__tests__/coverage/lcov-report/src/hooks/example-usage.ts.html +0 -1582
- package/__tests__/coverage/lcov-report/src/hooks/executor.ts.html +0 -1222
- package/__tests__/coverage/lcov-report/src/hooks/index.html +0 -191
- package/__tests__/coverage/lcov-report/src/hooks/registry.ts.html +0 -1084
- package/__tests__/coverage/lcov-report/src/hooks/safety/bash-safety.ts.html +0 -1897
- package/__tests__/coverage/lcov-report/src/hooks/safety/file-organization.ts.html +0 -1504
- package/__tests__/coverage/lcov-report/src/hooks/safety/git-commit.ts.html +0 -1954
- package/__tests__/coverage/lcov-report/src/hooks/safety/index.html +0 -146
- package/__tests__/coverage/lcov-report/src/hooks/session-hooks.ts.html +0 -1762
- package/__tests__/coverage/lcov-report/src/hooks/task-hooks.ts.html +0 -1624
- package/__tests__/coverage/lcov-report/src/hooks/types.ts.html +0 -1156
- package/__tests__/coverage/lcov-report/src/index.html +0 -176
- package/__tests__/coverage/lcov-report/src/mcp/connection-pool.ts.html +0 -1399
- package/__tests__/coverage/lcov-report/src/mcp/index.html +0 -176
- package/__tests__/coverage/lcov-report/src/mcp/server.ts.html +0 -2407
- package/__tests__/coverage/lcov-report/src/mcp/session-manager.ts.html +0 -1369
- package/__tests__/coverage/lcov-report/src/mcp/tool-registry.ts.html +0 -1783
- package/__tests__/coverage/lcov-report/src/mcp/transport/http.ts.html +0 -1756
- package/__tests__/coverage/lcov-report/src/mcp/transport/index.html +0 -146
- package/__tests__/coverage/lcov-report/src/mcp/transport/stdio.ts.html +0 -1057
- package/__tests__/coverage/lcov-report/src/mcp/transport/websocket.ts.html +0 -1537
- package/__tests__/coverage/lcov-report/src/mcp/types.ts.html +0 -1780
- package/__tests__/coverage/lcov-report/src/plugin-interface.ts.html +0 -2074
- package/__tests__/coverage/lcov-report/src/plugin-loader.ts.html +0 -1999
- package/__tests__/coverage/lcov-report/src/plugin-registry.ts.html +0 -1897
- package/__tests__/coverage/lcov-report/src/plugins/official/hive-mind-plugin.ts.html +0 -1075
- package/__tests__/coverage/lcov-report/src/plugins/official/index.html +0 -131
- package/__tests__/coverage/lcov-report/src/plugins/official/maestro-plugin.ts.html +0 -1609
- package/__tests__/coverage/lcov-report/src/resilience/bulkhead.ts.html +0 -916
- package/__tests__/coverage/lcov-report/src/resilience/circuit-breaker.ts.html +0 -1063
- package/__tests__/coverage/lcov-report/src/resilience/index.html +0 -161
- package/__tests__/coverage/lcov-report/src/resilience/rate-limiter.ts.html +0 -1345
- package/__tests__/coverage/lcov-report/src/resilience/retry.ts.html +0 -757
- package/__tests__/coverage/lcov-report/src/security/index.html +0 -131
- package/__tests__/coverage/lcov-report/src/security/input-validation.ts.html +0 -880
- package/__tests__/coverage/lcov-report/src/security/secure-random.ts.html +0 -562
- package/__tests__/coverage/lcov-report/src/types/index.html +0 -131
- package/__tests__/coverage/lcov-report/src/types/swarm.types.ts.html +0 -850
- package/__tests__/coverage/lcov-report/src/types/task.types.ts.html +0 -700
- package/__tests__/coverage/lcov-report/src/types.ts.html +0 -1186
- package/__tests__/coverage/lcov-report/src/utils/index.html +0 -116
- package/__tests__/coverage/lcov-report/src/utils/secure-logger.ts.html +0 -856
- package/__tests__/coverage/lcov.info +0 -19877
- package/__tests__/coverage/prettify.css +0 -1
- package/__tests__/coverage/prettify.js +0 -2
- package/__tests__/coverage/sort-arrow-sprite.png +0 -0
- package/__tests__/coverage/sorter.js +0 -210
- package/__tests__/coverage/src/core/config/defaults.ts.html +0 -706
- package/__tests__/coverage/src/core/config/index.html +0 -161
- package/__tests__/coverage/src/core/config/loader.ts.html +0 -898
- package/__tests__/coverage/src/core/config/schema.ts.html +0 -649
- package/__tests__/coverage/src/core/config/validator.ts.html +0 -712
- package/__tests__/coverage/src/core/event-bus.ts.html +0 -793
- package/__tests__/coverage/src/core/index.html +0 -116
- package/__tests__/coverage/src/core/interfaces/event.interface.ts.html +0 -886
- package/__tests__/coverage/src/core/interfaces/index.html +0 -116
- package/__tests__/coverage/src/core/orchestrator/event-coordinator.ts.html +0 -451
- package/__tests__/coverage/src/core/orchestrator/health-monitor.ts.html +0 -727
- package/__tests__/coverage/src/core/orchestrator/index.html +0 -176
- package/__tests__/coverage/src/core/orchestrator/lifecycle-manager.ts.html +0 -874
- package/__tests__/coverage/src/core/orchestrator/session-manager.ts.html +0 -922
- package/__tests__/coverage/src/core/orchestrator/task-manager.ts.html +0 -1036
- package/__tests__/coverage/src/events/domain-events.ts.html +0 -1837
- package/__tests__/coverage/src/events/event-store.ts.html +0 -1849
- package/__tests__/coverage/src/events/example-usage.ts.html +0 -964
- package/__tests__/coverage/src/events/index.html +0 -176
- package/__tests__/coverage/src/events/projections.ts.html +0 -1768
- package/__tests__/coverage/src/events/state-reconstructor.ts.html +0 -1132
- package/__tests__/coverage/src/events.ts.html +0 -1186
- package/__tests__/coverage/src/hooks/example-usage.ts.html +0 -1582
- package/__tests__/coverage/src/hooks/executor.ts.html +0 -1222
- package/__tests__/coverage/src/hooks/index.html +0 -191
- package/__tests__/coverage/src/hooks/registry.ts.html +0 -1084
- package/__tests__/coverage/src/hooks/safety/bash-safety.ts.html +0 -1897
- package/__tests__/coverage/src/hooks/safety/file-organization.ts.html +0 -1504
- package/__tests__/coverage/src/hooks/safety/git-commit.ts.html +0 -1954
- package/__tests__/coverage/src/hooks/safety/index.html +0 -146
- package/__tests__/coverage/src/hooks/session-hooks.ts.html +0 -1762
- package/__tests__/coverage/src/hooks/task-hooks.ts.html +0 -1624
- package/__tests__/coverage/src/hooks/types.ts.html +0 -1156
- package/__tests__/coverage/src/index.html +0 -176
- package/__tests__/coverage/src/mcp/connection-pool.ts.html +0 -1399
- package/__tests__/coverage/src/mcp/index.html +0 -176
- package/__tests__/coverage/src/mcp/server.ts.html +0 -2407
- package/__tests__/coverage/src/mcp/session-manager.ts.html +0 -1369
- package/__tests__/coverage/src/mcp/tool-registry.ts.html +0 -1783
- package/__tests__/coverage/src/mcp/transport/http.ts.html +0 -1756
- package/__tests__/coverage/src/mcp/transport/index.html +0 -146
- package/__tests__/coverage/src/mcp/transport/stdio.ts.html +0 -1057
- package/__tests__/coverage/src/mcp/transport/websocket.ts.html +0 -1537
- package/__tests__/coverage/src/mcp/types.ts.html +0 -1780
- package/__tests__/coverage/src/plugin-interface.ts.html +0 -2074
- package/__tests__/coverage/src/plugin-loader.ts.html +0 -1999
- package/__tests__/coverage/src/plugin-registry.ts.html +0 -1897
- package/__tests__/coverage/src/plugins/official/hive-mind-plugin.ts.html +0 -1075
- package/__tests__/coverage/src/plugins/official/index.html +0 -131
- package/__tests__/coverage/src/plugins/official/maestro-plugin.ts.html +0 -1609
- package/__tests__/coverage/src/resilience/bulkhead.ts.html +0 -916
- package/__tests__/coverage/src/resilience/circuit-breaker.ts.html +0 -1063
- package/__tests__/coverage/src/resilience/index.html +0 -161
- package/__tests__/coverage/src/resilience/rate-limiter.ts.html +0 -1345
- package/__tests__/coverage/src/resilience/retry.ts.html +0 -757
- package/__tests__/coverage/src/security/index.html +0 -131
- package/__tests__/coverage/src/security/input-validation.ts.html +0 -880
- package/__tests__/coverage/src/security/secure-random.ts.html +0 -562
- package/__tests__/coverage/src/types/index.html +0 -131
- package/__tests__/coverage/src/types/swarm.types.ts.html +0 -850
- package/__tests__/coverage/src/types/task.types.ts.html +0 -700
- package/__tests__/coverage/src/types.ts.html +0 -1186
- package/__tests__/coverage/src/utils/index.html +0 -116
- package/__tests__/coverage/src/utils/secure-logger.ts.html +0 -856
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
[2026-04-28T12:26:56.433Z] RESULT
|
|
2
|
+
============================================================
|
|
3
|
+
{
|
|
4
|
+
"success": true,
|
|
5
|
+
"output": "# Security Vulnerability Analysis Report\n\nI've analyzed the provided codebase and identified several security vulnerabilities. Here's my detailed assessment:\n\n```json\n{\n \"vulnerabilities\": [\n {\n \"severity\": \"high\",\n \"file\": \"src/core/config/loader.ts\",\n \"line\": 47,\n \"description\": \"Unsafe JSON parsing without size limits. loadJsonConfig() reads files without validating content length, making it vulnerable to denial-of-service attacks via large config files. Could also be exploited by path traversal if config paths are user-controlled.\",\n \"cwe\": \"CWE-400: Uncontrolled Resource Consumption\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"src/core/config/loader.ts\",\n \"line\": 73,\n \"description\": \"Environment variable used in path construction without validation. process.env.HOME could be manipulated to read configs from unintended locations. No symlink attack prevention.\",\n \"cwe\": \"CWE-426: Untrusted Search Path\"\n },\n {\n \"severity\": \"high\",\n \"file\": \"src/core/config/loader.ts\",\n \"line\": 90,\n \"description\": \"Integer overflow risk: process.env.CLAUDE_FLOW_MAX_AGENTS and CLAUDE_FLOW_MCP_PORT are parsed without bounds checking. No validation that values are within safe ranges.\",\n \"cwe\": \"CWE-190: Integer Overflow or Wraparound\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"src/utils/secure-logger.js\",\n \"line\": 45,\n \"description\": \"Regex-based redaction is insufficient. Pattern `/[a-zA-Z0-9+/]{40,}={0,2}/g` for detecting base64 keys may match legitimate content and cause false positives/negatives. Legitimate base64 strings could be incorrectly redacted.\",\n \"cwe\": \"CWE-1104: Use of Unmaintained Third Party Components\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"src/utils/secure-logger.js\",\n \"line\": 64,\n \"description\": \"Missing circular reference handling in sanitizeObject(). Recursive object sanitization without cycle detection could cause stack overflow on circular data structures.\",\n \"cwe\": \"CWE-674: Uncontrolled Recursion\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"src/core/event-bus.ts\",\n \"line\": 90,\n \"description\": \"No input validation on event payloads. Events are dispatched with arbitrary payloads without type checking or sanitization. Could allow injection attacks through event data.\",\n \"cwe\": \"CWE-20: Improper Input Validation\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"src/core/event-bus.ts\",\n \"line\": 110,\n \"description\": \"Async error handling doesn't prevent further event processing. Errors in async event handlers are logged but don't propagate, potentially hiding security issues.\",\n \"cwe\": \"CWE-248: Uncaught Exception\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"src/core/interfaces/memory.interface.ts\",\n \"line\": 15,\n \"description\": \"Arbitrary value storage without encryption. IMemoryEntry stores values without encryption or sanitization. Sensitive data (tokens, passwords) could be exposed if memory backend is compromised.\",\n \"cwe\": \"CWE-312: Cleartext Storage of Sensitive Information\"\n },\n {\n \"severity\": \"medium\",\n \"file\": \"src/core/interfaces/task.interface.ts\",\n \"line\": 25,\n \"description\": \"Error objects stored directly without sanitization. Task errors could contain sensitive stack traces or system information even with secure logger present.\",\n \"cwe\": \"CWE-209: Information Exposure Through an Error Message\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"src/core/interfaces/agent.interface.ts\",\n \"line\": 26,\n \"description\": \"No field size limits on agent metadata. Arbitrary metadata objects could grow unbounded, causing memory exhaustion.\",\n \"cwe\": \"CWE-400: Uncontrolled Resource Consumption\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"src/core/config/loader.ts\",\n \"line\": 88,\n \"description\": \"No validation of topology string enum values. While Zod schemas validate, the direct assignment from environment variables could bypass schema validation if not properly integrated.\",\n \"cwe\": \"CWE-116: Improper Encoding or Escaping of Output\"\n },\n {\n \"severity\": \"low\",\n \"file\": \"src/utils/secure-logger.js\",\n \"line\": 72,\n \"description\": \"Path sanitization regex may not cover all sensitive paths. Windows UNC paths and network locations are not handled.\",\n \"cwe\": \"CWE-200: Exposure of Sensitive Information to an Unauthorized Actor\"\n }\n ],\n \"riskScore\": 68,\n \"recommendations\": [\n \"Implement file size limits in loadJsonConfig() - maximum 1MB for config files, validate before parsing\",\n \"Add path validation in ConfigLoader - use path.resolve() with validation against a whitelist of allowed directories, check for symlinks with fs.realpathSync()\",\n \"Validate all environment variables at startup - use strict bounds checking (0 < CLAUDE_FLOW_MAX_AGENTS <= 1000, port 1024-65535)\",\n \"Replace regex-based sanitization with dedicated security library (e.g., @snyk/protect) or use a whitelist approach for known sensitive patterns\",\n \"Add WeakMap-based circular reference tracking to sanitizeObject() to prevent infinite recursion\",\n \"Implement strict event payload validation - use TypeScript interfaces + runtime validation (Zod) for all event types\",\n \"Add rate limiting to EventBus.emit() to prevent event flooding/DoS attacks\",\n \"Encrypt sensitive data in memory - use crypto.subtle for in-memory encryption of password/token/secret fields\",\n \"Sanitize error objects before storing in tasks - use secure-logger for all error handling\",\n \"Add resource quotas - implement maximum sizes for metadata objects, task inputs/outputs (e.g., 10MB limit)\",\n \"Validate UUID/ID formats with strict regex patterns to prevent injection\",\n \"Update path sanitization regex to handle Windows UNC paths: `/^\\\\\\\\\\\\\\\\[^\\\\\\\\]+\\\\\\\\[^\\\\\\\\]+/`\",\n \"Add comprehensive security audit logging - log all configuration loads, environment variable access, sensitive data sanitization events\",\n \"Implement secrets scanning in pre-commit hooks to prevent accidental commits of API keys/credentials\"\n ]\n}\n```\n\n## Key Findings Summary\n\n**Critical Areas:**\n- **Configuration Loading**: Lacks input validation and bounds checking\n- **Environment Variables**: Not sanitized or validated before use\n- **Data Sanitization**: Regex-based approach is brittle and insufficient\n- **Memory Storage**: No encryption for sensitive data\n\n**Recommendations Priority:**\n1. ⚠️ Implement strict file size and path validation in config loader\n2. ⚠️ Validate all environment variable inputs with bounds checking\n3. ⚠️ Add circular reference detection to prevent DoS via deep objects\n4. ⚠️ Encrypt sensitive data in memory backend\n\nThe codebase has good security-conscious design (secure logger, sanitization functions), but implementation gaps could lead to information disclosure and DoS vulnerabilities.\n",
|
|
6
|
+
"parsedOutput": {
|
|
7
|
+
"vulnerabilities": [
|
|
8
|
+
{
|
|
9
|
+
"severity": "high",
|
|
10
|
+
"file": "src/core/config/loader.ts",
|
|
11
|
+
"line": 47,
|
|
12
|
+
"description": "Unsafe JSON parsing without size limits. loadJsonConfig() reads files without validating content length, making it vulnerable to denial-of-service attacks via large config files. Could also be exploited by path traversal if config paths are user-controlled.",
|
|
13
|
+
"cwe": "CWE-400: Uncontrolled Resource Consumption"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"severity": "high",
|
|
17
|
+
"file": "src/core/config/loader.ts",
|
|
18
|
+
"line": 73,
|
|
19
|
+
"description": "Environment variable used in path construction without validation. process.env.HOME could be manipulated to read configs from unintended locations. No symlink attack prevention.",
|
|
20
|
+
"cwe": "CWE-426: Untrusted Search Path"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"severity": "high",
|
|
24
|
+
"file": "src/core/config/loader.ts",
|
|
25
|
+
"line": 90,
|
|
26
|
+
"description": "Integer overflow risk: process.env.CLAUDE_FLOW_MAX_AGENTS and CLAUDE_FLOW_MCP_PORT are parsed without bounds checking. No validation that values are within safe ranges.",
|
|
27
|
+
"cwe": "CWE-190: Integer Overflow or Wraparound"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"severity": "medium",
|
|
31
|
+
"file": "src/utils/secure-logger.js",
|
|
32
|
+
"line": 45,
|
|
33
|
+
"description": "Regex-based redaction is insufficient. Pattern `/[a-zA-Z0-9+/]{40,}={0,2}/g` for detecting base64 keys may match legitimate content and cause false positives/negatives. Legitimate base64 strings could be incorrectly redacted.",
|
|
34
|
+
"cwe": "CWE-1104: Use of Unmaintained Third Party Components"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"severity": "medium",
|
|
38
|
+
"file": "src/utils/secure-logger.js",
|
|
39
|
+
"line": 64,
|
|
40
|
+
"description": "Missing circular reference handling in sanitizeObject(). Recursive object sanitization without cycle detection could cause stack overflow on circular data structures.",
|
|
41
|
+
"cwe": "CWE-674: Uncontrolled Recursion"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"severity": "medium",
|
|
45
|
+
"file": "src/core/event-bus.ts",
|
|
46
|
+
"line": 90,
|
|
47
|
+
"description": "No input validation on event payloads. Events are dispatched with arbitrary payloads without type checking or sanitization. Could allow injection attacks through event data.",
|
|
48
|
+
"cwe": "CWE-20: Improper Input Validation"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"severity": "medium",
|
|
52
|
+
"file": "src/core/event-bus.ts",
|
|
53
|
+
"line": 110,
|
|
54
|
+
"description": "Async error handling doesn't prevent further event processing. Errors in async event handlers are logged but don't propagate, potentially hiding security issues.",
|
|
55
|
+
"cwe": "CWE-248: Uncaught Exception"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"severity": "medium",
|
|
59
|
+
"file": "src/core/interfaces/memory.interface.ts",
|
|
60
|
+
"line": 15,
|
|
61
|
+
"description": "Arbitrary value storage without encryption. IMemoryEntry stores values without encryption or sanitization. Sensitive data (tokens, passwords) could be exposed if memory backend is compromised.",
|
|
62
|
+
"cwe": "CWE-312: Cleartext Storage of Sensitive Information"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"severity": "medium",
|
|
66
|
+
"file": "src/core/interfaces/task.interface.ts",
|
|
67
|
+
"line": 25,
|
|
68
|
+
"description": "Error objects stored directly without sanitization. Task errors could contain sensitive stack traces or system information even with secure logger present.",
|
|
69
|
+
"cwe": "CWE-209: Information Exposure Through an Error Message"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"severity": "low",
|
|
73
|
+
"file": "src/core/interfaces/agent.interface.ts",
|
|
74
|
+
"line": 26,
|
|
75
|
+
"description": "No field size limits on agent metadata. Arbitrary metadata objects could grow unbounded, causing memory exhaustion.",
|
|
76
|
+
"cwe": "CWE-400: Uncontrolled Resource Consumption"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"severity": "low",
|
|
80
|
+
"file": "src/core/config/loader.ts",
|
|
81
|
+
"line": 88,
|
|
82
|
+
"description": "No validation of topology string enum values. While Zod schemas validate, the direct assignment from environment variables could bypass schema validation if not properly integrated.",
|
|
83
|
+
"cwe": "CWE-116: Improper Encoding or Escaping of Output"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"severity": "low",
|
|
87
|
+
"file": "src/utils/secure-logger.js",
|
|
88
|
+
"line": 72,
|
|
89
|
+
"description": "Path sanitization regex may not cover all sensitive paths. Windows UNC paths and network locations are not handled.",
|
|
90
|
+
"cwe": "CWE-200: Exposure of Sensitive Information to an Unauthorized Actor"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"riskScore": 68,
|
|
94
|
+
"recommendations": [
|
|
95
|
+
"Implement file size limits in loadJsonConfig() - maximum 1MB for config files, validate before parsing",
|
|
96
|
+
"Add path validation in ConfigLoader - use path.resolve() with validation against a whitelist of allowed directories, check for symlinks with fs.realpathSync()",
|
|
97
|
+
"Validate all environment variables at startup - use strict bounds checking (0 < CLAUDE_FLOW_MAX_AGENTS <= 1000, port 1024-65535)",
|
|
98
|
+
"Replace regex-based sanitization with dedicated security library (e.g., @snyk/protect) or use a whitelist approach for known sensitive patterns",
|
|
99
|
+
"Add WeakMap-based circular reference tracking to sanitizeObject() to prevent infinite recursion",
|
|
100
|
+
"Implement strict event payload validation - use TypeScript interfaces + runtime validation (Zod) for all event types",
|
|
101
|
+
"Add rate limiting to EventBus.emit() to prevent event flooding/DoS attacks",
|
|
102
|
+
"Encrypt sensitive data in memory - use crypto.subtle for in-memory encryption of password/token/secret fields",
|
|
103
|
+
"Sanitize error objects before storing in tasks - use secure-logger for all error handling",
|
|
104
|
+
"Add resource quotas - implement maximum sizes for metadata objects, task inputs/outputs (e.g., 10MB limit)",
|
|
105
|
+
"Validate UUID/ID formats with strict regex patterns to prevent injection",
|
|
106
|
+
"Update path sanitization regex to handle Windows UNC paths: `/^\\\\\\\\[^\\\\]+\\\\[^\\\\]+/`",
|
|
107
|
+
"Add comprehensive security audit logging - log all configuration loads, environment variable access, sensitive data sanitization events",
|
|
108
|
+
"Implement secrets scanning in pre-commit hooks to prevent accidental commits of API keys/credentials"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"durationMs": 29461,
|
|
112
|
+
"model": "haiku",
|
|
113
|
+
"sandboxMode": "strict",
|
|
114
|
+
"workerType": "audit",
|
|
115
|
+
"timestamp": "2026-04-28T12:26:56.433Z",
|
|
116
|
+
"executionId": "audit_1777379186972_h5un5x"
|
|
117
|
+
}
|