Back to skill

Security audit

tmap-test

Security checks for vulnerabilities and agentic risk

Overview

This Tencent Maps skill is mostly purpose-aligned, but it needs Review because normal use can expose a user's Tencent Maps API key and precise location or itinerary data in returned URLs.

Install only if you are comfortable sending map searches, addresses, coordinates, travel plans, and trail data links to Tencent Maps. Use a restricted, temporary Tencent Maps API key with low quotas, rotate it after testing, and avoid sharing generated links that contain key=, precise coordinates, or private itinerary data.

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

T09 · Insecure Skill Coding Practices

Error
Location
references/scene2-nearby-search.md:73
Finding

API Key Exposure Through Shareable Query-String URLs

Content
View full analysis

Vulnerability Details

File Location: references/scene2-nearby-search.md:73, references/scene2-nearby-search.md:93-100, references/scene5-travel-planner.md:78, and references/scene5-travel-planner.md:123-142
Vulnerability Type: Sensitive credential exposure through URLs
Risk Level: High

Vulnerable Code Snippets

references/scene2-nearby-search.md:73:

text
https://mapapi.qq.com/web/claw/nearby-search.html?center={纬度},{经度}&keyword={搜索类别}&radius=1000&key=xxx

references/scene2-nearby-search.md:93-100:

text
4. 拼接链接:`https://mapapi.qq.com/web/claw/nearby-search.html?keyword=美食&center=39.939385,116.353138&radius=1000&key=xxx`

### 回复模板

📍 已查询到「{位置}」的坐标({纬度},{经度}),为你生成周边{搜索类别}的搜索链接:

https://mapapi.qq.com/web/claw/nearby-search.html?center={纬度},{经度}&keyword={搜索类别}&radius=1000&key=xxx

text

`references/scene5-travel-planner.md:78`:

```text
https://mapapi.qq.com/web/claw/travel.html?spots={spots_json}&recommend={推荐类型}&key=xxx

references/scene5-travel-planner.md:123-142:

text
https://mapapi.qq.com/web/claw/travel.html?&spots=[{"name":"故宫","lat":39.918,"lng":116.397},{"name":"颐和园","lat":39.999,"lng":116.275},{"name":"香山","lat":39.993,"lng":116.188},{"name":"环球影城","lat":39.843,"lng":116.681}]&recommend=restaurant,hotel&key=xxx

https://mapapi.qq.com/web/claw/travel.html?spots=[{"name":"故宫","lat":39.918,"lng":116.397},{"name":"颐和园","lat":39.999,"lng":116.275},{"name":"香山","lat":39.993,"lng":116.188},{"name":"环球影城","lat":39.843,"lng":116.681}]&recommend=restaurant,hotel&key=xxx

The quoted snippets contain untranslated source placeholders because they reproduce the audited files verbatim.

Technical Analysis

The skill documentation directs the agent to substitute the user's Tencent Maps API key for xxx, embed that credential in a query string, and return the resulting URL in a chat respons ...[truncated 2720 chars]

Remediation
View remediation

Remediation Suggestions

  1. Never place long-lived API keys in URLs returned to users, chat messages, Markdown links, or browser-visible query strings.
  2. Replace direct client-side key use with a trusted backend proxy. The proxy should retain the Tencent Maps credential server-side, validate requested operations, enforce parameter allowlists, and return only the required map data or a non-sensitive result identifier.
  3. If an interactive page requires authorization, issue a short-lived, single-purpose, scoped token rather than exposing the provider credential. Bind the token to the intended operation and expire it after first use or within a brief period.
  4. Configure logs, telemetry, and error-reporting systems to redact key, token, and authorization parameters. Avoid logging complete request URLs.
  5. Apply provider-side restrictions, including API allowlists, source restrictions where reliable, minimal quotas, anomaly alerts, and automatic rotation.
  6. Remove key=xxx from all response templates and generated map URLs. Update the documentation to state explicitly that configured credentials must remain in server-side requests.
  7. Return a safe application URL containing only an opaque result identifier. Store coordinates and itinerary data server-side when their disclosure is unnecessary.
  8. Revoke and rotate any key previously exposed through generated URLs. Review conversation, browser, proxy, and application logs for leaked historical values.
  9. Add automated tests or linting rules that reject response templates containing credential-like query parameters such as key=, token=, or secret=.
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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code substantially matches the declared mapping/location-service purpose: it uses Tencent Maps APIs for POI lookup and several kinds of routing, and includes a trip advisor that prepares POIs and route items for later rendering. However, the description claims support for '轨迹数据可视化' and '地图数据可视化', while this code does not actually render or visualize anything; it only returns structured data (mapTaskData) that another component might visualize. Also, '周边搜索' is only implicitly handled as a mode of POI search via location + radius, not as a distinct feature. There are no unrelated triggers or suspicious undeclared capabilities beyond normal external API access. Because notable declared features are not implemented in this chunk, this is a description/behavior mismatch.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares environment and implied network capabilities but does not explicitly scope or constrain tool permissions. This increases the chance that the agent can access secrets like TMAP_LBS_CONFIG and make outbound requests without clear policy boundaries, which can lead to unintended data exposure or misuse.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger logic includes very broad keywords such as '搜', '找', '查', '附近', and '规划', which can cause the skill to activate on unrelated user requests. In context, that can result in unnecessary transmission of user queries or location-related content to Tencent Map services, creating privacy and least-surprise issues.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill handles sensitive location searches and route planning through external Tencent Map web services, but it does not clearly warn users that their provided addresses, coordinates, and POI queries may be transmitted to a third party. This creates a privacy transparency gap and may expose sensitive location data without informed user awareness or consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill exposes generic helpers to read and write process.env.TMAP_LBS_CONFIG, which lets imported code mutate process-wide configuration state at runtime. In a shared agent/runtime environment, this can enable unintended cross-skill side effects, configuration poisoning, or secret handling outside a controlled configuration interface, which is broader than the map-query functionality requires.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JavaScript file uses Chinese-only natural-language comments and runtime messages, including setup guidance and error text, with no indication that the skill is intended only for Chinese-speaking users or a China-specific environment. The policy requires avoiding forced language/locale behavior unless the user opts in or the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The entire skill description, examples, and reply template are written to operate only in Chinese, with no indication that users may choose another language or locale. Under the policy for natural-language violations, a skill that forces a specific language without user opt-in should be flagged.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The entire skill specification, examples, and reply templates are written to operate only in Chinese, with no indication that users may choose another language or that the skill is intentionally region-locked for compliance reasons. This creates a natural-language locale policy concern under the rule for forced language without user opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Line L006 tells the agent to '严格按照下面的步骤,不要生成代码后者调取其他脚本后者接口', which reads as a prohibition on invoking other scripts or interfaces. However, the very next procedure requires calling Tencent's geocoding API with curl at L044-L048. This is an active contradiction between the instruction text and the documented behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation instructs users to provide a temporary Tencent Maps API key and submit POI search parameters that may include precise location data, but it does not explicitly warn that these values will be transmitted to a third-party service. This creates a real privacy and credential-handling risk because users may unknowingly disclose sensitive location information or misuse scoped credentials without understanding retention, logging, or third-party processing implications.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

该 markdown 文件整体仅以中文编写,未见任何用户可选择语言的说明,也未说明该技能仅面向特定语言或地区用户。按规则,强制特定语言而无用户 opt-in 可能构成自然语言/locale 政策问题。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to send each user-supplied attraction name to Tencent geocoding services and then embed the resulting itinerary data in an external planning URL, but it does not clearly warn the user that their travel plans will be transmitted to a third-party service. Travel itineraries can reveal sensitive location interests and future movement patterns, so silent disclosure to an external provider creates a real privacy risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

L09 以“轨迹”“运动轨迹”“行驶轨迹”等宽泛自然语言意图作为触发条件,并用“等意图”进一步扩大范围,但没有说明哪些场景不应触发。对于 markdown 文件,这种描述缺少明确触发短语清单或负例,容易与日常讨论轨迹数据的普通对话重叠。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs the agent to embed a user-provided data URL into a Tencent Maps link without warning that the URL will be disclosed to a third-party service when opened. If the data URL contains sensitive locations, signed URLs, internal endpoints, or access tokens, this can leak private information and enable unintended third-party retrieval or logging.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language description in package.json is entirely in Chinese and does not indicate that the skill supports other languages or that Chinese is a required locale. Under the policy, language constraints should either be optional for users or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The API format at L041 uses 'location={位置}', while the complete example at L091 uses '/?policy=1&address=西直门&key=xxx'. These two documented inputs contradict each other about how the API should actually be called, creating intent/documentation divergence within the skill instructions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The URL template at L073 points to 'https://mapapi.qq.com/web/claw/nearby-search.html', but the bullets immediately below claim the domain is 'map.qq.com' and the route is '/m/place/search'. Those descriptions do not match the actual link being generated, so the documentation contradicts itself about the intended destination.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The entire skill, including prompts, templates, and examples, is presented only in Chinese and does not state that the user may choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern 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
80% confidence
Finding

整份技能说明、触发词和回复模板均固定为中文,没有提供根据用户语言偏好切换语言的选项,也没有说明该技能为何必须限定中文。根据规则,强制单一语言且无用户选择属于自然语言策略问题。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.