T09 · Insecure Skill Coding Practices
- Location
SKILL.md:16- Finding
API Key Exposed by Prerequisite Verification Command
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is purpose-aligned for configuring OpenClaw with OpenRouter free models, but it needs Review because it can expose an API key and persistently rewrite OpenClaw model settings without strong confirmation or rollback controls.
Install only if you are comfortable letting this skill read and use an OpenRouter API key, modify your OpenClaw model configuration, and optionally run a watcher that can keep changing the active model. Do not print the API key with `echo`; use a presence-only check instead, keep a backup of `~/.openclaw/openclaw.json`, and prefer pinned install/dependency versions before using it in a sensitive environment.
SKILL.md:16API Key Exposed by Prerequisite Verification Command
skill.json:41Mutable and Incompletely Pinned Installation Dependencies
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
try:
response = requests.get(OPENROUTER_API_URL, headers=headers, timeout=30)
response.raise_for_status()
data = response.json()
return data.get("data", [])
The README presents freeride auto as a one-command setup that modifies openclaw.json and later instructs the user to restart the gateway, but it does not clearly warn that local configuration and running service state will be changed. This can lead users to make unexpected persistent changes, disrupt active workflows, or overwrite intended model settings without informed consent.
The README instructs users to run npx clawhub@latest install freeride, which fetches and executes the latest package version at install time without pinning to a specific trusted release. This creates a supply-chain risk: if the package or one of its dependencies is compromised, users may execute attacker-controlled code during installation.
The README tells users to place an OpenRouter API key in an environment variable or OpenClaw config, but it does not include guidance on secure credential handling. Users may store secrets in plaintext config files, shell history, screenshots, or shared environments, increasing the chance of credential leakage and unauthorized API use.
The skill instructs the agent to read environment variables, access and modify configuration files, install packages, and use network-backed services, yet it declares no explicit tool scope or permissions. This creates unnecessary ambient authority: an agent may invoke sensitive capabilities without clear restriction or user awareness, increasing the blast radius if the skill is triggered unexpectedly or behaves incorrectly.
The description contains broad activation cues like 'free AI,' 'model switching,' 'rate limits,' and 'reduce AI costs,' which can match many ordinary conversations and cause the skill to trigger outside narrowly intended contexts. Because the skill performs config changes and restart actions, overly loose activation materially raises the chance of unintended execution and unauthorized environment modification.
The skill tells the user to export and persist an API key, including storing it via a config command, but it provides no warning about credential sensitivity, storage risks, shell history exposure, or safer secret-handling practices. In a skill that also modifies config and may operate in shared or synced environments, this increases the likelihood of accidental credential disclosure or insecure long-term storage.
The skill can modify the user's authentication profile configuration by adding an OpenRouter auth profile, but this behavior is not clearly disclosed in the manifest description. Hidden auth-related configuration changes can surprise users and expand the skill's effective scope beyond simple model ranking/switching.
The skill overwrites the user's active OpenClaw configuration without any confirmation, backup, or preview of the changes. This can unexpectedly redirect future model usage, break existing setups, or silently alter operational behavior in a way the user did not intend.
This is a manifest file, so vague-trigger checks apply. The description broadly advertises "Unlimited free AI access for OpenClaw" and automatic fallback behavior, but it does not define when this skill should be invoked, what user intents map to it, or any exclusion conditions, making activation scope ambiguous in systems that rely on manifest text for routing.
The manifest requires an OPENROUTER_API_KEY and indicates use of an external AI provider, but it gives no warning about where the credential will be transmitted, stored, or how it will be protected. In a skill that manages remote model access and rewrites local configuration, lack of credential-handling disclosure materially increases the risk of accidental secret exposure or unsafe user trust assumptions.
The install command executes npx clawhub@latest, which pulls and runs whatever code is current at install time rather than a reviewed, immutable version. This creates a supply-chain risk: a compromised or malicious upstream package version could execute arbitrary code during installation and gain access to the user's environment, including credentials and local files.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
try:
response = requests.post(
OPENROUTER_CHAT_URL,
headers=headers,
json=payload,
The watcher automatically rewrites the user's OpenClaw configuration when it detects rate limits or availability changes, without an interactive confirmation or a separate opt-in at the moment of modification. In an agent skill context, silent persistent config changes can violate user expectations, alter future model-routing behavior, and create a confused-deputy risk if triggered indirectly by normal operation or automation.
The manifest describes model ranking, fallback configuration, and updating openclaw.json. In addition to that, the code retrieves the OpenRouter API key from both environment variables and the OpenClaw config, and later exposes its presence/status, which is broader than simple model management behavior.
The skill persists a cache of model metadata under the user's home directory without explicit warning or consent. While the cached data does not appear to include secrets, undisclosed local persistence can still create privacy and transparency issues and may retain information longer than users expect.
The dependency is specified as requests>=2.31.0, which allows any future version and does not guarantee a reproducible or reviewed install. This can introduce vulnerable, incompatible, or unexpected releases into the environment over time, especially since the skill appears to manage networked AI services and likely relies on HTTP requests.
requests>=2.31.0
Because requests is unpinned, it is not possible to determine from the manifest whether deployment will use a version affected by one of several known advisories. In a skill that interacts with external services like OpenRouter, this uncertainty matters more because HTTP client flaws can expose credentials, weaken transport guarantees, or mishandle redirects and authentication.