T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/generate_video.py:28- Finding
Video Script Loads Unrelated Secrets from a Fixed Workspace Environment File
- Content
View full analysis
None: env_path = Path(path) if not env_path.exists(): return for line in env_path.read_text(encoding="utf-8", errors="ignore").splitlines(): line = line.strip() if not line or line.startswith("#") or "=" not in line: continue key, value = line.split("=", 1) os.environ.setdefault(key.strip(), value.strip()) ``` The function is automatically invoked against a fixed, privileged workspace path: ```python def main() -> None: load_env_file("/root/.openclaw/workspace/.env") ``` ### Technical Analysis The video-generation script automatically reads `/root/.openclaw/workspace/.env` and imports every key-value pair into its process environment. The declared functionality requires only `ARK_API_KEY`, with optional model configuration through `DOUBAO_VIDEO_MODEL`. Loading all variables from a shared workspace environment file violates least-privilege principles. Unrelated credentials, service tokens, database passwords, or other secrets stored in that file become available to the script and all imported Python components, including the third-party Volcengine SDK. The behavior is not documented in `SKILL.md`, which instructs users to provide `ARK_API_KEY` through the environment. No direct transmission of unrelated environment variables was identified in the reviewed source code, but unnecessarily placing them in the process environment increases their exposure to dependencies, diagnostics, exception handlers, and future code changes. ### Attack Path 1. A user invokes `scripts/generate_video.py`. 2. Before parsing arguments or validating the required credential, the script opens `/root/.openclaw/workspace/.env`. 3. Every syntactically valid entry is inserte ...[truncated 780 chars]- Remediation
View remediation
