T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/analyze.py:68- Finding
Unnecessary Default Access to Agent Identity and Instruction Files
- Content
View full analysis
Vulnerability Details
File Location:
scripts/analyze.py:68-89, 680-683
Vulnerability Type: Excessive file-read privileges and violation of least privilege
Risk Level: MediumVulnerable Code
python def scan_for_formalized(soul_path, agents_path): """Read SOUL.md and AGENTS.md to find already-formalized patterns.""" formalized = set() for path in [soul_path, agents_path]: if path and os.path.exists(path): text = Path(path).read_text(encoding='utf-8').lower() # Extract key concepts mentioned in operational docs # Look for specific workflows, cron jobs, rules that are codified if 'cron' in text: formalized.add('cron-jobs') if 'daily recap' in text or 'daily-recap' in text: formalized.add('daily-recap') if 'media vault' in text or 'youtube' in text: formalized.add('media-vault') if 'trending' in text and 'scanner' in text: formalized.add('trending-scanner') if 'obsidian' in text and 'vault' in text: formalized.add('obsidian-vault') if 'smart routing' in text or 'model routing' in text: formalized.add('model-routing') if 'memory' in text and ('daily' in text or 'log' in text): formalized.add('memory-logging') return formalizedpython # Load SOUL.md / AGENTS.md for formalization detection soul_path = args.soul or config.get( 'soul_path', os.path.expanduser('~/.openclaw/workspace/SOUL.md') ) agents_path = args.agents or config.get( 'agents_path', os.path.expanduser('~/.openclaw/workspace/AGENTS.md') ) formalized = scan_for_formalized(soul_path, agents_path)Technical Analysis
Every execution of
analyze.pyattempts to read the complete contents of the default workspace filesSOUL.mdandAGENTS.md, unless different paths are supplied. This occurs even whe ...[truncated 2013 chars]- Remediation
View remediation
Remediation Suggestions
- Remove default access to
SOUL.mdandAGENTS.md. Only read these files when users explicitly provide--soulor--agents. - Alternatively, introduce an explicit opt-in option such as
--scan-operational-docs, disabled by default. - Clearly document which files are read, why they are required, and how their contents affect generated analysis.
- Validate explicitly supplied paths against an approved workspace root and reject unexpected files or directory traversal outside that boundary.
- Replace full-document reads with narrowly scoped structured metadata containing only the formalization identifiers required by the analysis.
- Avoid retaining or propagating raw document contents. Ensure errors and generated reports cannot include sensitive source text.
- Add tests confirming that ordinary pipeline execution does not open agent identity or instruction files unless explicit consent is provided.
- Remove default access to
