Back to skill

Security audit

腾讯地图WebserviceAPI开发技能

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a Tencent Maps development reference, but it also guides the agent through phone verification, API-key creation or reuse, and local plaintext key storage, so it should be reviewed before installation.

Install only if you want the assistant to help with Tencent Maps JSAPI development and are comfortable with the temporary-key workflow. Before using that workflow, expect to provide a phone number and SMS code, and assume tokens and API keys may appear in command logs, stdout, or ~/.tencentmap/tempkey.json. Prefer providing your own restricted key via TMAP_JSAPI_KEY, avoid running this on shared machines, and rotate or revoke any key that may have been exposed.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
tencentmap-jsapi-gl-skill/scripts/create_key.py:93
Finding

Sensitive credentials exposed through command-line arguments and standard output

Content
View full analysis
"}, ensure_ascii=False )) sys.exit(1) result = create_key(sys.argv[1], sys.argv[2], sys.argv[3]) print(json.dumps(result, ensure_ascii=False)) ``` From `supplement_key.py`: ```python token = sys.argv[1] action = sys.argv[2] mkey = sys.argv[3] if len(sys.argv) > 3 else "" result = supplement(token, action, mkey) print(json.dumps(result, ensure_ascii=False)) ``` From `save_config.py`: ```python if len(sys.argv) >= 4 and sys.argv[2] != "--mark-expired": is_existing = False if len(sys.argv) >= 5: is_existing = sys.argv[4].lower() == "true" result = save_config(sys.argv[1], sys.argv[2], sys.argv[3], is_existing) ``` The documented invocation model is equivalent to: ```bash python3 scripts/create_key.py python3 scripts/supplement_key.py reuse python3 scripts/save_config.py ``` ### Technical Analysis The workflow places phone numbers, SMS verification codes, session tokens, supplement tokens, and full Tencent Maps API keys in process command-line arguments. Depending on the operating system and execution environment, command lines can be exposed through: ...[truncated 2245 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
tencentmap-jsapi-gl-skill/scripts/save_config.py:36
Finding

Plaintext phone numbers and API keys stored without enforced restrictive permissions

Content
View full analysis
dict: config_path = get_config_path() config_dir = os.path.dirname(config_path) records = {} if os.path.exists(config_path): try: with open(config_path, "r", encoding="utf-8") as f: records = json.load(f) except Exception: records = {} existing = records.get(phone, {}) is_new = not (existing.get("key") == key) records[phone] = { "key": key, "expire_time": expire_time, "applied_at": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "status": "active", "is_existing": is_existing, "quota": { "pv_per_day": 5000, "qps": 5, }, } try: os.makedirs(config_dir, exist_ok=True) with open(config_path, "w", encoding="utf-8") as f: json.dump(records, f, ensure_ascii=False, indent=2) ``` The resulting file is: ```text ~/.tencentmap/tempkey.json ``` ### Technical Analysis The configuration file stores the user's complete phone number as a JSON key and the complete Tencent Maps API key as plaintext. The code creates the directory and file without explicitly enforcing restrictive permissions. On POSIX systems, actual permissions therefore depend on the current process umask and any permissions already assigned to an existing file. A permissive umask can create a file readable by other local users. Reopening an existing file with `"w"` truncates it but does not correct insecure pre-existing permissions. The implementation also writes directly to the destination file instead of using a protected temporary file followed by an atomic replacement. An interruption can tru ...[truncated 1452 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
tencentmap-jsapi-gl-skill/references/jsapigl/demos/地图操作示例_创建地图.html:10
Finding

Shared Tencent Maps API key embedded in distributable demonstration files

Content
View full analysis
``` ### Technical Analysis A Tencent Maps API key is embedded directly in HTML demonstrations distributed with the Skill. Browser-side JavaScript API keys are inherently visible to users, so their security depends on strong server-side restrictions such as allowed referrers, API scopes, quotas, and expiration policies. Bundling a shared working key still creates two risks: - Anyone receiving the repository can extract and replay it. - Users may copy the demonstration unchanged into deployed applications, propagating reliance on a shared credential. The audit did not establish the key's current validity, billing status, or restriction policy. Consequently, the practical impact depends on its server-side configuration. ### Attack Path 1. An attacker downloads or inspects the publicly distributed demonstration files. 2. The attacker extracts the embedded Tencent Maps key. 3. The attacker attempts to use the key from another website or client. 4. If referrer and API restrictions are absent or incomplete, the attacker consumes the key's available quota or invokes enabled map services. 5. Legitimate demonstrations or applications relying on the key experience quota exhaustion or key revocation. A secondary propagation path is: 1. A developer copies a bundled demonstration into an application. 2. The developer does not replace the shared key. 3. The application enters production using a credential controlled outside that application's security lifecycle. 4. Revocation, quota abuse, or policy changes disrupt the application. ...[truncated 551 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (370)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Automating creation or reuse of Tencent Map API keys through backend supplement APIs and transmitting tokens such as supplement_token or mkey goes beyond development guidance into privileged account/key management. In this context, the mismatch is especially dangerous because API keys are sensitive assets that can be abused for quota theft, unauthorized usage, and account impact if handled by an overprivileged skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Automating creation or reuse of Tencent Map API keys through backend supplement APIs and transmitting tokens such as supplement_token or mkey goes beyond development guidance into privileged account/key management. In this context, the mismatch is especially dangerous because API keys are sensitive assets that can be abused for quota theft, unauthorized usage, and account impact if handled by an overprivileged skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Automating creation or reuse of Tencent Map API keys through backend supplement APIs and transmitting tokens such as supplement_token or mkey goes beyond development guidance into privileged account/key management. In this context, the mismatch is especially dangerous because API keys are sensitive assets that can be abused for quota theft, unauthorized usage, and account impact if handled by an overprivileged skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Automating creation or reuse of Tencent Map API keys through backend supplement APIs and transmitting tokens such as supplement_token or mkey goes beyond development guidance into privileged account/key management. In this context, the mismatch is especially dangerous because API keys are sensitive assets that can be abused for quota theft, unauthorized usage, and account impact if handled by an overprivileged skill.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · tencentmap-jsapi-gl-skill/references/jsapigl/docs/矢量图形.md (reported line 464)May include surrounding context.

md
<br><br>
## MVTLayer{#MVTLayer}
-------
​&nbsp;&nbsp;&nbsp;&nbsp;用于创建符合mapbox-vector-tile标准的图层对象,叠加在地图上进行显示;**注意,添加MVTLayer后不支持地图设置中心点偏移**。


| 构造函数                                            |

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · tencentmap-jsapi-gl-skill/references/jsapigl/docs/附加库:矢量数据图层.md (reported line 38)May include surrounding context.

md
<br><br>
## MVTLayer{#MVTLayer}
-------
​&nbsp;&nbsp;&nbsp;&nbsp;用于创建符合mapbox-vector-tile标准的图层对象,叠加在地图上进行显示;**注意,添加MVTLayer后不支持地图设置中心点偏移**。


| 构造函数                                            |

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This script performs SMS verification-code delivery and returns a session token, which is unrelated to the declared Tencent Map JSAPI GL documentation/development purpose. That capability indicates hidden authentication functionality inside a mismatched skill, increasing the likelihood of covert account access workflows or unauthorized platform interaction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code not only triggers phone-based authentication but also extracts and returns a session token, enabling downstream authenticated actions outside the stated map-development assistant context. In a documentation-oriented skill, embedded credential or session acquisition logic is especially dangerous because it can be abused to bootstrap unauthorized access while appearing unrelated to the advertised functionality.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code is wired to call an authenticated Tencent administrative API endpoint using a caller-supplied supplement token and returns created or reused keys in plaintext JSON. That capability is not justified by the declared skill purpose of JavaScript GL development guidance, and the mismatch increases the likelihood of privilege misuse, accidental key issuance, and exfiltration of sensitive credentials through normal tool invocation paths.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This script implements live administrative behavior to create or reuse Tencent LBS console keys via a privileged supplement endpoint, rather than providing passive documentation or local development assistance. In the context of a map-development guidance skill, bundling credential-provisioning automation expands the skill into secret-handling and account-modifying operations, which could be abused to mint or recover usable API keys if a supplement token is exposed.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 28)May include surrounding context.

Claude Desktop (local)

  • Skills directory is usually: ~/.claude/skills/
  • Register via symlink (recommended):
    bash
    ln -sfn "$(pwd)/tencentmap-jsapi-gl-skill" ~/.claude/skills/tencentmap-jsapi-gl-skill
    

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README says the assistant will use the skill when questions mention 'Tencent Map', 'TMap', 'jsapi-gl', 'or similar'. The phrase 'or similar' leaves the activation boundary undefined, making it unclear what terms should or should not invoke the skill.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README_zh.md (reported line 28)May include surrounding context.

Claude Desktop(本地)

  • Skills 目录一般为:~/.claude/skills/
  • 注册(软链,推荐):
    bash
    ln -sfn "$(pwd)/tencentmap-jsapi-gl-skill" ~/.claude/skills/tencentmap-jsapi-gl-skill
    

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README_zh.md (reported line 28)May include surrounding context.

Claude Desktop(本地)

  • Skills 目录一般为:~/.claude/skills/
  • 注册(软链,推荐):
    bash
    ln -sfn "$(pwd)/tencentmap-jsapi-gl-skill" ~/.claude/skills/tencentmap-jsapi-gl-skill
    

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares capabilities that imply access to environment variables, local files, and network resources, but it does not explicitly scope or constrain those tools via permissions or allowed-tools. In a skill that also instructs reading API keys from env/files and potentially retrieving keys, this increases the chance of unintended credential access or overbroad execution beyond the user’s map-development request.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The auto-trigger condition is broad enough to match common map-related questions, which can cause the skill to activate unexpectedly in contexts where users did not intend Tencent Maps-specific behavior. When combined with credential/file/network-related capabilities, accidental activation increases the risk of unnecessary sensitive data access and confusing cross-context behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs checking environment variables and local key files for TMAP_JSAPI_KEY without clearly warning the user that sensitive credentials may be accessed. In a skill that already appears to blur the boundary between documentation assistance and key-management behavior, silent credential access materially increases the risk of unauthorized exposure or use of secrets.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · tencentmap-jsapi-gl-skill/references/api_reference.md (reported line 91)May include surrounding context.

请求示例

bash
curl -s -X POST 'https://lbsconsole.map.qq.com/nosession/http/skill/auth/send-code' \
  -H 'Content-Type: application/json' \
  -H 'X-Skill-Nonce: abc123def456' \
  -H 'X-Skill-Timestamp: 1752662400' \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document includes full example values for API keys and bearer-style tokens but does not explicitly warn that these values are sensitive secrets that must not be logged, screenshotted, persisted insecurely, or exposed in client-side UI. In a skill that helps users implement these flows, omission of handling guidance increases the chance developers will treat real tokens and keys like ordinary example fields and leak them through logs or front-end rendering.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · tencentmap-jsapi-gl-skill/references/api_reference.md (reported line 294)May include surrounding context.

请求示例 1:action=reuse(复用老 Key 补额)

bash
curl -s -X POST 'https://lbsconsole.map.qq.com/nosession/http/skill/v2/tempkey/supplement' \
  -H 'Content-Type: application/json' \
  -H 'X-Skill-Nonce: reuse001' \
  -H 'X-Skill-Timestamp: 1752662460' \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The demo performs a JSONP request by injecting a remote

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The page automatically performs IP-based geolocation on load via locate() and also allows lookup of arbitrary IP addresses, but it does not provide a clear privacy disclosure, consent prompt, or explanation of what data is sent to Tencent's service. In a browser context, users may not reasonably expect their IP-derived location to be queried and displayed immediately, which creates a privacy and compliance risk rather than a memory/code-execution flaw.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The convert() function takes the user-provided address and transmits it via TMap.service.Geocoder.getLocation(), which is a network call that sends potentially sensitive location data to an external service. The code does not provide any visible notice, confirmation, or explanatory comment near the action to disclose that the entered address will be sent off-device.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The searchClick function takes user input and sends it to https://apis.map.qq.com/ws/place/v1/search as part of the request URL. The UI explains search behavior, but it does not warn that entered queries are transmitted to a third-party service, which is a privacy-relevant action.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation embeds a live third-party script URL with a visible API key directly in sample code and gives no warning about credential handling, domain restrictions, quota abuse, or the trust implications of loading remote JavaScript. Even if the key is only demonstrative, readers may copy it verbatim or normalize the unsafe practice of hardcoding production keys into client-side examples.

Content

No source excerpt is available for this finding.