Back to skill

Security audit

LovTrip China Map (Amap)

Security checks for vulnerabilities and agentic risk

Overview

The skill provides the advertised China map functions, but its install path and fallback script create avoidable code-execution and supply-chain risks.

Review before installing. Pin the LovTrip npm package to a reviewed exact version, avoid automatic npx -y execution where possible, run the MCP server with minimal filesystem and environment access, and do not use the fallback amap.sh script with untrusted addresses or keywords until its Python argument handling is fixed. Expect precise location data and map queries to be sent to external map services.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/amap.sh:38
Finding

Arbitrary Python Code Execution Through Unsafe Argument Interpolation

Content
View full analysis
[city]}" city="${2:-}" url="$BASE/geocode/geo?key=$API_KEY&address=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$address'))")" [ -n "$city" ] && url="$url&city=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$city'))")" ``` The same issue occurs in the nearby-search handler: ```bash keywords="${3:?用法: amap.sh nearby }" radius="${4:-2000}" curl -s "$BASE/place/around?key=$API_KEY&location=$lng,$lat&keywords=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$keywords'))")&radius=$radius" | python3 -m json.tool ``` ### Technical Analysis The `address`, `city`, and `keywords` shell arguments are inserted directly into Python source code passed to `python3 -c`. Shell quoting prevents ordinary shell expansion of the values at that stage, but it does not make those values safe Python string literals. A value containing a single quote and Python syntax can terminate the intended string, close the surrounding function calls, and append arbitrary statements. For example, an input shaped like: ```text ')); __import__("os").system("id"); # ``` would cause the generated Python program to contain an attacker-controlled call to `os.system`. URL encoding therefore occurs only after the value has already been interpreted as Python source. This flaw affects every invocation path that performs URL encoding through this interpolation pattern: - `geocode` address - `geocode` city - `nearby` keywords The network response pipelines such as: ```bash curl -s "$url" | python3 -m json.tool ``` do not independently execute the downloaded response. They parse it as JSON and are not equivalent to `curl | bash`. The confirmed execution risk arises from local argument inte ...[truncated 1551 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:20
Finding

Automatic Execution of an Unpinned Mutable npm Package

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill metadata and description understate important behavior and trust boundaries: it relies on an external MCP server and Amap REST API using an API key, and handles sensitive location queries that are sent off-box. Even if the extra capabilities are travel-related, incomplete disclosure can mislead users and operators about data exposure, network use, and required permissions.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The script performs outbound network requests to the Amap API via curl, but the capability is not declared in permissions. In an agent skill ecosystem, undeclared network access is a real security and governance issue because it can exfiltrate user-provided data and bypass user/admin expectations about what the skill is allowed to do.

Content

No source excerpt is available for this finding.

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/amap.sh (reported line 41)May include surrounding context.

sh
city="${2:-}"
    url="$BASE/geocode/geo?key=$API_KEY&address=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$address'))")"
    [ -n "$city" ] && url="$url&city=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$city'))")"
    curl -s "$url" | python3 -m json.tool
    ;;

  reverse)

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/amap.sh (reported line 47)May include surrounding context.

sh
reverse)
    lng="${1:?用法: amap.sh reverse <lng> <lat>}"
    lat="${2:?用法: amap.sh reverse <lng> <lat>}"
    curl -s "$BASE/geocode/regeo?key=$API_KEY&location=$lng,$lat" | python3 -m json.tool
    ;;

  nearby)

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/amap.sh (reported line 55)May include surrounding context.

sh
lat="${2:?用法: amap.sh nearby <lng> <lat> <keywords>}"
    keywords="${3:?用法: amap.sh nearby <lng> <lat> <keywords>}"
    radius="${4:-2000}"
    curl -s "$BASE/place/around?key=$API_KEY&location=$lng,$lat&keywords=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$keywords'))")&radius=$radius" | python3 -m json.tool
    ;;

  route)

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/amap.sh (reported line 65)May include surrounding context.

sh
d_lat="$4"
    mode="${5:-transit}"
    if [ "$mode" = "transit" ]; then
      curl -s "$BASE/direction/transit/integrated?key=$API_KEY&origin=$o_lng,$o_lat&destination=$d_lng,$d_lat&city=北京" | python3 -m json.tool
    elif [ "$mode" = "driving" ]; then
      curl -s "$BASE/direction/driving?key=$API_KEY&origin=$o_lng,$o_lat&destination=$d_lng,$d_lat" | python3 -m json.tool
    else

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/amap.sh (reported line 67)May include surrounding context.

sh
if [ "$mode" = "transit" ]; then
      curl -s "$BASE/direction/transit/integrated?key=$API_KEY&origin=$o_lng,$o_lat&destination=$d_lng,$d_lat&city=北京" | python3 -m json.tool
    elif [ "$mode" = "driving" ]; then
      curl -s "$BASE/direction/driving?key=$API_KEY&origin=$o_lng,$o_lat&destination=$d_lng,$d_lat" | python3 -m json.tool
    else
      curl -s "$BASE/direction/walking?key=$API_KEY&origin=$o_lng,$o_lat&destination=$d_lng,$d_lat" | python3 -m json.tool
    fi

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/amap.sh (reported line 69)May include surrounding context.

sh
elif [ "$mode" = "driving" ]; then
      curl -s "$BASE/direction/driving?key=$API_KEY&origin=$o_lng,$o_lat&destination=$d_lng,$d_lat" | python3 -m json.tool
    else
      curl -s "$BASE/direction/walking?key=$API_KEY&origin=$o_lng,$o_lat&destination=$d_lng,$d_lat" | python3 -m json.tool
    fi
    ;;

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/amap.sh (reported line 75)May include surrounding context.

sh
detail)
    poi_id="${1:?用法: amap.sh detail <poi_id>}"
    curl -s "$BASE/place/detail?key=$API_KEY&id=$poi_id" | python3 -m json.tool
    ;;

  *)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill does not clearly warn that user-supplied addresses, coordinates, and place searches will be transmitted to third-party services via LovTrip MCP and Amap APIs. Because location data is sensitive, lack of notice can cause unintended disclosure of personal travel patterns, home/work addresses, or meeting locations.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · reference.md (reported line 39)May include surrounding context.

md
"map_links": {
    "amap": { "link": "https://uri.amap.com/marker?..." },
    "tencent": { "link": "https://apis.map.qq.com/uri/v1/marker?..." },
    "baidu": { "link": "https://api.map.baidu.com/marker?..." },
    "apple": { "link": "https://maps.apple.com/?..." }
  },
  "navigation_links": [

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends addresses, coordinates, POI IDs, and search keywords directly to an external API without any user-facing disclosure or consent flow. In this skill context, that data may contain sensitive location or travel intent information, so silent transmission to a third party creates a genuine privacy risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The transit routing request hard-codes city=北京, which can silently alter results for users requesting routes elsewhere in China. This is primarily an integrity and user-trust issue rather than a classic exploit path, but it can produce misleading outputs in a location-sensitive skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

SQP-3 applies to all file types and includes language or locale policy violations. This reference file presents all instructions and examples only in Chinese, with no opt-in, alternative language, or explicit justification that the skill is restricted to Chinese-speaking users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The script requires the AMAP_API_KEY environment variable, which is a credential-like secret, but only states that it must be set. It does not include any warning or explanatory note about using an API key, how it is consumed, or the sensitivity of storing/exporting it in the environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.