T09 · Insecure Skill Coding Practices
- Location
SKILL.md:35- Finding
AMap API Key Exposed Through Standard Output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This map-control skill is mostly purpose-aligned, but it should be reviewed because its setup can expose AMap API keys and installs an unpinned global npm package.
Install only if you are comfortable with the agent handling AMap API credentials and a global npm package. Before use, remove or avoid commands that print keys, prefer platform-managed secret injection over reading ~/.openclaw/openclaw.json, pin and review the npm package version, and rotate any AMap key that may already have been printed in logs.
SKILL.md:35AMap API Key Exposed Through Standard Output
SKILL.md:76Mutable Dependency Installed Globally Without Integrity Pinning
This code path explicitly loads AMAP_KEY from a local configuration file using Node and places it into the process environment. Reading credentials from disk on behalf of the agent is credential-access behavior and increases exposure of sensitive data to logs, subprocesses, and any subsequent command execution in the same shell.
if [ -f "$CONFIG_FILE" ]; then
AMAP_KEY=$(node -e "
const c = require('$CONFIG_FILE');
const env = c?.skills?.entries?.['amap-cli-skill']?.env || {};
console.log(env.AMAP_KEY || '');
" 2>/dev/null)
AMAP_SECURITY_KEY=$(node -e "
This code similarly extracts AMAP_SECURITY_KEY from local configuration and exports it for later use. Security keys are sensitive credentials; retrieving them from disk and broadening their availability to the shell and child processes materially increases the chance of leakage or misuse.
" 2>/dev/null)
AMAP_SECURITY_KEY=$(node -e "
const c = require('$CONFIG_FILE');
const env = c?.skills?.entries?.['amap-cli-skill']?.env || {};
console.log(env.AMAP_SECURITY_KEY || '');
" 2>/dev/null)
export AMAP_KEY
The display name and description are entirely in Chinese and present the skill as operating in that language, while the document never offers an alternate language or asks for user preference. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly justified, which is not stated here.
The skill instructs the agent to read API secrets directly from a local OpenClaw configuration file and export them into the current shell. That expands the skill's scope from map control into credential retrieval from disk, which violates least privilege and creates a path for unintended secret access if the skill or downstream commands are compromised.
The documentation contradicts itself by saying environment injection should exist while also directing the agent to bypass that mechanism by reading secrets from disk. This inconsistency encourages unsafe fallback behavior and normalizes secret scraping as part of standard execution.
No suspicious patterns detected.