Back to skill

Security audit

高德地图

Security checks for vulnerabilities and agentic risk

Overview

This AMap route-planning skill is coherent and purpose-aligned, with manageable privacy and API-key handling risks users should understand.

Install only if you are comfortable sending queried addresses and your AMap Web Service API key to AMap. Store ~/.openclaw/credentials/amap.json with restrictive permissions, avoid shell tracing or logging full request URLs, and consider rotating the key if it may have appeared in process logs.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/route.sh:26
Finding

Amap API key exposed through curl process arguments

Content
View full analysis
/dev/null) TO_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${TO}&key=${API_KEY}" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['geocodes'][0]['location'] if d.get('geocodes') else '')" 2>/dev/null) if [ -z "$FROM_LOC" ] || [ -z "$TO_LOC" ]; then echo "Error: Geocoding failed; verify that the supplied addresses are valid" exit 1 fi curl -s "https://restapi.amap.com/v3/direction/${MODE}?origin=${FROM_LOC}&destination=${TO_LOC}&key=${API_KEY}" | python3 -c " ``` The usage example in `SKILL.md` demonstrates the same pattern by interpolating the API key into curl request URLs. ### Technical Analysis The script expands `API_KEY` into each URL before starting curl. Consequently, the complete URL, including the `key` query parameter, becomes part of curl's process argument vector. On systems where process metadata is visible to other users, a local account or monitoring process can inspect the command through facilities such as `/proc`, `ps`, process accounting, audit logging, or observability agents. Although HTTPS protects the query string in transit, it does not prevent local disclosure through the process list. Embedding credentials in URLs also increases the chance that they will be captured by debugging output, proxy logs, shell tracing, or telemetry that records request URLs. The documentation propagates this unsafe usage pattern to users. ### Attack Path 1. A victim configures a valid Amap API key and invokes `scripts/route.sh`. 2. The shell expands ...[truncated 944 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:18
Finding

Credential file is used without documented or enforced restrictive permissions

Content
View full analysis
/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get('amap',{}).get('api_key',''))" 2>/dev/null) ``` The setup documentation instructs users to create `~/.openclaw/credentials/amap.json` with an `amap.api_key` value, but does not require restrictive directory or file permissions. ### Technical Analysis The dedicated Amap credential is necessary for the declared route-query functionality, so accessing this file does not itself exceed minimum privilege. The weakness is that the setup instructions do not establish secure ownership and permissions, and the script does not verify them before loading the secret. The resulting protection depends on the user's umask, editor, file-creation method, and existing directory permissions. If the file is created as group-readable or world-readable, another local user may retrieve the API key directly. This is a conditional local information-disclosure weakness rather than evidence of deliberate credential theft. The script reads only the declared Amap credential and sends it only to the documented Amap API host. ### Attack Path 1. A user follows the setup instructions and creates `~/.openclaw/credentials/amap.json`. 2. Because no secure creation command or required permission mode is documented, the file or parent directory is created with permissive access. 3. Another local user enumerates the credential directory and reads the JSON file. 4. The attacker extracts the `amap.api_key` value. 5. The attacker reuses the key for unauthorized Amap API requests. This path is exploitable only when ...[truncated 608 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 52)May include surrounding context.

md
TO="景德镇"

# 地理编码
FROM_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${FROM}&key=${AMAP_KEY}" | python3 -c "import sys,json; print(json.load(sys.stdin)['geocodes'][0]['location'])")
TO_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${TO}&key=${AMAP_KEY}" | python3 -c "import sys,json; print(json.load(sys.stdin)['geocodes'][0]['location'])")

# 路径规划

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 53)May include surrounding context.

md
# 地理编码
FROM_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${FROM}&key=${AMAP_KEY}" | python3 -c "import sys,json; print(json.load(sys.stdin)['geocodes'][0]['location'])")
TO_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${TO}&key=${AMAP_KEY}" | python3 -c "import sys,json; print(json.load(sys.stdin)['geocodes'][0]['location'])")

# 路径规划
curl -s "https://restapi.amap.com/v3/direction/bicycling?origin=${FROM_LOC}&destination=${TO_LOC}&key=${AMAP_KEY}"

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/route.sh (reported line 26)May include surrounding context.

sh
exit 1
fi

FROM_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${FROM}&key=${API_KEY}" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['geocodes'][0]['location'] if d.get('geocodes') else '')" 2>/dev/null)
TO_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${TO}&key=${API_KEY}" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['geocodes'][0]['location'] if d.get('geocodes') else '')" 2>/dev/null)

if [ -z "$FROM_LOC" ] || [ -z "$TO_LOC" ]; then

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/route.sh (reported line 27)May include surrounding context.

sh
fi

FROM_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${FROM}&key=${API_KEY}" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['geocodes'][0]['location'] if d.get('geocodes') else '')" 2>/dev/null)
TO_LOC=$(curl -s "https://restapi.amap.com/v3/geocode/geo?address=${TO}&key=${API_KEY}" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['geocodes'][0]['location'] if d.get('geocodes') else '')" 2>/dev/null)

if [ -z "$FROM_LOC" ] || [ -z "$TO_LOC" ]; then
    echo "错误: 地理编码失败,请检查输入的地址是否正确"

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/route.sh (reported line 34)May include surrounding context.

sh
exit 1
fi

curl -s "https://restapi.amap.com/v3/direction/${MODE}?origin=${FROM_LOC}&destination=${TO_LOC}&key=${API_KEY}" | python3 -c "
import sys, json
d = json.load(sys.stdin)
if d.get('status') == '1':

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill demonstrates shell-based usage examples and code capabilities but does not declare any tool scope or allowed-tools restrictions. This increases the chance that an agent using the skill could invoke broader shell access than necessary, expanding blast radius if prompts or parameters are abused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script sends user-supplied origin/destination data and the API key to a third-party mapping service without any explicit privacy notice or consent flow. In a location-query skill, this is expected behavior, but location data is sensitive and silent transmission can surprise users or violate data-handling expectations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill manifest and documentation describe a Gaode Maps capability for route planning, distance calculation, and geolocation search. Listing ffmpeg for audio processing introduces a capability that is not justified anywhere by the stated map-query purpose, making the documented scope broader than necessary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Natural-language strings in the header comments and user-facing messages are fixed to Chinese, which can impose a language choice on users without opt-in. The policy specifically calls for flagging language or locale constraints when no user choice is provided.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest says the skill requires configuration via AMAP_API_KEY, which suggests an environment-variable-based credential input. The code instead reads ~/.openclaw/credentials/amap.json directly, adding local credential-file access that is not part of the stated route-query purpose and is not described in the manifest.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.