T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/lib/basecred.mjs:13
- Finding
- Centralized OpenClaw Credential File Is Loaded Without Key-Level Isolation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/lib/basecred.mjs:13-17` **Vulnerability Type**: Violation of least privilege through broad credential loading **Risk Level**: Medium ### Vulnerable Code ```javascript // Load environment variables from OpenClaw .env (user-agnostic) const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const openclawEnvPath = join(homedir(), '.openclaw', '.env'); dotenv.config({ path: openclawEnvPath }); ``` ### Technical Analysis The Skill requires only `TALENT_API_KEY` and `NEYNAR_API_KEY`, but `dotenv.config()` parses the entire centralized `~/.openclaw/.env` file and adds every available entry to `process.env`. All JavaScript dependencies executing in the same process can consequently access unrelated credentials loaded from that file. File mode `600` restricts other operating-system users, but it does not isolate credentials from third-party modules running inside the authorized Node.js process. The current audited code does not log or exfiltrate these unrelated values. The vulnerability is the unnecessary expansion of the credential boundary and the resulting increase in supply-chain impact. ### Attack Path 1. A user stores credentials for multiple OpenClaw components in `~/.openclaw/.env`. 2. The user invokes the reputation-checking Skill. 3. `dotenv.config()` imports all entries from the centralized file into `process.env`. 4. `@basecred/sdk` and other modules execute in the same process. 5. If a dependency is compromised or later replaced with malicious code, it can enumerate `process.env`. 6. The malicious dependency can read and transmit credentials unrelated to Talent Protocol or Neynar using the Skill's existing network access. ### Impact Assessment A malicious in-process dependency could obtain every credential imported from the centralized OpenClaw environment file, not merely the two credentials declared by this Skill. The exact scope depends on the conte ...[truncated 354 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prefer OpenClaw runtime credential injection and expose only: - `TALENT_API_KEY` - `NEYNAR_API_KEY` 2. Launch the Skill with an allowlisted environment rather than importing a centralized credential file. 3. If runtime injection is unavailable, move credential extraction into a trusted bootstrap component and pass only the selected values to an isolated Skill process. 4. Avoid calling `dotenv.config()` against a shared credential store from a process that loads third-party packages. 5. Add an automated test that places a sentinel unrelated secret in the centralized environment and verifies that it is absent from the Skill process. 6. Document the precise credential boundary rather than claiming isolation based only on filesystem permissions. ]]>
