T05 · Unauthorized Access and Privilege Escalation
- Location
wan26_generator.py:376- Finding
Overbroad Loading of Shared Credential Files
- Content
View full analysis
None: """Load keys from .env into the environment without overwriting existing variables.""" if not os.path.exists(path): return with open(path, "r", encoding="utf-8") as f: for raw in f: line = raw.strip() if not line or line.startswith("#"): continue if "=" not in line: continue if line.startswith("export "): line = line[7:].strip() key, value = line.split("=", 1) key = key.strip() value = value.strip() if not key or " " in key: continue if key in os.environ: continue if (value.startswith('"') and value.endswith('"')) or ( value.startswith("'") and value.endswith("'") ): value = value[1:-1] os.environ[key] = value def load_local_env() -> None: """Load .env files from several OpenClaw-compatible locations.""" candidates = [] custom = os.getenv("OPENCLAW_ENV_FILE") if custom: candidates.append(custom) skill_dir = os.path.dirname(os.path.abspath(__file__)) candidates.append(os.path.join(skill_dir, ".env")) home = os.path.expanduser("~") candidates.append(os.path.join(home, ".openclaw", ".env")) candidates.append(os.path.join(home, ".workbuddy", ".env")) seen = set() for env_path in candidates: if not env_path or env_path in seen: continue seen.add(env_path) _apply_env_file(env_path) ``` The behavior is also explicitly documented in `SKILL.md:71-82`. ### Technical Analysis The Skill requires only a DashScope credential to perform its declared image-generation ...[truncated 1620 chars]- Remediation
View remediation
