T05 · Unauthorized Access and Privilege Escalation
- Location
- templates/HEARTBEAT.md:34
- Finding
- Heartbeat unnecessarily loads sensitive identity and memory files<![CDATA[ ## Vulnerability Details **File Location**: `templates/HEARTBEAT.md`, lines 34-37 **Vulnerability Type**: Excessive access to sensitive workspace context **Risk Level**: Medium ### Vulnerable Code ```md ## Required Reads by Trigger (token-efficient) - `HEARTBEAT_TICK` (full context refresh): - `AGENTS.md`, `IDENTITY.md`, `USER.md`, `SOUL.md`, `MEMORY.md`, `memory/YYYY-MM-DD.md` (today), `memory/YYYY-MM-DD.md` (yesterday), `ACTIVITIES.md` ``` ### Technical Analysis The heartbeat controller only requires the orchestration state in `ACTIVITIES.md` to reconcile workers, dispatch tasks, and update sprint state. Nevertheless, every `HEARTBEAT_TICK` is instructed to load identity, user-profile, behavioral, long-term-memory, and daily-memory files. These files can contain personal information, credentials, private conversation details, or operational instructions unrelated to sprint management. Loading them into the autonomous controller context violates least privilege and makes their contents available to subsequently processed sprint instructions. `SECURITY.md` warns operators that these files may contain secrets, but requiring users to sanitize all memory and identity files does not eliminate the unnecessary access. ### Attack Path 1. An operator enables the configured heartbeat cadence. 2. Each scheduled heartbeat loads all files listed above into the Agent context. 3. An attacker modifies, supplies, or influences a queued sprint plan or worker task. 4. The attacker-controlled instructions execute in a context that already contains identity and memory data. 5. The instructions can cause sensitive context to influence generated files, worker prompts, errors, or externally transmitted logs. ### Impact Assessment A malicious or compromised sprint instruction may gain contextual access to sensitive information stored in the listed files. The scope is limited to information made available to the OpenClaw Agent and the tools granted to that Agent, ...[truncated 101 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Make `ACTIVITIES.md` the only default read for all routine control triggers. 2. Remove `IDENTITY.md`, `USER.md`, `SOUL.md`, `MEMORY.md`, and daily notes from scheduled heartbeat reads. 3. If additional context is genuinely required, require explicit operator approval for that individual run. 4. Define a narrow per-run file allowlist rather than loading entire memory files. 5. Separate sensitive user memory from autonomous orchestration state at the tool-permission level. 6. Prevent worker tasks and imported plans from accessing controller context unless explicitly necessary. 7. Add automated checks that reject controller configurations requesting files outside the approved orchestration directory. ]]>
