Back to skill

Security audit

amap-jsapi-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a map-development helper, but it asks for broad read, write, and command execution authority while also describing unrelated security-scanning and generic automation behavior.

Install only if you are comfortable letting this skill guide an agent that may read files, write files, and run commands. Keep use limited to a single AMap project, review every file change and command before execution, avoid sharing unrelated credentials, and store AMap secrets through environment variables or a backend proxy rather than in frontend code.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:20
Finding

Excessive Tool Permissions Violate Least-Privilege Principles

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 20–23
Vulnerability Type: Excessive filesystem and command-execution permissions
Risk Level: Medium

Vulnerable Code

yaml
tools:
- read
- exec
- write

Technical Analysis

The skill declares unrestricted reading, writing, and command-execution capabilities even though its stated primary purpose is to provide AMap JSAPI integration guidance and examples. Such documentation-oriented functionality does not inherently require general system-command execution or unrestricted filesystem access.

Although the document advises using a sandbox and command allowlist, it does not define or enforce path restrictions, permitted commands, user approval requirements, or other technical controls. Consequently, the declared permissions exceed the minimum capabilities needed for the advertised map-development workflow.

The declaration alone does not prove that commands will be executed maliciously. However, in an agent platform that grants these tools according to the skill manifest, untrusted or adversarial task content could induce the agent to use them outside the legitimate scope of AMap integration.

Attack Path

  1. A user or untrusted project supplies crafted content disguised as a map-integration, configuration, or troubleshooting request.
  2. The skill is loaded with read, write, and exec capabilities.
  3. The crafted content persuades the agent to inspect files outside the relevant project, write unauthorized files, or execute an unrelated system command.
  4. Because the skill specifies no enforceable path boundary, command allowlist, or approval gate, the platform may permit the operation under the skill's declared authority.
  5. The attacker may obtain access to readable local information, modify files writable by the agent process, or execute commands with the privileges of that process.

Impact Assessment

Successful exploitation could provide the attacker with the eff ...[truncated 748 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the exec capability unless a concrete, indispensable map-development operation requires it.
  2. Grant read and write access only when needed and restrict both capabilities to the active project directory.
  3. Use read-only access by default and require explicit user confirmation before writing or modifying files.
  4. If command execution is retained, enforce a small allowlist of commands and fixed argument patterns; never interpolate untrusted user input into shell commands.
  5. Run all permitted commands in a sandbox with restricted filesystem, process, environment-variable, and network access.
  6. Require explicit approval before commands with side effects are executed.
  7. Prevent access to credential stores, SSH material, shell configuration, system directories, and unrelated user files.
  8. Document the precise reason each tool is required and remove generic capabilities not directly necessary for AMap JSAPI integration.
  9. Add runtime logging and auditing for filesystem operations and command execution without recording secrets.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The invocation guidance is overly broad, telling users to use the skill for API integration, webhook configuration, and system connection tasks well beyond AMap JSAPI development. Ambiguous activation criteria can cause an agent to apply this skill in high-impact contexts where its read/write/exec abilities are unnecessary and risky.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description states '支持中文交互' in a way that presents Chinese as the expected interaction language, but it does not offer alternative language support or make this a user opt-in choice. For a general development skill, this creates a locale policy concern because users may be implicitly constrained to one language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill advertises file writing, command execution, and external API usage without clear user-facing warnings about side effects, permissions, or approval requirements. In an agent environment, that omission is dangerous because users may trigger state-changing or networked actions without understanding the operational impact.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as an AMap JSAPI/WebGL integration aid, but it also advertises unrelated security auditing, vulnerability scanning, and CVE correlation features. This kind of capability drift is dangerous because it broadens the expected authority and may justify out-of-scope actions or data access that users would not anticipate from a mapping skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Advertising security vulnerability scanning and asset risk scoring inside a map JSAPI skill is context-inappropriate and suggests hidden or excessive operational scope. This mismatch can normalize high-privilege analysis behaviors in contexts where users expect only frontend map integration guidance.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The declared request/response contract describes a generic content-processing tool rather than a map-specific integration skill. This ambiguity increases the chance that an agent will treat arbitrary input as something to process broadly, enabling scope creep into unintended file, API, or execution workflows.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation expands the skill into generic file handling, command execution, and information retrieval beyond the stated AMap purpose. In a skill with read/write/exec tools, broadening the mission this way materially increases the chance of unauthorized file modification, shell use, or external data access under the guise of a map task.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Earlier documentation specifically instructs use of the AMap security environment variable AMAP_SECURITY_JS_CODE for JSAPI authentication. Later, the file switches to a generic API_KEY export block, which contradicts the AMap-specific credential guidance and suggests a different authentication mechanism than the skill otherwise documents.

Content

No source excerpt is available for this finding.