T09 · Insecure Skill Coding Practices
- Location
scripts/triage.py:135- Finding
Path Traversal in Symptom History File Handling
- Content
View full analysis
List[Dict[str, Any]]: if os.path.exists(self.history_file): try: with open(self.history_file, 'r', encoding='utf-8') as f: return json.load(f) except: pass return [] ``` ### Technical Analysis The caller-controlled `user_id` is inserted directly into a filesystem path without validation, normalization, or containment checking. A value containing traversal components such as `../` can cause the resolved history path to escape `~/.openclaw/symptom_history`. A value beginning with an absolute path can also cause `os.path.join()` to discard the intended base directory. The `.json` suffix limits target names but does not prevent access to JSON configuration or data files. The `--history` command exposes the contents of a selected JSON file through `load_history()`. During an assessment, `save_assessment()` can overwrite a selected file if the existing JSON is compatible with the expected list structure. ### Attack Path 1. An attacker who can invoke the CLI or API supplies a cr ...[truncated 1041 chars]- Remediation
View remediation
