T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:5- Finding
Unnecessary Direct Access to Secret-Bearing Runtime Configuration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 5–6, 13–15, 151–157, and 321–322
Vulnerability Type: Least-privilege violation through direct credential-file and environment access
Risk Level: MediumVulnerable Instructions
text using the default OpenClaw image model and API key from ~/openclaw/.envtext # The agent must NOT ask the user for API keys; it must read and reuse # the default image model and apiKey from the existing OpenClaw config # in ~/openclaw/.env or equivalent runtime config.text All images are generated using the **default** image model and API key that are already configured in OpenClaw. The agent must not prompt the user for keys, tokens, or secret values. Instead: - Read the image model and credentials from the existing OpenClaw runtime configuration (for example the `.env` file under `~/openclaw/` or equivalent environment variables). - Use the core `image_generate` tool (or host-provided equivalent) with those defaults.text 4. Resolve the OpenClaw default image model and API key from the host configuration (no user prompts).Technical Analysis
The Skill explicitly requires the Agent to read an API key from
~/openclaw/.env, an equivalent runtime configuration, or environment variables. This exceeds the minimum privileges required to enrich a Markdown document with images. The sanctionedimage_generatetool should obtain its credentials internally through the host's credential-management boundary; the Agent does not need access to the raw secret.A
.envfile or the process environment may contain credentials unrelated to image generation. The phrase “equivalent environment variables” is also insufficiently scoped and could lead to inspection of the broader runtime environment rather than a dedicated, non-secret model setting.These instructions contradict the Skill's own filesystem restrictions, which state that access should be limited to the requested Ma ...[truncated 1493 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove every instruction requiring the Agent to read
~/openclaw/.env, raw API keys, credentials, or general environment variables. - Require the Agent to invoke
image_generatewith host-managed defaults, without receiving or resolving the underlying credential. - If model discovery is necessary, expose a dedicated host API that returns only non-secret model metadata.
- Explicitly prohibit reading secret-bearing dotfiles and enumerating environment variables.
- Preserve the existing filesystem allowlist: the user-specified Markdown file, its sibling
_img.mdoutput, and the siblingimg/directory. - Replace the affected instructions with wording such as:
text Use the host-provided image_generate tool with its configured default model. Credential resolution must be performed internally by the host. Do not read, request, display, log, or otherwise handle API keys, .env files, or runtime environment secrets.- Ensure failures from
image_generatereturn only sanitized configuration errors and never raw tokens or environment contents.
- Remove every instruction requiring the Agent to read
