T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:43- Finding
Cross-Agent Session Transcript Enumeration
- Content
View full analysis
__import__('time').time() - 86400: sessions += 1 with open(f) as fh: for line in fh: try: cost = json.loads(line).get('message',{}).get('usage',{}).get('cost',{}).get('total',0) if cost: total += cost except: pass ``` Equivalent cross-agent wildcard access is also used by the budget-check and per-model-breakdown examples. ### Technical Analysis The wildcard path `~/.openclaw/agents/*/sessions/*.jsonl` enumerates and opens session transcripts belonging to every locally accessible agent. It does not restrict access to the current agent or to a dedicated usage ledger. Although the supplied code only extracts model and cost fields, each entire JSONL line is read and decoded first. Session transcripts may contain prompts, responses, tool results, and other sensitive operational context. Consequently, the implementation gives the cost-analysis workflow access to substantially more data than it needs. The code does not bypass operating-system permissions, and no transmission of transcript data is implemented. The security concern is the failure to maintain least-privilege separation between local agents. ### Attack Path 1. A user or agent runs one of the documented cost-analysis commands. 2. The wildcard enumerates session files for every agent under `~/.openclaw/agents/`. 3. The process opens every qualifying transcript file that its current account can read. 4. Every JSONL record is loaded into memory and parsed. 5. A modified, compromised, or extended version ...[truncated 662 chars]- Remediation
View remediation
