Back to skill

Security audit

amapgeo

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent AMap location lookup skill that sends user-provided location queries to AMap and uses an API key, with privacy and credential-handling cautions but no hidden or destructive behavior found.

Install only if you are comfortable sending location queries, addresses, coordinates, POI keywords, and route endpoints to AMap. Prefer environment variables or a secret manager for the API key, do not commit `config.txt`, and consider pinning dependencies in a virtual environment.

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)

T08 · Insecure Dependencies

Note
Location
references/README.md:8
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: references/README.md:8-11
Vulnerability Type: Unpinned dependency installation
Risk Level: Low

Complete Code Snippet:

markdown
### 1. Install dependencies

```bash
pip install requests
text

### Technical Analysis

The installation instructions retrieve the latest version of `requests` and its transitive dependencies from the configured Python package index. The project does not provide a pinned requirements file, lockfile, package hashes, or other integrity controls.

Consequently, dependency resolution may produce different code across installations. If a future release or transitive dependency is compromised, users following these instructions could install and execute unreviewed code. No evidence indicates that the current `requests` package is malicious; this finding concerns the absence of reproducible and integrity-verified dependency management.

### Attack Path

1. An attacker compromises a dependency release, a transitive dependency, or the package index used by the victim.
2. A user follows the documented `pip install requests` instruction.
3. `pip` resolves and downloads the attacker-controlled version because no version or hash is constrained.
4. Malicious package code runs during installation or when `scripts/amap_geo.py` imports and uses the dependency.

### Impact Assessment

Malicious dependency code would execute with the privileges of the user running `pip` or the Skill. It could access that user's files, environment variables, API credentials, and network resources. If installation is performed with elevated privileges, the potential scope would increase accordingly.
Remediation
View remediation

Remediation Suggestions

  • Add a reviewed requirements file that pins exact direct and transitive dependency versions.
  • Generate and verify cryptographic hashes, then install with:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  • Use a lockfile-producing dependency-management tool and commit the lockfile.
  • Recommend installation inside a dedicated virtual environment rather than the system Python environment.
  • Regularly scan pinned dependencies for known vulnerabilities and update them through a controlled review process.

T09 · Insecure Skill Coding Practices

Warning
Location
config.example.txt:8
Finding

API Credentials May Be Stored in an Unprotected Plaintext Project File

Content
View full analysis

Vulnerability Details

File Location: config.example.txt:8-14; related behavior in scripts/amap_geo.py:40-42,57-71 and instructions in SKILL.md:78-82
Vulnerability Type: Plaintext sensitive-data storage
Risk Level: Medium

Complete Code Snippets:

text
# API Key (required)
AMAP_API_KEY=your_api_key_here

# Secret Key (optional, used for advanced API signature verification)
# Leave empty if advanced features are not needed
AMAP_SECRET_KEY=your_secret_key_here
python
CONFIG_FILE = os.path.join(SKILL_DIR, "config.txt")
python
api_key = os.environ.get("AMAP_API_KEY")
secret_key = os.environ.get("AMAP_SECRET_KEY", "")

if not api_key and os.path.exists(CONFIG_FILE):
    with open(CONFIG_FILE, "r") as f:
        for line in f:
            line = line.strip()
            if line and not line.startswith("#"):
                if "=" in line:
                    k, v = line.split("=", 1)
                    k, v = k.strip(), v.strip()
                    if k == "AMAP_API_KEY":
                        api_key = v
                    elif k == "AMAP_SECRET_KEY":
                        secret_key = v

The documentation instructs users to create the credential file as follows:

bash
cp config.example.txt config.txt
# Edit config.txt and enter your Key

Technical Analysis

The supported configuration flow places a long-lived Amap API key and optional signing secret in config.txt within the project root. The script reads this file as ordinary plaintext and does not verify or enforce restrictive filesystem permissions.

The reviewed project structure contains no .gitignore entry protecting config.txt, and the documentation does not warn users against committing, sharing, or broadly permissioning the file. Environment variables are documented as preferred, but plaintext project-file storage remains an explicitly supported workflow.

This ...[truncated 1235 chars]

Remediation
View remediation

Remediation Suggestions

  • Prefer a platform secret manager or protected environment-variable injection instead of project-local credential files.
  • Add config.txt to a committed .gitignore file.
  • Clearly warn users never to commit or distribute populated configuration files.
  • If file-based configuration must remain supported, require restrictive permissions such as 0600 and reject files readable by other users where the platform supports permission checks.
  • Store credentials outside the project directory and allow the path to be supplied securely.
  • Recommend Amap-side restrictions such as least-privilege service enablement, usage limits, and any available source restrictions.
  • Document immediate credential rotation procedures for suspected exposure.
  • Add secret-scanning checks to the development and release workflow.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill describes geocoding, POI, routing, and distance features but does not clearly warn users that their queries, addresses, or coordinates will be transmitted to the Gaode/AMap external API. Because location data is sensitive, omission of this disclosure undermines informed consent and increases privacy risk if users provide home, work, or real-time location information.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger examples are broad enough to match ordinary conversation such as asking for nearby places or saying '定位一下', which can cause the skill to activate unexpectedly. In a location-based skill, accidental activation can result in address or location-related content being sent to an external mapping service without clear user intent, creating privacy and consent risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README encourages use of geocoding, POI search, routing, and distance features that necessarily send addresses, coordinates, and search terms to the Amap API, but it does not warn users that potentially sensitive location data will be transmitted to a third party. In an agent-skill context, this increases the risk of users or integrators unknowingly exposing personal, customer, or operational location data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends user-supplied addresses, coordinates, and search terms to Amap over the network as part of its core functionality, but it provides no privacy notice, consent prompt, or warning that location data leaves the local environment. Because location and address data can be sensitive personal information, this creates a real privacy-risk issue, especially when embedded in a broader agent workflow where users may not realize a third party receives their data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

All user-facing documentation, trigger examples, and command examples are presented only in Chinese, and the skill examples imply Chinese-language interaction as the expected mode. Under the policy, forcing a specific language without user opt-in can be a natural-language policy issue unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This plain-text configuration example uses Chinese for all user-facing instructions and comments, which can constitute a language/locale policy issue when no user opt-in or alternative language is provided. The file does not indicate that the skill is region-specific or that Chinese is an intentional, documented locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language instructions, headings, examples, and troubleshooting content are all presented in Chinese. Under the stated policy, forcing a specific language without user opt-in can be a language/locale policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Natural-language instructions, help text, and errors are presented only in Chinese, with no indication that users may choose another language. Under the stated policy, forcing a specific language without opt-in can be a locale/language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.