You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`src/gateway/chat-sanitize.ts` strips platform envelope metadata (WhatsApp headers, message IDs, control characters) from user messages before processing. `sanitizeChatSendMessageInput()` (`src/gateway/server-methods/chat.ts:218`) rejects null bytes and strips disallowed control characters, allowing only tabs, newlines, carriage returns, and printable characters through.
94
+
`src/gateway/chat-sanitize.ts` strips platform envelope metadata (WhatsApp headers, message IDs, control characters) from user messages before processing. `sanitizeChatSendMessageInput()` (`src/gateway/server-methods/chat.ts:228`) rejects null bytes and strips disallowed control characters, allowing only tabs, newlines, carriage returns, and printable characters through.
95
95
96
96
### Config merge-patch
97
97
@@ -172,7 +172,7 @@ Below is a conceptual pipeline. Exact details vary by channel.
172
172
173
173
1.5) **Input sanitization**
174
174
- Strip platform envelope metadata from user messages (`src/gateway/chat-sanitize.ts`)
175
-
- Reject null bytes and strip unsafe control characters (`src/gateway/server-methods/chat.ts:218`)
175
+
- Reject null bytes and strip unsafe control characters (`src/gateway/server-methods/chat.ts:228`)
@@ -1048,12 +1048,12 @@ OpenClaw has several built-in protections. Understanding them helps you build on
1048
1048
|**Dangerous env var blocklist**| Blocks `LD_PRELOAD`, `NODE_OPTIONS`, etc. from being set via exec tools |`src/agents/bash-tools.exec-runtime.ts:40-54`|
1049
1049
|**Small model risk audit**| Warns when small/older models have tool access |`src/security/audit-extra.sync.ts:1088-1177`|
1050
1050
|**ALLOWED_FILE_NAMES**| Restricts which agent bootstrap files can be modified via `agents.files.set`|`src/gateway/server-methods/agents.ts:66`|
1051
-
|**File permissions**| Config files created with `0o600`, directories with `0o700`|`src/config/io.ts:1121,1247`|
1051
+
|**File permissions**| Config files created with `0o600`, directories with `0o700`|`src/config/io.ts:1137,1263`|
1052
1052
|**Tool profiles**|`"coding"` profile excludes the gateway tool entirely |`src/agents/tool-policy.ts:63-80`|
1053
1053
|**System prompt warning**| Soft instruction to not run `config.apply` without user request |`src/agents/system-prompt.ts:480`|
1054
1054
|**Restart sentinel**| Logs timestamp, session key, message, and stats on config-triggered restarts |`src/infra/restart-sentinel.ts:30-48`|
1055
1055
|**Strict schema validation**| Zod `.strict()` rejects unknown top-level keys and type errors |`src/config/zod-schema.ts:879`|
1056
-
|**Forensic config write audit**| Every config write logged to `config-audit.jsonl` with PID, PPID, CWD, argv, content hashes, byte sizes, gateway-mode changes, and anomaly flags (size drops >50%, missing meta, gateway-mode removal) |`src/config/io.ts:495-538` (audit helpers), `:1177-1227` (audit record builder + append) |
1056
+
|**Forensic config write audit**| Every config write logged to `config-audit.jsonl` with PID, PPID, CWD, argv, content hashes, byte sizes, gateway-mode changes, and anomaly flags (size drops >50%, missing meta, gateway-mode removal) |`src/config/io.ts:511-538` (audit helpers), `:1177-1227` (audit record builder + append) |
Copy file name to clipboardExpand all lines: 06-optimizations/resource-usage.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Users report OpenClaw can be resource-intensive. This guide documents every reso
37
37
| 11 |**Memory sync** — file hashing + markdown chunking + embedding + SQLite FTS5/vec indexing |`src/memory/manager.ts:380+`| Medium (periodic) | Like re-indexing a library catalog — scanning, categorizing, and filing every document |
38
38
| 12 |**TTS generation** — ElevenLabs/OpenAI/Edge TTS API calls + audio buffer handling |`src/tts/tts.ts:557-724`| Medium | API calls are remote but audio buffer conversion is local CPU work |
39
39
| 13 |**Agent execution loop** — continuous model response processing |`src/auto-reply/reply/agent-runner-execution.ts:74`| Medium (continuous) | The main "brain" loop — always running while the bot is responding |
40
-
| 14 |**Cron timer loop** — re-arming `setTimeout` for scheduled job processing |`src/cron/service/timer.ts:533`| Low (idle) | Like a clock ticking in the background — minimal CPU unless jobs are firing |
40
+
| 14 |**Cron timer loop** — re-arming `setTimeout` for scheduled job processing |`src/cron/service/timer.ts:547`| Low (idle) | Like a clock ticking in the background — minimal CPU unless jobs are firing |
41
41
42
42
### Other CPU consumers
43
43
@@ -58,7 +58,7 @@ Users report OpenClaw can be resource-intensive. This guide documents every reso
58
58
-`src/memory/qmd-manager.ts` — QMD process output is now unbounded (the previous `appendOutputWithCap()` output cap was removed; `MAX_QMD_OUTPUT_CHARS` no longer exists). The `resolveSpawnInvocation()` helper at `:72` handles Windows-compatible spawn routing.
59
59
60
60
**Media fetch buffering:**
61
-
-`src/media/fetch.ts:132-148` — media fetch is now **bounded** when `maxBytes` is specified: `readResponseWithLimit()` (`src/media/read-response-with-limit.ts`) streams chunk-by-chunk and aborts early on overflow, preventing unbounded memory consumption. Falls back to unbounded `arrayBuffer()` only when no limit is specified (e.g., document fetches without size constraints).
61
+
-`src/media/fetch.ts:137-159` — media fetch is now **bounded** when `maxBytes` is specified: `readResponseWithLimit()` (`src/media/read-response-with-limit.ts`) streams chunk-by-chunk and aborts early on overflow, preventing unbounded memory consumption. Falls back to unbounded `arrayBuffer()` only when no limit is specified (e.g., document fetches without size constraints).
62
62
63
63
---
64
64
@@ -74,9 +74,9 @@ Users report OpenClaw can be resource-intensive. This guide documents every reso
| Browser roleRefs |`src/browser/pw-session.ts:109-110`| 50 max LRU | Well bounded |
79
+
| Browser roleRefs |`src/browser/pw-session.ts:112-113`| 50 max LRU | Well bounded |
80
80
| Followup queues |`src/auto-reply/reply/queue/state.ts:18`| 20/queue, no queue count cap; `clearFollowupQueue()` (`queue/cleanup.ts:24`) clears individual queues during session cleanup |**Partially mitigated** — individual queues can be cleared but total queue-map still uncapped |
81
81
| Agent event seqByRun |`src/infra/agent-events.ts:23`|**No cleanup** (`seqByRun` never pruned; `runContextById` now cleaned via `clearAgentRunContext()` at `:49`) |**Partial leak** — `runContextById` fixed, `seqByRun` still leaks |
Copy file name to clipboardExpand all lines: 08-security-analysis/issue-1796-argus-audit.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ All four AI-generated summaries in this project covered the report. The followin
16
16
|[Gemini 3.0 Pro](../explain-clawdbot-gemini-3.0-pro/README.md)| Brief index entry only; lists "race conditions" as a key risk |**Inaccurate on race conditions** -- code uses `withFileLock()` from `src/infra/file-lock.ts` with PID-based stale detection; no race exists |
17
17
|[Kimi K2.5](../explain-clawdbot-kilocode-kimi-k2.5/security-analysis.md#github-issue-1796-argus-security-audit)| Detailed 8-claim breakdown with code snippets, scanner statistics, remediation advice |**Inaccurate** -- accepts all 8 CRITICAL claims at face value; does not verify against source code; presents "plaintext storage" and "hardcoded secrets" as vulnerabilities rather than standard CLI practice per RFC 8252 |
18
18
19
-
**Key disagreement resolved:** Gemini 3.0 Pro accepted the race condition claim at face value. Code review (`src/agents/auth-profiles/oauth.ts:158` for `refreshOAuthTokenWithLock()`, config in `constants.ts:12`) confirms locking is correctly implemented. The other three models correctly identified this as a false positive.
19
+
**Key disagreement resolved:** Gemini 3.0 Pro accepted the race condition claim at face value. Code review (`src/agents/auth-profiles/oauth.ts:154` for `refreshOAuthTokenWithLock()`, config in `constants.ts:12`) confirms locking is correctly implemented. The other three models correctly identified this as a false positive.
20
20
21
21
**Additional disagreement (Kimi K2.5):** Kimi K2.5 presents all 8 CRITICAL findings as actual vulnerabilities requiring remediation, including recommending keychain integration for token storage and disabling `config.patch` entirely. Code review confirms: (1) token storage with `0o600` permissions is standard CLI practice per RFC 8252, (2) `config.patch` executes inside Docker containers with `no-new-privileges`, (3) DNS pinning (`src/infra/net/ssrf.ts:276-363`) prevents the SSRF chain Kimi K2.5 describes, and (4) RBAC (`src/gateway/server-methods.ts:98-155`) prevents agent self-approval. The remediation advice in Kimi K2.5 is well-intentioned but addresses non-existent vulnerabilities.
22
22
@@ -27,11 +27,11 @@ All four AI-generated summaries in this project covered the report. The followin
27
27
| 1 | Plaintext OAuth token storage |**True, by design**|`src/infra/json-file.ts:22` sets `0o600` on every write. Standard for CLI tools (`gh`, `gcloud`). |
28
28
| 2 | Missing CSRF in OAuth state |**False**|`extensions/google-gemini-cli-auth/oauth.ts:690` performs strict `state !== verifier` check. |
29
29
| 3 | Hardcoded OAuth client secret |**True, standard practice**|[RFC 8252 Sections 8.4-8.5](https://datatracker.ietf.org/doc/html/rfc8252#section-8.4): CLI apps are "public clients." |
30
-
| 4 | Token refresh race condition |**False**|`withFileLock()` from `src/infra/file-lock.ts` with PID-based stale detection, lock held throughout refresh+save (`src/agents/auth-profiles/oauth.ts:158`). |
30
+
| 4 | Token refresh race condition |**False**|`withFileLock()` from `src/infra/file-lock.ts` with PID-based stale detection, lock held throughout refresh+save (`src/agents/auth-profiles/oauth.ts:154`). |
31
31
| 5 | Insufficient file permission checks |**True, by design**|`0o600` on every write + `openclaw security audit`/`fix` tooling. |
32
32
| 6 | Path traversal in agent dirs |**False**| Paths go through `resolveUserPath()` (`src/agents/agent-paths.ts:10,13`) which calls `path.resolve()` (`src/utils.ts:306,308`), normalizing traversal. IDs from env/config, not user input. |
33
33
| 7 | Webhook signature bypass |**True, properly gated**|`skipVerification` in `extensions/voice-call/src/webhook-security.ts` requires explicit param; dev-only, off by default. |
34
-
| 8 | Insufficient token expiry validation |**False**|`Date.now() < cred.expires` checked on every token use via inline checks (`src/agents/auth-profiles/oauth.ts:172,236`) and `tryResolveOAuthProfile()` (`src/agents/auth-profiles/oauth.ts:217-258`). |
34
+
| 8 | Insufficient token expiry validation |**False**|`Date.now() < cred.expires` checked on every token use via inline checks (`src/agents/auth-profiles/oauth.ts:168,232`) and `tryResolveOAuthProfile()` (`src/agents/auth-profiles/oauth.ts:213-252`). |
35
35
36
36
**Result: 0 of 8 CRITICAL claims are actual security vulnerabilities.**
0 commit comments