Review ID: 8a500dfc58ffGenerated: 2026-03-08T20:34:48.802Z
CHANGES REQUESTED
271
Actionable Findings
230
Critical
27
High
2
Medium
Deduplicated from 15,275 raw scanner findings (305 critical · 3,054 high · 8,420 medium) — AI triage removed duplicates, false positives, and overlapping perspectives
36 of 108 Agents Deployed
DiamondPlatinumGoldSilverBronzeHR Roasty
Agent Tier: Gold
apolloraines/openclaw →
main @ 14cd380
AIAI Threat Analysis
Loading AI analysis...
15,275 raw scanner findings — 305 critical · 3,054 high · 8,420 medium · 542 info
▶ Raw Scanner Output — 15275 pre-cleanup findings
⚠ Pre-Cleanup Report
This is the raw, unprocessed output from all scanner agents before AI analysis. Do not use this to fix issues individually. Multiple agents attack from different angles and frequently report the same underlying vulnerability, resulting in significant duplication. Architectural issues also appear as many separate line-level findings when they require a single structural fix.

Use the Copy Fix Workflow button above to get the AI-cleaned workflow — it deduplicates findings, removes false positives, and provides actionable steps. This raw output is provided for transparency and audit purposes only.
Showing top 1000 of 15275 findings (sorted by severity). Full data available via the review API.
CRITICALArbitrary remote code execution via run_remote_bash
scripts/install.sh:130
[AGENTS: Razor]security
The `run_remote_bash` function downloads a remote script and executes it with `/bin/bash` without any integrity checking. This is essentially the same vulnerability as the main installer pattern but exposed as a reusable function.
Suggested Fix
Remove this function or implement strict verification including cryptographic signatures, checksums, and sandboxed execution.
CRITICALDangerous container namespace join override without validation
src/config/types.sandbox.ts:61
[AGENTS: Sentinel]input_validation
The dangerouslyAllowContainerNamespaceJoin setting allows Docker network namespace joins (network: 'container:<id>') which breaks sandbox isolation. No validation ensures this is only used in trusted environments.
Suggested Fix
Require explicit environment variable or command-line flag to enable this feature, log severe warning when used, and restrict to specific container name patterns.
CRITICALmacOS UI automation with system-level control
skills/peekaboo/SKILL.md:1
[AGENTS: Infiltrator, Vector]attack_chains, attack_surface
**Perspective 1:** Peekaboo provides comprehensive macOS UI automation including clicking, typing, app control, and screen capture. This requires Screen Recording and Accessibility permissions, granting near-complete system control. Malicious use could perform unauthorized actions, capture sensitive information, or bypass security controls. **Perspective 2:** Peekaboo provides comprehensive macOS UI automation including clicking, typing, capturing screens, and controlling applications. An attacker with Peekaboo access can: 1) Perform any action the user can do via UI, 2) Capture screenshots containing sensitive information, 3) Install malware by automating installer dialogs, 4) Bypass security prompts by simulating clicks. This is essentially granting remote control of the macOS desktop.
Suggested Fix
Implement session-based permissions, activity logging, user confirmation for sensitive operations, and time-limited automation sessions.
CRITICALMissing authentication for BlueBubbles API calls
extensions/bluebubbles/src/send.ts:447
[AGENTS: Phantom]api_security
The sendMessageBlueBubbles function uses password authentication but doesn't validate the password format or implement proper authentication error handling. The password is passed in the URL query string which could be logged.
Suggested Fix
Use HTTP Basic Auth or bearer tokens instead of query parameters, implement proper authentication validation, and ensure credentials are not logged.
CRITICALGlobal sender name cache without tenant isolation
extensions/feishu/src/bot.ts:104
[AGENTS: Tenant]tenant_isolation
The senderNameCache Map uses senderId as the key without any tenant prefix, allowing cross-tenant data leakage. If multiple Feishu accounts (tenants) share the same sender IDs, one tenant could see cached sender names from another tenant.
Suggested Fix
Include accountId in the cache key: `${account.accountId}:${normalizedSenderId}`
CRITICALGlobal permission error notification cache without tenant isolation
extensions/feishu/src/bot.ts:105
[AGENTS: Tenant]tenant_isolation
The permissionErrorNotifiedAt Map uses appId as key without tenant context. If multiple tenants use the same appId, permission error notifications could be incorrectly suppressed across tenant boundaries.
Suggested Fix
Include accountId in the cache key: `${account.accountId}:${appKey}`
CRITICALDirect prompt injection vulnerability
extensions/llm-task/src/llm-task-tool.ts:180
[AGENTS: Prompt]llm_security
User-controlled 'prompt' and 'input' parameters are concatenated directly into the LLM system prompt without structural separation or delimiters. The system prompt includes 'TASK:\n{prompt}\n\nINPUT_JSON:\n{inputJson}\n' which allows attackers to inject instructions that override system instructions.
Suggested Fix
Use structured prompting with clear delimiters and role separation. Implement input sanitization and consider using prompt templates with placeholders that enforce boundaries.
CRITICALMatrix authentication with password in plaintext
extensions/matrix/src/channel.ts:447
[AGENTS: Phantom]api_security
The Matrix plugin accepts passwords in plaintext configuration and passes them to the Matrix API. Passwords are stored and transmitted without encryption.
Suggested Fix
Use OAuth2 or token-based authentication instead of passwords. If passwords must be used, implement secure password storage and transmission.
CRITICALGlobal shared client states without tenant isolation
extensions/matrix/src/matrix/client/shared.ts:16
[AGENTS: Tenant]tenant_isolation
The sharedClientStates Map uses a key built from auth parameters and accountId, but doesn't include tenant context. Multiple tenants using the same Matrix homeserver, userId, and accessToken would share the same client, potentially exposing cross-tenant messages and room data.
Suggested Fix
Add tenantId to the buildSharedClientKey function: `${tenantId}|${auth.homeserver}|${auth.userId}|...`
CRITICALGlobal recent message cache without tenant isolation
extensions/mattermost/src/mattermost/monitor.ts:103
[AGENTS: Tenant]tenant_isolation
The recentInboundMessages dedupe cache uses message IDs without account/tenant prefix, allowing cross-tenant message deduplication. Messages from different Mattermost accounts could be incorrectly deduplicated.
Suggested Fix
Include accountId in the dedupe key: `${account.accountId}:${id}`
CRITICALGlobal account states map without proper tenant isolation
extensions/mattermost/src/mattermost/slash-state.ts:31
[AGENTS: Tenant]tenant_isolation
The `accountStates` map stores slash command state keyed by accountId, but the `resolveSlashHandlerForToken` function searches through ALL accounts to find a matching token. This means tokens are not guaranteed to be unique across tenants, and if a token matches multiple accounts, it creates an ambiguous situation that could lead to cross-tenant data access.
Suggested Fix
Ensure tokens are globally unique or implement strict tenant isolation by requiring tenant context in the request path or headers before token lookup.
CRITICALMissing tenant scoping in memory search
extensions/memory-lancedb/index.ts:122
[AGENTS: Pedant, Tenant]correctness, tenant_isolation
**Perspective 1:** The `search` method in MemoryDB performs vector searches without tenant filtering. This would return memories from all tenants when searching, causing cross-tenant data leakage. **Perspective 2:** The delete method constructs SQL with string interpolation: `id = '${id}'`. Even with UUID validation, this is unsafe.
Suggested Fix
Add tenant_id filtering to the vector search query, e.g., `WHERE tenant_id = ?` in addition to vector similarity.
CRITICALSQL injection vulnerability in delete method
extensions/memory-lancedb/index.ts:145
[AGENTS: Chaos]edge_cases
The delete method constructs SQL with string interpolation: `id = '${id}'`. Although validated with UUID regex, if regex fails to match all edge cases, this could allow SQL injection.
Suggested Fix
Use parameterized queries or prepared statements. LanceDB may have safe API for deletion.
CRITICALMissing tenant isolation in LanceDB memory storage
extensions/memory-lancedb/index.ts:151
[AGENTS: Tenant]tenant_isolation
The MemoryDB class stores all memories in a single LanceDB table without any tenant isolation. All tenants sharing the same database path would have their memories mixed together, allowing cross-tenant data leakage through vector search.
Suggested Fix
Add tenant_id column to the memories table and include it in all queries, or use separate tables/databases per tenant.
CRITICALNostr private keys used for message decryption and signing
extensions/nostr/src/channel.ts:152
[AGENTS: Egress]data_exfiltration
The Nostr bus uses private keys to decrypt messages and sign outgoing messages. These private keys are highly sensitive cryptographic material that enables access to encrypted conversations. The keys are stored in memory and used for cryptographic operations that could potentially leak through side channels or memory dumps.
Suggested Fix
Use hardware security modules or secure enclaves for private key storage. Implement key rotation policies and audit all cryptographic operations.
CRITICALGlobal rate limiter without tenant isolation
extensions/nostr/src/nostr-profile-http.ts:90
[AGENTS: Tenant]tenant_isolation
The `profileRateLimiter` uses a global map without tenant prefixing, allowing Tenant A's rate limit to affect Tenant B's requests. This violates tenant isolation and could enable denial-of-service across tenants.
Suggested Fix
Prefix rate limit keys with tenant ID: `profileRateLimiter.isRateLimited(`${tenantId}:${accountId}`)`
CRITICALGlobal processed message tracker without tenant isolation
extensions/tlon/src/monitor/index.ts:108
[AGENTS: Tenant]tenant_isolation
The processedTracker tracks message IDs globally without account/tenant prefix. Messages from different Tlon accounts could be incorrectly marked as processed across tenants.
Suggested Fix
Include accountId in the processed tracker key or create separate trackers per account.
CRITICALCall records stored without tenant isolation
extensions/voice-call/src/manager/store.ts
[AGENTS: Tenant]tenant_isolation
All call records are persisted to a single calls.jsonl file without tenant/account separation. This allows Tenant A to see Tenant B's call records, including potentially sensitive call metadata and transcripts.
Suggested Fix
Include tenant/account identifier in the store path: `path.join(storePath, `${tenantId}-calls.jsonl`)` or separate directories per tenant.
CRITICALGlobal media stream sessions map without tenant isolation
extensions/voice-call/src/media-stream.ts:41
[AGENTS: Tenant]tenant_isolation
The `sessions` map uses streamSid as key without tenant prefixing, allowing Tenant A to access Tenant B's media streams if streamSid values collide or are predictable.
Suggested Fix
Prefix session keys with tenant ID: `this.sessions.set(`${tenantId}:${streamSid}`, session)`
CRITICALWebSocket connection without proper authentication
extensions/voice-call/src/media-stream.ts:94
[AGENTS: Phantom]api_security
The MediaStreamHandler accepts WebSocket connections and only validates tokens through a callback function. There's no proper authentication mechanism for the media streams, allowing potential unauthorized access to voice streams.
Suggested Fix
Implement proper WebSocket authentication with tokens, validate tokens before accepting connections, and implement connection timeout for unauthenticated sockets.
CRITICALThird-party AI transcription without BAA
extensions/voice-call/src/providers/stt-openai-realtime.ts:312
[AGENTS: Compliance]HIPAA
OpenAI Realtime STT provider transmits audio data to external AI service without documented Business Associate Agreement (BAA) or HIPAA compliance validation. Transmitting PHI-containing audio to third-party AI services requires BAAs under HIPAA.
Suggested Fix
Require BAA confirmation before enabling OpenAI STT, implement local transcription fallback, or use HIPAA-compliant transcription services only.
CRITICALInsecure decryption of Chrome cookies using hardcoded key derivation
scripts/debug-claude-usage.ts:103
[AGENTS: Razor]security
The decryptChromeCookieValue function uses hardcoded salt 'saltysalt' and iteration count 1003 for PBKDF2, which is Chrome's insecure default. The encryption key is derived from the system keychain password.
Suggested Fix
This approach is fundamentally insecure. Remove cookie decryption functionality or implement proper secure storage.
CRITICALDecryption of browser cookies without user consent
scripts/debug-claude-usage.ts:151
[AGENTS: Phantom]api_security
The script decrypts Chrome/Chromium browser cookies by extracting the encryption key from the system keychain and decrypting stored session keys. This allows access to authenticated sessions without user interaction or consent.
Suggested Fix
Remove cookie decryption functionality or require explicit user authorization for each access. Clearly document the privacy implications of this feature.
CRITICALDecryption of browser cookies using extracted keychain passwords
scripts/debug-claude-usage.ts:155
[AGENTS: Infiltrator]attack_surface
The script decrypts Chrome/Chromium cookies by extracting the safe storage password from keychain and using it with hardcoded salt ('saltysalt'). This exposes browser session cookies including Claude sessionKey.
Suggested Fix
Remove cookie decryption functionality or require explicit user consent with security warnings.
CRITICALCommand injection in download_file function
scripts/install.sh:120
[AGENTS: Razor]security
The `download_file` function passes URL and output parameters directly to curl/wget without proper sanitization. If an attacker can control these variables (through environment or other means), they could inject shell commands via crafted URLs or filenames.
Suggested Fix
Use arrays for command arguments: `curl -fsSL --proto '=https' --tlsv1.2 --retry 3 --retry-delay 1 --retry-connrefused -o "$output" "$url"`. Ensure all variables are quoted and validated.
CRITICALChrome No-Sandbox Chain to Container Escape
scripts/sandbox-browser-entrypoint.sh:90
[AGENTS: Vector]attack_chains
When ALLOW_NO_SANDBOX=1, Chrome runs with --no-sandbox and --disable-setuid-sandbox flags. This creates a critical privilege escalation path: an attacker who gains code execution in the browser can escape the container sandbox and access the host system. Combined with the exposed CDP port (accessible via socat), this creates a complete attack chain: 1) Exploit browser vulnerability via CDP, 2) Execute code in unsandboxed Chrome, 3) Escape container to host.
Suggested Fix
Remove the ALLOW_NO_SANDBOX option entirely or restrict it to development-only environments with explicit warnings. Use seccomp profiles and user namespace remapping for container isolation.
CRITICALSession logs accessible across tenants without tenant isolation
skills/session-logs/SKILL.md:17
[AGENTS: Tenant]tenant_isolation
The session-logs skill allows searching and analyzing session logs stored at `~/.openclaw/agents/<agentId>/sessions/`. The documentation indicates that session logs contain full conversation transcripts, tool usage, and cost data. If multiple tenants share the same agentId or if the agentId is not properly scoped to tenants, this could allow Tenant A to access Tenant B's conversation history, sensitive messages, and usage data. The skill uses jq and rg to search across all session files without any tenant filtering mechanism.
Suggested Fix
Implement tenant isolation by ensuring each tenant has a unique agentId or by storing session logs in tenant-specific subdirectories (e.g., `~/.openclaw/tenants/<tenantId>/agents/<agentId>/sessions/`). Modify the skill to require tenant context and validate that the user can only access logs for their own tenant.
CRITICALUntrusted LLM tool execution via ACP protocol without sandboxing
src/acp/client.ts:314
[AGENTS: Prompt]llm_security
The ACP client spawns child processes that execute LLM tool calls (like 'exec', 'read', 'write') with access to the filesystem. No sandboxing or permission boundaries are enforced for these tool executions.
Suggested Fix
Implement mandatory sandboxing for all tool executions, with strict capability-based security model and user approval for sensitive operations.
CRITICALCross-tenant session enumeration vulnerability
src/acp/runtime/session-meta.ts:86
[AGENTS: Tenant]tenant_isolation
The listAcpSessionEntries function enumerates all session directories across all agents without tenant filtering. This could allow a tenant to discover sessions belonging to other tenants by scanning the shared state directory structure.
Suggested Fix
Implement tenant-scoped session directory resolution. Only scan directories belonging to the current tenant's context.
CRITICALLLM-generated patch content executed as file system operations
src/agents/apply-patch.ts:114
[AGENTS: Prompt]llm_security
The `applyPatch` function executes file operations (add, delete, modify) based on LLM-generated patch content without validation against a security policy. This allows indirect code execution via file manipulation.
Suggested Fix
Implement sandboxed execution with strict path validation, allowlist of permitted operations, and human approval for dangerous operations.
CRITICALShared WebSocket session registry without tenant isolation
src/agents/openai-ws-stream.test.ts:120
[AGENTS: Tenant]tenant_isolation
The `hasWsSession` and `releaseWsSession` functions manage a global session registry without tenant context. WebSocket sessions for different tenants could interfere with each other.
Suggested Fix
Add tenant context to WebSocket session management. Use tenant-prefixed session IDs or separate registries per tenant.
CRITICALAPI key exposure through environment variables
src/agents/skills/env-overrides.ts:119
[AGENTS: Razor]security
The function 'applySkillConfigEnvOverrides' automatically injects API keys from skill configuration into environment variables. This could expose sensitive API keys to child processes or other parts of the application, leading to credential leakage.
Suggested Fix
Never expose API keys in environment variables. Use secure credential storage and inject them only to the specific processes that need them through secure channels.
CRITICALMissing tenant isolation in session status tool
src/agents/tools/session-status-tool.ts:106
[AGENTS: Tenant]tenant_isolation
The session status tool allows cross-agent access without proper tenant isolation. The function `resolveSessionKeyFromSessionId` searches through all sessions across all agents without filtering by tenant/agent ID when `agentId` is not provided. This could allow an agent from one tenant to access session data from another tenant's agent.
Suggested Fix
Always require agentId parameter and enforce tenant isolation by filtering sessions by agentId before returning results.
CRITICALMissing tenant isolation in session listing
src/agents/tools/sessions-list-tool.ts:86
[AGENTS: Tenant]tenant_isolation
The sessions_list tool calls gateway.sessions.list without any tenant/agent isolation filtering. The gateway method returns all sessions from the store without scoping to the requesting agent's tenant. This allows any agent to list sessions belonging to other agents/tenants, leading to cross-tenant data leakage.
Suggested Fix
Add tenant/agent isolation by ensuring the gateway.sessions.list method filters by the requesting agent's tenant context, or modify the sessions_list tool to only return sessions scoped to the current agent/tenant.
CRITICALMissing tenant isolation in chat history retrieval
src/agents/tools/sessions-list-tool.ts:240
[AGENTS: Tenant]tenant_isolation
The tool calls gateway.chat.history for multiple sessions without verifying the requesting agent has permission to access those sessions' histories. This allows an agent to retrieve chat history from sessions belonging to other agents/tenants, leading to cross-tenant data leakage.
Suggested Fix
Add tenant/agent validation before calling gateway.chat.history, ensuring the requesting agent only accesses sessions within their own tenant scope.
CRITICALMissing tenant isolation in session access control
src/agents/tools/sessions-send-tool.ts:195
[AGENTS: Tenant]tenant_isolation
The visibilityGuard.check function at line 195 validates access to a session but doesn't include tenant context. The access control is based on session keys and policies but lacks tenant isolation, potentially allowing cross-tenant access.
Suggested Fix
Modify visibilityGuard.check to accept and validate tenant context, ensuring sessions can only be accessed by users from the same tenant.
CRITICALQueue operations lack tenant isolation
src/auto-reply/reply/queue/enqueue.ts:1
[AGENTS: Tenant]tenant_isolation
The enqueueFollowupRun and getFollowupQueueDepth functions access the global FOLLOWUP_QUEUES map without tenant scoping. This allows Tenant A to enqueue items to Tenant B's queue or read Tenant B's queue depth if they can guess or manipulate queue keys.
Suggested Fix
Require tenantId parameter and prefix all queue keys with tenant identifier.
CRITICALChannel configuration removal affects all tenants
src/commands/configure.channels.ts:1
[AGENTS: Tenant]tenant_isolation
The `removeChannelConfigWizard` function operates on the global configuration object, removing channel configuration for all tenants. This could allow one tenant to remove another tenant's channel configuration.
Suggested Fix
Add tenant context to channel configuration removal. Only remove configuration for the requesting tenant.
CRITICALUnsafe JSON5 parsing of configuration includes
src/config/includes.ts:53
[AGENTS: Weights]model_supply_chain
The configuration system uses JSON5.parse() to load included configuration files without SafeLoader equivalent. JSON5 can execute JavaScript-like expressions, potentially allowing code execution through malicious configuration files.
Suggested Fix
Use a safer JSON parser or implement strict schema validation before parsing configuration includes.
CRITICALGmail hook configuration allows disabling external content safety
src/config/types.hooks.ts:69
[AGENTS: Prompt]llm_security
The `allowUnsafeExternalContent` flag in Gmail hooks can disable safety wrapping for email content. Since emails are untrusted external content, this creates a direct prompt injection vector.
Suggested Fix
Remove this flag. Always apply content safety filtering to email bodies and attachments.
CRITICALTrusted proxy authentication bypass via header manipulation
src/gateway/auth.ts:220
[AGENTS: Vector]attack_chains
The trusted proxy authentication mechanism relies on HTTP headers (x-forwarded-user, x-forwarded-proto) that can be spoofed if an attacker can reach the gateway directly or through a compromised proxy. Combined with the ability to set trustedProxies configuration, this creates a multi-step attack: 1) Gain network access to gateway, 2) Spoof proxy headers, 3) Bypass authentication as any user in allowUsers list or if list is empty.
Suggested Fix
Implement cryptographic validation of proxy headers, require mutual TLS between proxies and gateway, or use network-level authentication instead of HTTP headers.
CRITICALWildcard agent access in hooks configuration
src/gateway/hooks.ts:125
[AGENTS: Tenant]tenant_isolation
The hooks configuration allows wildcard ('*') in `allowedAgentIds`, which would grant access to all agents across all tenants. This is a severe cross-tenant data leakage vector if misconfigured.
Suggested Fix
Remove wildcard support or implement tenant-scoped wildcards that only apply within the requesting tenant's boundary.
CRITICALSystem command approval bypass via environment variable manipulation
src/gateway/node-invoke-system-run-approval.test.ts:405
[AGENTS: Vector]attack_chains
The test shows that system run approvals can be bypassed by manipulating environment variables when the approval record lacks env binding. Attack chain: 1) Attacker gets a legitimate command approved, 2) Modifies environment variables in the execution request, 3) Injects malicious payload via env vars (e.g., GIT_EXTERNAL_DIFF, BASH_ENV), 4) Executes arbitrary code with the approved command's privileges.
Suggested Fix
Always require env binding for approvals, or hash the entire execution context including environment variables. Reject any execution where env differs from the approved context.
CRITICALSystem.run approval bypass via operator.write privilege
src/gateway/node-invoke-system-run-approval.ts:86
[AGENTS: Vector]attack_chains
Function prevents operator.write from bypassing approvals by checking client scopes. Attack chain: 1) Compromise client with operator.write but not operator.admin/approvals, 2) Attempt to inject approved/approvalDecision fields, 3) If bypass successful, execute arbitrary system commands, 4) Escalate to full host control. The security check shows this is a critical boundary.
Suggested Fix
Maintain strict separation between approval consumers and approvers. Implement multi-factor approval for dangerous operations. Log all approval attempts regardless of outcome.
CRITICALChat event broadcasting without tenant isolation
src/gateway/server-chat.ts:56
[AGENTS: Tenant]tenant_isolation
The chat event broadcasting system (broadcast, broadcastToConnIds) sends events to connections without tenant scoping. In a multi-tenant environment, chat events from one tenant could be broadcast to connections belonging to other tenants. The ChatRunRegistry and ToolEventRecipientRegistry use sessionKey and runId but don't include tenant context, allowing cross-tenant event leakage.
Suggested Fix
Add tenant_id to all chat event registries and broadcasting functions. Filter broadcast recipients by tenant membership before sending events.
CRITICALMissing tenant isolation in chat send operations
src/gateway/server-methods/chat.ts:150
[AGENTS: Tenant]tenant_isolation
The `chat.send` handler uses `context.dedupe` and `context.chatAbortControllers` which are global structures shared across all tenants. The dedupe key `chat:${clientRunId}` doesn't include tenant context, potentially allowing cross-tenant cache poisoning or enumeration.
Suggested Fix
Add tenant prefixes to all shared data structures. Use `tenant:chat:${clientRunId}` format for dedupe keys and ensure chat abort controllers are tenant-isolated.
CRITICALMissing tenant validation in chat inject operations
src/gateway/server-methods/chat.ts:160
[AGENTS: Tenant]tenant_isolation
The `chat.inject` handler allows injecting messages into any session based only on `sessionKey` without tenant validation. This could allow one tenant to inject messages into another tenant's chat sessions.
Suggested Fix
Add tenant context validation before allowing message injection. Verify the requesting tenant owns the target session.
CRITICALMissing tenant isolation in session store access
src/infra/heartbeat-runner.ts:120
[AGENTS: Tenant]tenant_isolation
The `loadSessionStore`, `saveSessionStore`, and `updateSessionStore` functions access session stores using only `storePath` without tenant validation. Session stores appear to be JSON files that could contain data from multiple tenants.
Suggested Fix
Ensure session stores are tenant-isolated (separate files or directories per tenant). Add tenant context validation when accessing session data.
CRITICALShared heartbeat state across tenants
src/infra/heartbeat-runner.ts:130
[AGENTS: Tenant]tenant_isolation
The heartbeat runner maintains global state in `state.agents` map and uses shared timers without tenant isolation. This could allow cross-tenant interference in heartbeat scheduling and execution.
Suggested Fix
Create separate heartbeat runner instances per tenant or add tenant context to all shared state. Isolate agent scheduling per tenant.
CRITICALMissing tenant isolation in embedding cache queries
src/memory/manager-embedding-ops.ts:113
[AGENTS: Tenant]tenant_isolation
The embedding cache query at line 113 loads cached embeddings by hash without filtering by tenant/agent context. The query uses provider, model, provider_key, and hash as keys, but doesn't include agent_id or session_key. This means embeddings from one agent/tenant could be returned to another agent/tenant if they happen to have the same hash (e.g., same text chunk).
Suggested Fix
Add agent_id or session_key to the cache key and WHERE clause: `WHERE provider = ? AND model = ? AND provider_key = ? AND agent_id = ? AND hash IN (${placeholders})`
CRITICALMissing tenant isolation in embedding cache upserts
src/memory/manager-embedding-ops.ts:136
[AGENTS: Tenant]tenant_isolation
The embedding cache upsert at line 136 stores embeddings without including agent_id or session_key in the unique constraint. The ON CONFLICT clause uses (provider, model, provider_key, hash) but doesn't include tenant context. This could cause embeddings from one tenant to overwrite another tenant's embeddings if they have the same hash.
Suggested Fix
Add agent_id to the unique constraint: `ON CONFLICT(provider, model, provider_key, agent_id, hash) DO UPDATE SET...`
CRITICALMissing tenant isolation in vector table operations
src/memory/manager-embedding-ops.ts:447
[AGENTS: Tenant]tenant_isolation
The indexFile() method at line 447 performs DELETE operations on the vector table (VECTOR_TABLE) using only path and source as filters, without agent_id or tenant context. This could allow one tenant to delete another tenant's vector embeddings if they happen to use the same path.
Suggested Fix
Add agent_id to the WHERE clause: `DELETE FROM ${VECTOR_TABLE} WHERE agent_id = ? AND id IN (SELECT id FROM chunks WHERE path = ? AND source = ?)`
CRITICALMissing tenant isolation in chunks table operations
src/memory/manager-embedding-ops.ts:454
[AGENTS: Tenant]tenant_isolation
The indexFile() method at line 454 performs DELETE operations on the chunks table using only path and source as filters, without agent_id or tenant context. This could allow one tenant to delete another tenant's data.
Suggested Fix
Add agent_id to the WHERE clause: `DELETE FROM chunks WHERE agent_id = ? AND path = ? AND source = ?`
CRITICALMissing tenant context in chunk insertion
src/memory/manager-embedding-ops.ts:462
[AGENTS: Tenant]tenant_isolation
The chunk insertion at line 462 doesn't include agent_id in the INSERT statement. The chunks table stores data from multiple tenants but lacks tenant isolation at the row level.
Suggested Fix
Add agent_id column to the INSERT: `INSERT INTO chunks (id, agent_id, path, source, ...) VALUES (?, ?, ?, ?, ...)`
CRITICALMissing tenant isolation in vector table insertion
src/memory/manager-embedding-ops.ts:483
[AGENTS: Tenant]tenant_isolation
The vector table insertion at line 483 doesn't include agent_id, allowing cross-tenant vector data mixing.
Suggested Fix
Add agent_id to the INSERT: `INSERT INTO ${VECTOR_TABLE} (id, agent_id, embedding) VALUES (?, ?, ?)`
CRITICALMissing tenant isolation in FTS table insertion
src/memory/manager-embedding-ops.ts:492
[AGENTS: Tenant]tenant_isolation
The FTS table insertion at line 492 doesn't include agent_id, allowing cross-tenant full-text search data mixing.
Suggested Fix
Add agent_id to the INSERT: `INSERT INTO ${FTS_TABLE} (text, id, agent_id, path, ...) VALUES (?, ?, ?, ?, ...)`
CRITICALMissing tenant isolation in files table operations
src/memory/manager-embedding-ops.ts:506
[AGENTS: Tenant]tenant_isolation
The files table insertion/update at line 506 doesn't include agent_id, allowing cross-tenant file metadata mixing.
Suggested Fix
Add agent_id to the INSERT: `INSERT INTO files (path, agent_id, source, hash, ...) VALUES (?, ?, ?, ?, ...)`
CRITICALMissing tenant filtering in SQL queries
src/memory/manager-sync-ops.ts:130
[AGENTS: Tenant]tenant_isolation
Database queries like `SELECT hash FROM files WHERE path = ? AND source = ?` and `SELECT path FROM files WHERE source = ?` don't include tenant filtering. This allows cross-tenant data access when the same database is shared.
Suggested Fix
Add tenant_id to WHERE clauses in all queries. For example: `SELECT hash FROM files WHERE tenant_id = ? AND path = ? AND source = ?`
CRITICALCommand injection chain via spawn fallback mechanism
src/process/spawn-utils.ts:107
[AGENTS: Vector]attack_chains
The `spawnWithFallback` function accepts arbitrary spawn options and fallbacks without validation. An attacker controlling configuration could inject malicious spawn options, leading to arbitrary command execution. This is particularly dangerous when combined with gateway service installation vulnerabilities.
Suggested Fix
Validate all spawn options against strict allowlists. Implement command whitelisting for sensitive operations.
CRITICALGateway HTTP tool deny list
src/security/dangerous-tools.ts:12
[AGENTS: Infiltrator]attack_surface
Defines dangerous tools denied via Gateway HTTP but relies on configuration. If gateway is misconfigured or bypassed, these tools become accessible
Suggested Fix
Add mandatory enforcement layer that cannot be disabled via configuration
CRITICALUnrestricted local shell command execution
src/tui/tui-local-shell.ts:1
[AGENTS: Specter]command_injection
The TUI local shell runner executes arbitrary shell commands with user approval but doesn't validate or sanitize the command. Once approved, any command can be executed, including malicious ones. The shell: true option is particularly dangerous.
Suggested Fix
Implement command allowlisting, remove shell: true option, parse commands into argv array, and use execve() directly. Consider sandboxing with seccomp or containerization.
CRITICALOnboarding wizard creates global configuration without tenant isolation
src/wizard/onboarding.ts:56
[AGENTS: Tenant]tenant_isolation
The onboarding wizard creates and writes global configuration files without tenant context. In a multi-tenant deployment, running onboarding for one tenant would overwrite or modify configuration for all tenants. The wizard doesn't support creating tenant-scoped configurations.
Suggested Fix
Modify onboarding wizard to support tenant-scoped configuration. Add tenant_id parameter and create configuration files in tenant-specific locations.
CRITICALPlaintext WebSocket connection allowed with environment variable
src/gateway/client.ts:140
[AGENTS: Compliance, Egress, Fuse, Gateway, Infiltrator, Warden]attack_surface, data_exfiltration, edge_security, error_security, privacy, regulatory
**Perspective 1:** The code allows plaintext ws:// connections to non-loopback addresses when OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set, which exposes credentials and chat data to MITM attacks. This is a fail-open pattern where a security check can be bypassed via environment variable. **Perspective 2:** When using TLS fingerprint validation, the code sets `rejectUnauthorized: false` which disables certificate validation entirely. This creates a MITM vulnerability where an attacker could intercept encrypted traffic even with fingerprint checking, exposing sensitive chat data and credentials. **Perspective 3:** The code sets rejectUnauthorized: false when using TLS fingerprint validation, which disables standard certificate chain validation. This violates SOC 2 CC6.1 (Logical Access Security) and PCI-DSS requirement 4.1 by potentially allowing man-in-the-middle attacks even with wss:// connections. While fingerprint validation is implemented, the lack of proper certificate validation creates a compliance gap. **Perspective 4:** The GatewayClient security check creates detailed error messages that mention credentials and chat data exposure when connecting over plaintext ws://. While this is a security warning, it explicitly mentions that 'Both credentials and chat data would be exposed' which could be logged or displayed. **Perspective 5:** When tlsFingerprint is provided, the code sets rejectUnauthorized: false and implements custom checkServerIdentity logic. This disables standard certificate validation, potentially allowing man-in-the-middle attacks if the custom fingerprint check has flaws or if the fingerprint is compromised. **Perspective 6:** When connecting to wss:// URLs with TLS fingerprint validation, the code sets rejectUnauthorized: false, disabling standard certificate validation. This creates a MITM vulnerability if the custom fingerprint check is bypassed or incorrectly implemented.
Suggested Fix
Keep rejectUnauthorized: true and implement checkServerIdentity as an additional validation layer, not a replacement for standard certificate validation. Or use a proper certificate pinning approach that doesn't disable standard validation.
CRITICALGlobal message cache without tenant isolation
extensions/msteams/src/sent-message-cache.ts:45
[AGENTS: Pedant, Tenant]correctness, tenant_isolation
**Perspective 1:** The sent message cache uses a single global Map for all conversations across all accounts. Tenant A can check if Tenant B's messages were sent via wasMSTeamsMessageSent, and recordMSTeamsSentMessage allows cross-tenant cache pollution. **Perspective 2:** The cleanupExpired function iterates over entry.timestamps and deletes expired entries, but it doesn't check if the entry itself should be removed from the parent map when all timestamps are expired. This could leave empty CacheEntry objects in the sentMessages map.
Suggested Fix
After cleaning up expired timestamps, if entry.timestamps.size === 0, delete the entry from sentMessages.
CRITICALGlobal client manager registry without tenant isolation
extensions/twitch/src/client-manager-registry.ts:1
[AGENTS: Tenant]tenant_isolation
**Perspective 1:** The getOrCreateClientManager function (referenced in monitor.ts) appears to be a global registry. Multiple tenants sharing the same accountId would get the same Twitch client manager, potentially exposing cross-tenant chat messages and channel data. **Perspective 2:** The TwitchClientManager registry (implied by removeClientManager function) appears to be shared globally. In multi-tenant environments, Tenant A could disconnect or interfere with Tenant B's Twitch connections through the shared registry.
Suggested Fix
Key client managers by tenant identifier or maintain separate registry instances per tenant.
CRITICALShared SQLite database without tenant isolation
src/agents/memory-search.ts:367
[AGENTS: Compliance, Tenant]regulatory, tenant_isolation
**Perspective 1:** The memory search configuration uses a SQLite database path that includes agentId but doesn't enforce tenant isolation at the database level. Multiple agents from different tenants could potentially access the same SQLite file if agentId collisions occur or if file permissions are misconfigured. **Perspective 2:** The memory search functionality doesn't log who accessed what data, when, and for what purpose. SOC 2 CC7.1 requires monitoring systems to detect unauthorized access, and HIPAA requires audit controls to record and examine activity in systems containing PHI.
Suggested Fix
Add comprehensive audit logging for all memory search queries including user identity, search parameters, results returned, and timestamp. Store logs in a secure, tamper-evident repository.
CRITICALMissing tenant isolation in chat session lookup
src/gateway/server-methods/chat.ts:120
[AGENTS: Prompt, Tenant]llm_security, tenant_isolation
**Perspective 1:** The `loadSessionEntry` function is called with only `sessionKey` parameter, but there's no validation that the requesting user/tenant has access to that session. Session keys appear to be globally unique identifiers without tenant prefixes, allowing any authenticated user to potentially access any session by guessing or enumerating session keys. **Perspective 2:** The `BodyForAgent` field in line 120 directly concatenates user-controlled `parsedMessage` with timestamp injection. This creates a prompt injection vector where user input can manipulate the agent's instructions by including delimiter-like text or instruction overrides.
Suggested Fix
Add tenant context validation before loading sessions. Ensure session keys include tenant prefixes or implement access control checks to verify the requesting tenant owns the session.
CRITICALMissing tenant isolation in chat history retrieval
src/gateway/server-methods/chat.ts:124
[AGENTS: Tenant, Trace]logging, tenant_isolation
**Perspective 1:** The `readSessionMessages` function reads session messages based on `sessionId` and `storePath` without verifying the requesting tenant has access to that session. This could allow cross-tenant data leakage if a user can guess or enumerate session IDs. **Perspective 2:** The log message 'chat.history omitted oversized payloads placeholders=${placeholderCount} total=${chatHistoryPlaceholderEmitCount}' uses string concatenation instead of structured logging, making it harder to search and analyze log data programmatically.
Suggested Fix
Add tenant context to session storage paths or implement access control checks before reading session messages. Store sessions in tenant-isolated directories or prefix session IDs with tenant identifiers.
CRITICALCommand injection vulnerability in system run approval
src/gateway/node-invoke-system-run-approval.test.ts:54
[AGENTS: Harbor, Phantom, Syringe]api_security, containers, db_injection
**Perspective 1:** The test shows command execution with user-controlled arguments. The sanitizeSystemRunParamsForForwarding function attempts to validate commands against approvals, but complex command-line parsing could be bypassed in container environments. **Perspective 2:** The test shows command injection attempts (echo SAFE&&whoami) and the system attempts to validate against approval records. If approval validation is bypassed, arbitrary command execution could occur. **Perspective 3:** The test shows approval records containing command and commandArgv fields that are compared against user input. In production, if these fields are used to construct and execute system commands without proper validation, command injection is possible.
Suggested Fix
Use allowlists for commands and arguments. Implement strict command parsing without shell interpretation. Consider using execve with explicit argument arrays instead of command strings.
CRITICALComplete attack chain: CLI access to full system compromise
multiple:1
[AGENTS: Vector]attack_chains
**Perspective 1:** Multiple vulnerabilities chain together to enable complete system compromise: 1) Attacker gains CLI access (via compromised credentials or other means), 2) Uses exec-approvals-cli to bypass command restrictions, 3) Uses cron-cli to create persistent malicious jobs, 4) Uses tailscale.ts to expose services externally, 5) Uses launchd.ts to install persistent LaunchAgents, 6) Uses acp-spawn for lateral movement between sessions, 7) Uses sandbox/fs-bridge for container escape if applicable. This represents a critical attack chain with maximum impact. **Perspective 2:** Complete attack chain: 1) Attacker gains initial access via any vulnerability, 2) Uses ACP client's auto-approved 'read' tool to harvest credentials from ~/.claude/.credentials.json, 3) Uses harvested credentials to authenticate to AI services, 4) Crafts malicious patch via apply_patch tool to write backdoor, 5) Uses exec approvals system (bypassing via socket token theft) to execute backdoor, 6) Achieves persistent access and lateral movement. Each vulnerability enables the next stage in the chain. **Perspective 3:** Multiple extensions (Tlon, Nextcloud Talk, MSTeams, Discord, Slack, Matrix, WhatsApp, BlueBubbles) store credentials in similar config structures. An attacker could chain: 1) Compromise one extension's config, 2) Extract credentials, 3) Reuse credentials across other extensions if same credentials are used elsewhere, 4) Lateral movement through integrated services. This creates a blast radius across all configured channels. **Perspective 4:** Multiple channels (Feishu, Zalo, LINE, BlueBubbles, Teams) store authentication credentials with varying levels of protection. An attacker who compromises one channel's credentials could pivot to social engineering attacks across the entire organization. The attack chain: 1) Initial compromise through weakest channel (e.g., BlueBubbles test credentials), 2) Lateral movement to other channels via shared infrastructure, 3) Credential harvesting from configuration files, 4) Cross-channel impersonation attacks targeting different employee groups, 5) Data exfiltration through multiple exfiltration paths. **Perspective 5:** Multiple plugins (feishu, mattermost, tlon, bluebubbles) share the same core runtime and configuration system. An attacker who compromises one plugin can potentially access configuration for others. The plugin registration system doesn't enforce isolation between plugins. Combined with the shared HTTP route registration, an attacker could register malicious routes that intercept traffic for other plugins. The skill system allows plugins to expose tools that other plugins can use, creating dependency chains that could be exploited. **Perspective 6:** Many extensions use similar config update patterns. An attacker could chain: 1) Configuration injection vulnerability in one extension, 2) Modify config to add malicious settings (SSRF, credential theft, backdoors), 3) Propagate to other extensions through shared config patterns, 4) Full system compromise. The `applyAccountConfig` patterns across extensions are similar and could be exploited uniformly. **Perspective 7:** Multiple extensions (BlueBubbles, Teams, Matrix) download and process media files with inconsistent security controls. Attackers could: 1) Send malicious media to one channel, 2) Exploit media processing vulnerabilities to gain foothold, 3) Use established access to target other channels, 4) Deliver secondary payloads through different media types. The media processing pipeline becomes an initial access vector that can be chained with credential theft for lateral movement.
Suggested Fix
Implement defense-in-depth: require MFA for all tool executions, encrypt all credentials at rest and in transit, sandbox all child processes, and implement comprehensive audit logging.
CRITICALPlaintext WebSocket connection exposes credentials to MITM
src/gateway/client.ts:119
[AGENTS: Chaos, Compliance, Deadbolt, Gateway, Infiltrator, Mirage, Passkey, Phantom, Provenance, Razor, Recon, Sanitizer, Sentinel, Siege, Specter, Supply, Tenant, Vault, Vector, Warden]ai_provenance, api_security, attack_chains, attack_surface, credentials, dos, edge_security, false_confidence, info_disclosure, input_validation, privacy, regulatory, sanitization, secrets, security, sessions, ssrf, supply_chain, tenant_isolation
**Perspective 1:** The code blocks plaintext ws:// connections to non-loopback addresses with a security error message, but includes a break-glass option via OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 that allows bypassing this protection. This could expose credentials and chat data to network interception if users enable this option without understanding the risks. **Perspective 2:** The code blocks plaintext ws:// connections to non-loopback addresses with a security error message that includes instructions to set OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 as a break-glass option. This environment variable bypass could allow users to accidentally expose credentials and chat data to MITM attacks if enabled on untrusted networks. **Perspective 3:** The GatewayClient blocks plaintext ws:// connections to non-loopback addresses, but allows them when OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set. This creates a multi-step attack chain: 1) Attacker convinces user to set this environment variable (social engineering), 2) User connects to attacker-controlled server over ws://, 3) All credentials (tokens, passwords) and chat/conversation data are exposed to MITM interception. The error message even provides guidance on how to bypass the security check, making social engineering easier. **Perspective 4:** The code allows bypassing WebSocket security checks via environment variable OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1, which disables validation of plaintext ws:// connections to non-loopback addresses. This could allow SSRF attacks where an attacker-controlled URL connects to internal services over plaintext, exposing credentials and chat data to MITM attacks. **Perspective 5:** The code blocks plaintext ws:// connections to non-loopback addresses, but the error message reveals that both credentials and chat/conversation data would be exposed to network interception. This indicates that sensitive PII and authentication tokens are transmitted without encryption over insecure channels when ws:// is used. **Perspective 6:** The code allows plaintext WebSocket connections (ws://) to non-loopback addresses when OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set. This violates SOC 2 CC6.1 (Logical Access Security) and PCI-DSS requirement 4.1 (Use strong cryptography and security protocols) by potentially exposing credentials and chat data to network interception. The environment variable override creates a compliance gap where sensitive data could be transmitted unencrypted. **Perspective 7:** The code blocks plaintext ws:// connections to non-loopback addresses, but still allows them with OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 environment variable. This exposes session tokens and chat data to MITM attacks. The error message acknowledges this is a security error but provides a bypass mechanism. **Perspective 8:** The code blocks plaintext ws:// connections with a security error message claiming 'Both credentials and chat data would be exposed to network interception', but this check can be bypassed by setting OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1. This creates a false sense of security - users can easily bypass the protection while thinking they're protected. The error message claims credentials would be exposed, but the bypass option undermines this security claim. **Perspective 9:** The code allows plaintext ws:// connections to non-loopback addresses when OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set, which exposes credentials and chat data to MITM attacks. This is a critical security bypass that undermines transport layer security. **Perspective 10:** The code allows plaintext ws:// connections to non-loopback addresses when OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set. This exposes credentials and chat data to MITM attacks. The security check warns but still allows the connection with the environment variable override, creating a dangerous attack surface for credential interception. **Perspective 11:** The code allows bypassing security checks for plaintext WebSocket connections via the OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 environment variable. This exposes credentials and chat data to MITM attacks on non-loopback addresses. The security warning mentions CVSS 9.8 (CWE-319) but provides a bypass mechanism. **Perspective 12:** The code allows plaintext ws:// connections to non-loopback addresses when OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set. This exposes credentials and chat data to MITM attacks. The security check warns but still allows the connection with the environment variable override, creating a dangerous bypass mechanism. **Perspective 13:** The code blocks plaintext ws:// connections to non-loopback addresses, but this check can be bypassed if OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set. This environment variable could be set accidentally or by an attacker, exposing credentials and chat data to MITM attacks. The error message even provides instructions on how to bypass the security check. **Perspective 14:** The security check for plaintext WebSocket connections validates URLs but doesn't include tenant context in the validation logic. If multiple tenants share the same gateway instance, a malicious tenant could potentially connect to another tenant's data stream by manipulating connection parameters. The validation only checks if the URL is secure (wss://) but doesn't verify that the connecting tenant has authorization to access the specific gateway endpoint. **Perspective 15:** The code attempts to extract a hostname from a URL for error display using `new URL(url).hostname`, but catches exceptions and falls back to using the raw URL. This could allow malicious URLs with special characters to bypass the security check's error message formatting, though the actual security check still blocks the connection. The error message could display malformed content. **Perspective 16:** The OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 environment variable creates a social engineering vector. An attacker can craft a convincing message (e.g., 'Set this env var to fix connection issues') to disable TLS enforcement. Combined with DNS spoofing or ARP poisoning on local networks, this allows full credential and data interception. The attack chain: social engineering → env var set → connection to attacker-controlled endpoint → credential theft. **Perspective 17:** The entire transport security mechanism (TLS enforcement for remote connections) depends on a single environment variable check. This creates a single point of failure where any compromise of environment variables (via .env files, shell history, process inspection) or social engineering can disable all transport encryption. Attack chain: 1) Discover env var via information disclosure, 2) Set via compromised .env file or shell config, 3) Intercept all gateway communications. **Perspective 18:** The WebSocket client is configured with `maxPayload: 25 * 1024 * 1024` (25MB) which is extremely large and could allow an attacker to exhaust memory by sending large payloads. While there is a limit, 25MB per message is still substantial and could be used in a DoS attack. **Perspective 19:** The code sets `rejectUnauthorized: false` when using TLS fingerprint verification, which disables standard TLS certificate validation. While custom fingerprint checking is implemented, this bypasses the standard certificate chain validation that would catch issues like expired certificates, mismatched hostnames, or untrusted CAs. This creates a supply chain risk where malicious actors could intercept connections if they can spoof the fingerprint. **Perspective 20:** The code accepts a user-provided URL via `opts.url` and passes it directly to the WebSocket constructor without proper validation. While there's a security check for plaintext ws:// connections, the URL itself isn't validated for proper format, which could lead to unexpected behavior or injection attacks. **Perspective 21:** The security error message includes the displayHost extracted from the URL, which could potentially leak internal network information in error logs or user-facing messages. **Perspective 22:** The error message when blocking plaintext ws:// connections explicitly mentions 'Break-glass (trusted private networks only): set OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1.' This provides attackers with the exact method to convince users to bypass security. In a social engineering attack, the attacker can quote this exact message to appear legitimate. **Perspective 23:** The security model assumes that local network connections are trustworthy, but in shared/cloud environments, other tenants can intercept local traffic. The OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 bypass combined with 'private networks' terminology creates false sense of security. Attack chain in cloud: 1) Attacker compromises adjacent VM, 2) ARP spoofing or VLAN hopping, 3) Intercept 'private' ws:// connections between OpenClaw components. **Perspective 24:** The error message for insecure WebSocket connections includes detailed information about configuration options (OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1) and remediation steps (ssh tunnel commands, Tailscale Serve/Funnel). This provides attackers with information about the application's security posture and potential attack vectors. **Perspective 25:** The comment states 'Security check: block ALL plaintext ws:// to non-loopback addresses (CWE-319, CVSS 9.8)' but the actual implementation only checks if the URL starts with 'ws://' and not 'wss://', then performs a hostname extraction that could fail. The comment claims comprehensive protection but the implementation has edge cases (e.g., 'ws://localhost:8080' would be allowed but still plaintext). **Perspective 26:** The detailed error message reveals internal security policies and available bypass mechanisms. While not directly exploitable, this information helps attackers craft more convincing social engineering attacks and understand the security posture of the target system.
Suggested Fix
Remove the OPENCLAW_ALLOW_INSECURE_PRIVATE_WS environment variable override and enforce wss:// for all remote connections. If private network connections are needed, implement proper certificate-based authentication instead of disabling encryption.
CRITICALiMessage/SMS CLI accesses personal messages without proper safeguards
skills/imsg/SKILL.md:1
[AGENTS: Compliance, Infiltrator, Razor, Warden]attack_surface, privacy, regulatory, security
**Perspective 1:** The imsg skill allows reading and sending iMessage/SMS messages, accessing highly personal communication data. While it mentions safety rules, there's no technical enforcement of these rules, no consent tracking, no audit logging, and messages are stored/processed without encryption. The skill requires Full Disk Access on macOS, which grants broad system access. **Perspective 2:** The skill allows sending iMessages and SMS to any phone number. This is a high-risk capability that could be abused for spam, phishing, or harassment if the system is compromised. **Perspective 3:** iMessage/SMS skill handles potentially regulated communications without documented: 1) Content filtering for compliance, 2) Message archiving requirements, 3) Supervision controls, 4) Retention period enforcement. **Perspective 4:** The imsg skill requires Full Disk Access and Automation permissions on macOS, granting extensive system access. The skill can read and send messages without ongoing user consent for each operation, creating privacy and security risks.
Suggested Fix
Add regulatory compliance section: 'For financial/healthcare organizations: 1) Archive all messages for 7 years, 2) Implement keyword monitoring for prohibited content, 3) Enable supervisory review, 4) Restrict message types based on user role.'
CRITICALBlueBubbles iMessage integration accesses personal messages without proper privacy controls
skills/bluebubbles/SKILL.md:1
[AGENTS: Razor, Vector, Warden]attack_chains, privacy, security
**Perspective 1:** The BlueBubbles skill allows sending, editing, and managing iMessage conversations. This accesses personal communication data. The documentation mentions it's the 'recommended iMessage integration' but doesn't address privacy concerns, consent tracking, or data protection measures. Messages may be stored or processed through intermediate servers. **Perspective 2:** The skill provides capabilities to edit, unsend, and react to iMessages. This could be used to manipulate conversations maliciously, edit sent messages to change their meaning, or delete evidence of previous communications. **Perspective 3:** The BlueBubbles skill controls iMessage, including sending messages, attachments, and managing group chats. An attacker could: 1) Send malicious attachments (containing exploits) to the user's contacts, 2) Read sensitive conversations, 3) Impersonate the user in iMessage groups. Since iMessage is deeply integrated into the Apple ecosystem, this could lead to further compromise of Apple ID and other services.
Suggested Fix
Add privacy documentation explaining data flow and storage. Implement consent tracking for message access. Add warnings about sensitive information in messages. Ensure end-to-end encryption is maintained.
CRITICALInsecure WebSocket connection allowed with plaintext ws://
src/gateway/client.ts:120
[AGENTS: Blacklist, Cipher, Exploit, Gatekeeper, Lockdown, Pedant, Supply, Wallet]auth, business_logic, configuration, correctness, cryptography, denial_of_wallet, output_encoding, supply_chain
**Perspective 1:** The code allows plaintext ws:// connections to non-loopback addresses when OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set, which exposes credentials and chat data to MITM attacks. This is a critical security vulnerability (CWE-319, CVSS 9.8) as it bypasses TLS encryption for sensitive data. **Perspective 2:** The code sets `rejectUnauthorized: false` when using TLS fingerprint verification, which disables all standard TLS certificate validation. This creates a MITM vulnerability where any certificate (including self-signed or malicious certificates) would be accepted. The custom fingerprint check only runs after the connection is established, leaving a window where the connection could be intercepted. **Perspective 3:** The code allows plaintext ws:// connections to loopback addresses when OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 is set. This bypasses TLS encryption and exposes authentication tokens and chat data to network interception. The check only blocks non-loopback addresses, but loopback traffic can still be intercepted by local malware or through network proxies. **Perspective 4:** The code only validates TLS fingerprint when `url.startsWith('wss://') && this.opts.tlsFingerprint` is true. However, if `url.startsWith('wss://')` is true but `this.opts.tlsFingerprint` is undefined/null, the code proceeds without any TLS validation. This creates a security vulnerability where connections to wss:// URLs could bypass TLS fingerprint validation entirely, potentially allowing MITM attacks. **Perspective 5:** The code extracts hostname from a URL for display in an error message without proper encoding. If the URL contains malicious characters like angle brackets or quotes, they could be injected into the error output. While this is an error message, it could be displayed in logs or UI that might interpret HTML. **Perspective 6:** The code allows bypassing security checks for plaintext WebSocket connections via the OPENCLAW_ALLOW_INSECURE_PRIVATE_WS environment variable. This creates a business logic bypass where attackers could intercept credentials and chat data by convincing users to set this flag or by exploiting applications that set it by default. The security warning mentions 'trusted private networks only' but this is often misunderstood or misconfigured. **Perspective 7:** The WebSocket client is configured with `maxPayload: 25 * 1024 * 1024` (25MB) which allows extremely large messages. An attacker could send large payloads that trigger expensive downstream LLM API calls, vector database operations, or file processing without any per-message size limits or cost validation. This could lead to amplified billing attacks where a single large message triggers multiple expensive operations. **Perspective 8:** The `checkServerIdentity` function is cast as `any` type, bypassing TypeScript type checking. This could hide bugs in the fingerprint verification logic that might allow certificate validation bypass. The function signature should be properly typed to ensure the implementation matches Node.js expectations.
Suggested Fix
Remove `rejectUnauthorized: false` and implement fingerprint verification as part of a custom `checkServerIdentity` function that still validates the certificate chain properly. Or use certificate pinning with proper validation.
CRITICALChrome running with --no-sandbox flag in container
scripts/sandbox-browser-entrypoint.sh:94
[AGENTS: Deadbolt, Gateway, Harbor, Infiltrator, Phantom, Razor, Sanitizer, Sentinel, Siege, Specter]api_security, attack_surface, containers, dos, edge_security, injection, input_validation, sanitization, security, sessions
**Perspective 1:** The script runs Chromium with '--no-sandbox' and '--disable-setuid-sandbox' flags when ALLOW_NO_SANDBOX=1. This disables critical security sandboxing, allowing potential escape from the browser sandbox to the host system in container environments. **Perspective 2:** When ALLOW_NO_SANDBOX is set to 1, Chrome runs with --no-sandbox and --disable-setuid-sandbox flags. This disables critical security sandboxing, allowing potential escape from the browser process to the host system if a browser vulnerability is exploited. **Perspective 3:** When ALLOW_NO_SANDBOX=1, the script adds `--no-sandbox` and `--disable-setuid-sandbox` flags to Chrome/Chromium. This disables critical security sandboxing, allowing arbitrary code execution if the browser renders malicious content. This is especially dangerous in containerized environments where privilege escalation is possible. **Perspective 4:** The script adds --no-sandbox and --disable-setuid-sandbox flags to Chrome when ALLOW_NO_SANDBOX=1. This disables Chrome's security sandbox, which is a significant security risk as it allows malicious web content to escape the browser sandbox and potentially compromise the container. **Perspective 5:** The script passes user-controlled environment variables directly to Chrome/Chromium command line without proper sanitization. Variables like CDP_SOURCE_RANGE are concatenated into socat command arguments without validation, potentially allowing command injection. **Perspective 6:** The script exposes Chrome DevTools Protocol on port 9222 via socat without authentication. CDP allows full browser control including executing JavaScript, navigating to URLs, and extracting data. This is exposed to the Docker network. **Perspective 7:** The CDP_SOURCE_RANGE environment variable is directly interpolated into a socat command without validation. An attacker could inject shell commands via this variable. **Perspective 8:** When NOVNC_PASSWORD is not set, the script generates a password from /proc/sys/kernel/random/uuid which may not be cryptographically secure. The password is limited to 8 characters. **Perspective 9:** The browser sandbox uses a shared user data directory without proper isolation between different sessions/instances. **Perspective 10:** The script contains a loop that polls Chrome's CDP endpoint up to 50 times with 0.1 second sleeps (total 5 seconds). If Chrome fails to start or crashes, this creates a busy-wait loop that consumes CPU cycles unnecessarily. While bounded, it could still waste resources if Chrome is in a crash loop.
Suggested Fix
Remove the --no-sandbox flag or ensure it's only used in strictly controlled environments with appropriate isolation. Consider using user namespace remapping or seccomp profiles instead.
CRITICALInsecure Exec Approval Socket with Weak Token Generation
apps/macos/Sources/OpenClaw/ExecApprovals.swift:320
[AGENTS: Chaos, Infiltrator, Razor, Vector]attack_chains, attack_surface, edge_cases, security
**Perspective 1:** The exec approvals system creates a Unix domain socket with weak token generation using SecRandomCopyBytes without proper entropy verification. The socket path is predictable and permissions may not be properly restricted. **Perspective 2:** The exec approvals system creates a UNIX socket with token-based authentication. The token is generated and stored in a file with permissions 0o600, but if an attacker can read this file (via path traversal, symlink attack, or improper permissions), they can send arbitrary exec approval requests to the socket. Combined with the ability to modify allowlist patterns, this creates a complete remote code execution chain. **Perspective 3:** The exec approvals system creates a Unix domain socket with a generated token for authentication. While the socket is in a protected directory (~/.openclaw), the token-based authentication could be vulnerable if the token is leaked or intercepted by other processes on the same system. **Perspective 4:** The allowlist pattern validation only checks for path components ('/', '~', or '\'), but doesn't validate the actual path format. An attacker could add patterns like '/tmp/;malicious_command' or use other shell metacharacters to bypass intended restrictions. When combined with access to the exec approval socket, this enables arbitrary command execution. **Perspective 5:** The generateToken method falls back to UUID().uuidString if SecRandomCopyBytes fails. UUIDs are not cryptographically random and could be predictable, weakening the security of the exec approvals socket. **Perspective 6:** The skill bins cache reveals which binaries are required by installed skills. An attacker with access to this information could tailor attacks to exploit specific binaries or identify vulnerable software versions on the system, enabling targeted exploitation.
Suggested Fix
Use cryptographically secure random token generation with proper entropy checking. Implement socket authentication with client certificates or stronger tokens. Restrict socket permissions to root or specific users.
CRITICALLLM task execution with potential PHI exposure
extensions/llm-task/src/llm-task-tool.ts:260
[AGENTS: Compliance]HIPAA
LLM task tool sends arbitrary prompts and input data to external LLM providers without PHI filtering or BAA validation. Healthcare use cases could inadvertently send PHI to non-compliant AI services.
Suggested Fix
Implement PHI detection and redaction before LLM submission, require BAA confirmation for healthcare use, or restrict to local LLM only.
CRITICALMissing tenant isolation in memory deletion
extensions/memory-lancedb/index.ts:160
[AGENTS: Tenant]tenant_isolation
The `delete` method only validates UUID format but doesn't check tenant ownership before deleting a memory. A tenant could delete another tenant's memory by guessing or obtaining a valid memory ID.
Suggested Fix
Include tenant_id in the delete query to ensure tenants can only delete their own memories.
CRITICALCross-conversation file upload attack enables data exfiltration
extensions/msteams/src/monitor-handler.file-consent.test.ts:144
[AGENTS: Vector]attack_chains
The test demonstrates that file consent invokes are validated against conversation IDs, but attackers could chain this with conversation ID spoofing or session hijacking to upload files to unauthorized conversations, enabling data exfiltration across team boundaries.
Suggested Fix
Add additional authentication factors for file consent, implement conversation ownership validation, and add audit logging for all file consent operations.
CRITICALPotential host header injection via @ symbol
extensions/voice-call/src/webhook-security.ts:204
[AGENTS: Sentinel]input_validation
The extractHostname function rejects host headers containing '@' to prevent 'attacker.com:80@legitimate.com' style injections, but this check may not be comprehensive enough. Other injection techniques might bypass this simple check.
Suggested Fix
Implement more comprehensive host header validation: 1) Reject any host header with credentials (user:pass@host), 2) Validate against RFC 3986 host rules, 3) Use a well-tested URL parsing library instead of manual string manipulation.
CRITICALRemote code execution via Homebrew install
scripts/install.sh:73
[AGENTS: Gatekeeper, Tripwire, Vector]attack_chains, auth, dependencies
**Perspective 1:** Line 1033 executes `run_remote_bash` with Homebrew's install.sh URL. This downloads and executes arbitrary code from raw.githubusercontent.com. While Homebrew is trusted, this creates a supply chain dependency on GitHub's integrity. **Perspective 2:** The run_remote_bash() function downloads a URL to a temporary file and executes it with /bin/bash without any integrity verification. This function is called in install_homebrew() (line 1105) to download and execute the Homebrew installer. An attacker who controls the URL (via DNS hijacking, MITM, or compromised server) can execute arbitrary code with the privileges of the user running the installer. Combined with the curl|bash pattern, this creates a two-stage attack chain: compromise main installer → inject malicious Homebrew installer URL → gain persistent access via Homebrew installation. **Perspective 3:** The `run_remote_bash()` function executes arbitrary remote code without explicit user confirmation, especially dangerous when `NO_PROMPT=1` is set (non-interactive mode). This could allow automated exploitation if an attacker controls the download URL.
Suggested Fix
Remove run_remote_bash() function. Use package managers directly or download verified packages with checksum verification. If remote execution is absolutely necessary, verify PGP signatures of downloaded scripts.
CRITICALGateway model testing without cost controls
scripts/test-live-gateway-models-docker.sh:1
[AGENTS: Harbor, Vault, Wallet, Weights]containers, denial_of_wallet, model_supply_chain, secrets
**Perspective 1:** Script tests gateway models with configurable providers and models. No visible budget enforcement or rate limiting could lead to massive API costs if abused. **Perspective 2:** The script mounts host directories ($CONFIG_DIR, $WORKSPACE_DIR) and potentially $PROFILE_FILE into the container. This could expose sensitive host credentials and configuration to the container without proper access controls or validation. **Perspective 3:** Similar to test-live-models-docker.sh, this script tests gateway models without integrity verification. The OPENCLAW_LIVE_GATEWAY_MODELS environment variable controls which models are loaded, but there's no verification of model checksums or signatures. Gateway models could be loaded from untrusted sources or compromised repositories. **Perspective 4:** This test script mounts the user's profile file (~/.profile) into Docker containers, which may contain environment variables with API keys and other credentials. This exposes sensitive credentials to test containers.
Suggested Fix
Use dedicated test credentials instead of mounting user profiles, implement credential injection via secure environment variables, and avoid exposing production credentials in test environments.
CRITICALSession store access without tenant isolation
src/acp/runtime/session-meta.ts:19
[AGENTS: Tenant]tenant_isolation
The readAcpSessionEntry and listAcpSessionEntries functions access session stores without tenant scoping. These functions read from a shared session store path and could return session data from other tenants. The resolveStoreSessionKey function searches across all sessions without tenant filtering.
Suggested Fix
Modify all session store access functions to accept tenant_id parameter and filter sessions by tenant. Store sessions in tenant-isolated directories or prefix session keys with tenant identifiers.
CRITICALMissing validation for PATH modification in sandbox mode
src/agents/bash-tools.exec-runtime.ts:75
[AGENTS: Pedant]correctness
The `validateHostEnv` function throws an error for PATH modification on host, but there's no similar validation for sandboxed executions. An attacker could modify PATH in sandbox mode to execute malicious binaries.
Suggested Fix
Extend PATH validation to sandbox mode or implement proper sandbox isolation that prevents PATH manipulation.
CRITICALCommand injection in Docker exec arguments
src/agents/bash-tools.shared.ts:80
[AGENTS: Prompt, Razor, Syringe]db_injection, llm_security, security
**Perspective 1:** The buildDockerExecArgs function constructs shell commands with user-controlled environment variables and command strings. The PATH environment variable handling creates an OPENCLAW_PREPEND_PATH variable that gets evaluated in the shell command, enabling command injection. **Perspective 2:** The buildDockerExecArgs function constructs a shell command by concatenating user-controlled parameters. The 'command' parameter is embedded directly into the shell command string without proper escaping, which could lead to command injection. **Perspective 3:** The buildDockerExecArgs function constructs Docker exec commands with environment variables and commands that may be influenced by LLM tool calls. While there's some path validation, the command construction could be vulnerable to injection if input validation fails.
Suggested Fix
Use array-based command construction instead of string concatenation. Pass arguments as separate array elements rather than embedding them in a shell command string.
CRITICALUninstall command chain enables persistence removal and data destruction
src/commands/uninstall.ts:91
[AGENTS: Vector]attack_chains
The uninstall command removes state, config, and workspace directories (lines 91-174). An attacker with CLI access could chain this with privilege escalation to destroy OpenClaw installations across systems. The service stop and uninstall (lines 56-79) could be used to disable security monitoring. Combined with other access, this creates a data destruction and persistence removal chain.
Suggested Fix
Require multi-factor confirmation for destructive operations, implement backup creation before removal, and audit all uninstall operations.
CRITICALAgent directory resolution without tenant isolation
src/config/agent-dirs.ts:1
[AGENTS: Tenant]tenant_isolation
Agent directory resolution and duplicate detection functions process agent configuration across all tenants. This could expose one tenant's agent directory structure and paths to another tenant through configuration analysis.
Suggested Fix
Scope agent directory operations by tenant. Filter agent configuration by tenant before processing directory paths.
CRITICALAgent bindings exposed across tenants
src/config/bindings.ts:1
[AGENTS: Tenant]tenant_isolation
Functions like `listConfiguredBindings`, `listRouteBindings`, and `listAcpBindings` return all bindings without tenant filtering. This could expose one tenant's agent routing configuration to another tenant, potentially revealing business logic and integration patterns.
Suggested Fix
Add tenant parameter to binding listing functions. Filter bindings by tenant ownership before returning.
CRITICALSandbox Docker configuration allows container namespace joins
src/config/types.sandbox.ts:56
[AGENTS: Harbor, Infiltrator, Prompt, Sentinel, Vector]attack_chains, attack_surface, containers, input_validation, llm_security
**Perspective 1:** The `dangerouslyAllowContainerNamespaceJoin` option allows Docker `network: "container:<id>"` namespace joins, breaking sandbox isolation. An attacker could chain this with other vulnerabilities to escape the sandbox, access host network, or join other container namespaces. This creates a privilege escalation path from sandboxed execution to host-level access. **Perspective 2:** The sandbox configuration includes multiple 'dangerouslyAllow*' flags that can bypass container security isolation: dangerouslyAllowReservedContainerTargets, dangerouslyAllowExternalBindSources, and dangerouslyAllowContainerNamespaceJoin. These flags allow containers to mount sensitive host paths, access external filesystems, and join other container namespaces, which could lead to container escape or host compromise. **Perspective 3:** Multiple `dangerouslyAllow*` flags in SandboxDockerSettings allow bypassing security controls: `dangerouslyAllowReservedContainerTargets`, `dangerouslyAllowExternalBindSources`, `dangerouslyAllowContainerNamespaceJoin`. These could be exploited to escape container isolation, mount sensitive host directories, or join other container namespaces. **Perspective 4:** The binds array accepts strings in 'host:container:mode' format without validation. Malicious paths could escape container isolation or target sensitive host directories. **Perspective 5:** The `dangerouslyAllowReservedContainerTargets` and `dangerouslyAllowExternalBindSources` flags allow bypassing sandbox isolation. If an LLM can influence configuration, it could enable bind mounts to sensitive system paths, potentially leading to container escape or data exfiltration.
Suggested Fix
Validate each bind mount: ensure host path is absolute and within allowed directories, container path is absolute, mode is 'ro' or 'rw', and reject paths containing '..' or symlink traversal attempts.
CRITICALShared thread binding state across accounts/tenants
src/discord/monitor/thread-bindings.lifecycle.test.ts:120
[AGENTS: Tenant]tenant_isolation
The thread binding manager uses global state (via `__testing` module) that's shared across all accounts. While tests show account isolation via `accountId`, the production code may not properly isolate bindings between different Discord accounts/tenants.
Suggested Fix
Ensure thread binding storage is strictly isolated per account/tenant. Use separate storage files or namespaces for each account.
CRITICALEnvironment variable injection in approved commands
src/gateway/node-invoke-system-run-approval.test.ts:141
[AGENTS: Harbor]containers
The test demonstrates environment variable manipulation (GIT_EXTERNAL_DIFF=/tmp/pwn.sh) in command execution. Even with approval, environment variables could be used to inject malicious behavior in container environments.
Suggested Fix
Strip or strictly validate environment variables passed to executed commands. Use minimal, predefined environment for all command executions.
CRITICALEnvironment variable hash mismatch vulnerability in approval system
src/gateway/node-invoke-system-run-approval.test.ts:253
[AGENTS: Gatekeeper]auth
The approval system uses envHash to validate environment variables, but if an attacker can predict or bypass the hash calculation, they could inject malicious environment variables while maintaining a valid approval.
Suggested Fix
Use stronger cryptographic hashing with salt and ensure the hash covers all environment variables in canonical order.
CRITICALNode registry lacks tenant isolation for node sessions
src/gateway/node-registry.ts:39
[AGENTS: Tenant]tenant_isolation
The NodeRegistry class stores all node sessions in a single global map without tenant scoping. This allows nodes from one tenant to potentially discover and interact with nodes from other tenants, leading to cross-tenant data leakage through node-to-node communication.
Suggested Fix
Add tenant ID to node session registration and partition the nodesById map by tenant. Ensure all node operations (invoke, sendEvent) validate tenant context.
CRITICALNode invocation lacks tenant validation
src/gateway/node-registry.ts:103
[AGENTS: Tenant]tenant_isolation
The invoke method allows any node to invoke commands on any other node without tenant validation. A node from Tenant A could invoke commands on a node from Tenant B, potentially accessing cross-tenant data or performing unauthorized actions.
Suggested Fix
Add tenant validation to invoke method, ensuring the calling node and target node belong to the same tenant before allowing invocation.
CRITICALNode event broadcasting lacks tenant isolation
src/gateway/node-registry.ts:178
[AGENTS: Tenant]tenant_isolation
The sendEvent method allows sending events to any node without tenant validation. This could enable cross-tenant event propagation and data leakage between tenants.
Suggested Fix
Add tenant validation to sendEvent method, ensuring events can only be sent to nodes within the same tenant.
CRITICALCommand execution approval bypass via two-phase request
src/gateway/server-methods/exec-approval.ts:70
[AGENTS: Vector]attack_chains
The exec.approval.request handler accepts twoPhase parameter. When twoPhase=true, it immediately responds with 'accepted' status before waiting for approval decision. An attacker could send twoPhase=true request, get immediate acceptance, then the system proceeds with command execution without waiting for actual approval. This bypasses the entire approval workflow.
Suggested Fix
Remove twoPhase parameter or ensure it doesn't bypass approval. All exec requests must wait for explicit approval decision before proceeding.
CRITICALSession binding listBySession returns bindings across all tenants
src/infra/outbound/session-binding-service.ts:267
[AGENTS: Tenant]tenant_isolation
The listBySession method iterates through ALL registered adapters (across all tenants) and returns session bindings without tenant filtering. This allows any tenant to see session bindings from other tenants.
Suggested Fix
Filter adapters by tenant before calling listBySession, or ensure each adapter implementation enforces tenant isolation.
CRITICALSession binding unbind operates across all tenants
src/infra/outbound/session-binding-service.ts:299
[AGENTS: Tenant]tenant_isolation
The unbind method iterates through ALL registered adapters (across all tenants) and calls unbind on each, potentially allowing a tenant to unbind sessions belonging to other tenants.
Suggested Fix
Filter adapters by tenant before calling unbind, or ensure each adapter implementation validates tenant context before performing unbind operations.
CRITICALCommand injection via exec secret provider
src/secrets/resolve.ts
[AGENTS: Egress, Exploit, Gatekeeper, Prompt, Syringe, Tenant]auth, business_logic, data_exfiltration, db_injection, llm_security, tenant_isolation
**Perspective 1:** The exec secret provider spawns child processes with user-controlled command paths and arguments without proper validation. The `secureCommandPath` is validated for filesystem permissions but the command and args are passed directly to `spawn()` without shell escaping. An attacker who controls the secret provider configuration could inject shell commands through the `command` or `args` fields. **Perspective 2:** Secret resolution uses provider names and ref IDs without tenant context. In multi-tenant environments, secrets must be isolated per tenant to prevent cross-tenant secret leakage. **Perspective 3:** The exec secret provider runs external commands and captures their stdout/stderr. If these commands log or output secret values, they could be captured in error messages or logs. The exec provider also passes secret IDs in the input JSON to child processes. **Perspective 4:** The exec provider constructs JSON input by string concatenation (`JSON.stringify(requestPayload)`) and passes it to child process stdin. While JSON.stringify is generally safe, if the child process parses the JSON and then constructs queries or commands from the parsed data without proper escaping, it could lead to injection vulnerabilities in the child process. **Perspective 5:** The secret resolution system allows file and exec providers that could be exploited if an attacker gains control of the file system or can influence the executed commands. While there are some path security checks, the exec provider runs external commands with potentially untrusted input. **Perspective 6:** The exec secret provider runs external commands with JSON input containing secret IDs. If LLM-generated content influences which secret IDs are requested, this could lead to indirect command injection. The provider passes request payload to child processes via stdin. **Perspective 7:** The `filePayloadByProvider` cache uses provider name as key without tenant prefix. Different tenants could share the same provider name, leading to cross-tenant secret cache leakage. **Perspective 8:** The file secret provider reads JSON files containing secrets. If these files are not properly secured or if the file paths are logged, sensitive data could be exposed to other processes or in logs. **Perspective 9:** The exec secret provider protocol doesn't include authentication between the main process and the external command. An attacker could potentially intercept or spoof the communication to extract secrets. **Perspective 10:** This file implements secret resolution from various providers (env, file, exec) with security checks and caching. It's security infrastructure, not business logic with payment flows.
Suggested Fix
Use `child_process.spawn()` with explicit arguments array and avoid shell mode. Validate command path is an executable file, not a shell script with embedded commands. Consider using a allowlist of permitted commands.
CRITICAL[Architectural] Architectural SQL injection vulnerability in memory manager (12 instances)
src/memory/manager-sync-ops.ts
[AGENTS: architectural-scanner]architectural
ROOT CAUSE: Raw SQL string concatenation with dynamic table/column names and values throughout the memory management layer The memory manager operations layer uses string concatenation to build SQL queries with dynamic table names, column names, and WHERE clause values. This pattern appears in table creation, INSERT, DELETE, and filter construction across multiple functions. Line-by-line parameterization won't fix the architectural flaw of trusting dynamic identifiers without proper escaping. This architectural issue produced 12 individual findings that cannot be resolved with line-by-line patches.
Suggested Fix
Refactor the memory manager layer to use a SQL query builder library with proper identifier escaping (e.g., knex, slonik) or implement a secure parameterization abstraction. Create a `SafeSQL` module that provides methods like `safeTableName(name)`, `safeColumnName(name)`, and `parameterizedQuery(template, values)` that validates identifiers against a whitelist and uses proper prepared statements for all database operations.
Note: Fixing issues can create a domino effect — resolving one finding often surfaces new ones that were previously hidden. Multiple scan-and-fix cycles may be needed until you’re satisfied no further issues remain. How deep you go is your call.