T05 · Unauthorized Access and Privilege Escalation
- Location
manual_trade.py:18- Finding
Global Agent Secret File Is Loaded Beyond the Skill's Minimum Requirements
- Content
View full analysis
Vulnerability Details
File Location:
manual_trade.py:18-21
Vulnerability Type: Excessive credential access and violation of least privilege
Risk Level: MediumVulnerable Code
python try: from dotenv import load_dotenv load_dotenv("/root/.openclaw/.env") except Exception: passTechnical Analysis
The Skill unconditionally attempts to load
/root/.openclaw/.env, a global Agent environment file. Loading this file imports all variables it contains into the current process environment, even though the declared functionality only requiresSIMMER_API_KEYandWALLET_PRIVATE_KEY.This crosses a least-privilege boundary: unrelated credentials stored in the Agent's global environment become available to the Skill process and all imported Python packages. In particular,
simmer_sdkexecutes in the same process and can access every loaded environment variable throughos.environ.The broad exception handler also suppresses configuration and permission errors, making this access less visible to operators.
Attack Path
- An operator stores multiple service credentials in
/root/.openclaw/.env. - The operator invokes
manual_trade.py. - The Skill loads every variable from the global file into its process environment.
- The imported
simmer_sdk, a compromised dependency, or future code added to the process reads unrelated secrets fromos.environ. - Those secrets can then be used within the privileges of the affected external accounts or potentially transmitted by dependency-controlled code.
No direct exfiltration of unrelated environment variables is implemented in the reviewed project. Exploitation therefore requires malicious or compromised code executing in the same process.
Impact Assessment
The immediate scope includes every credential present in
/root/.openclaw/.env, rather than only the two credentials declared by the Skill. Depending on the file ...[truncated 423 chars]- An operator stores multiple service credentials in
- Remediation
View remediation
Remediation Suggestions
-
Remove automatic loading of
/root/.openclaw/.env. -
Require the execution environment to supply only the credentials needed by this Skill.
-
If dotenv support is necessary, use a Skill-specific file with restrictive permissions and an explicit allowlist:
python from dotenv import dotenv_values values = dotenv_values("/path/to/polymarket-manual-trade.env") for name in ("SIMMER_API_KEY", "WALLET_PRIVATE_KEY"): if name in values: os.environ[name] = values[name] -
Validate required variables and fail with a clear error without printing their values.
-
Run the Skill under a dedicated, unprivileged account rather than relying on a root-owned global configuration.
-
Minimize the lifetime and scope of wallet credentials, and prefer a restricted signing mechanism if supported.
-
