Back to skill

Security audit

baidu-map-jsapi-gl

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent BMapGL documentation skill with no installer or local persistence, but several copy-paste examples could lead developers to create insecure web pages.

Install only if you will treat it as a Baidu Maps reference, not security-reviewed sample code. Review generated code before use: prefer explicit HTTPS URLs, avoid putting untrusted data into innerHTML or InfoWindow HTML without sanitization, restrict the Baidu API key, and consider privacy notice or consent for address and coordinate lookups.

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

Error
Location
references/custom-overlay.md:127
Finding

Unsafe Dynamic HTML Construction Enables DOM-Based Cross-Site Scripting

Content
View full analysis

${this.properties.title}

${this.properties.desc}

`; ``` ### Technical Analysis The example directly interpolates `imgSrc`, `title`, and `desc` into an HTML string assigned to `innerHTML`. No output encoding, HTML sanitization, or URL validation is performed. If an application populates these properties using URL parameters, API responses, database records, map feature attributes, or other attacker-controlled input, the browser will interpret that input as markup rather than plain text. An attacker can consequently inject elements with event handlers or other active HTML. For example, a malicious title could close the existing heading and introduce an image with an error handler. The vulnerability exists in the generated application code rather than in the documentation renderer itself, but users following the example can reproduce the flaw directly. ### Attack Path 1. An application follows the documented `createInfoCard` implementation. 2. The application obtains an overlay property such as `title`, `desc`, or `imgSrc` from an untrusted source. 3. An attacker supplies a value containing crafted HTML or an event-handler payload. 4. The value is interpolated into the template literal without encoding. 5. The resulting string is assigned to `div.innerHTML`. 6. The browser parses the attacker's value as active markup. 7. The injected JavaScript executes in the origin and security context of the integrating application. ### Impact Assessment Successful exploitation can execute arbitrary client-side JavaScript in the affected application's origin. Depending on the application's authentication and browser defenses, an attacker ...[truncated 547 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/map-init.md:8
Finding

Protocol-Relative Loading of Executable Third-Party Map API

Content
View full analysis
``` The same protocol-relative script reference appears in the complete example: ```html ``` ### Technical Analysis A URL beginning with `//` inherits the page's current protocol. When the integrating page is delivered over HTTPS, the browser will normally retrieve the script over HTTPS. However, if the page is served over HTTP—for example in a legacy deployment, test environment, local network, or after an insecure redirect—the executable API script will also be requested over HTTP. Plaintext HTTP provides neither server authentication nor transport integrity. An on-path attacker can replace the JavaScript response with arbitrary code. Because the resource is loaded through a `
Remediation
View remediation
``` Additional hardening should include: 1. Redirect all HTTP requests for the application to HTTPS. 2. Enable HTTP Strict Transport Security after confirming complete HTTPS compatibility. 3. Apply a Content Security Policy with a narrowly scoped `script-src` directive. 4. Restrict the browser-exposed map API key by authorized domain, API, and quota where supported. 5. Avoid dynamically constructing the script URL from untrusted input. 6. Update both occurrences in `references/map-init.md` so the quick-start and complete examples are consistent. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/xyz-layer.md:8
Finding

Plaintext HTTP Tile Endpoints Permit Map-Data Manipulation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (22)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

该描述除了较具体的“BMapGL、百度地图、jsapi-gl”外,还包含“相关地图开发需求时自动触发”这一宽泛表述,但没有给出边界或反例。这样容易与一般性的地图开发讨论重叠,造成触发范围不清晰。

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example builds a DOM fragment with innerHTML using this.properties.imgSrc, title, and desc directly. If developers copy this pattern and any of those properties come from user-controlled or untrusted data, it can lead to DOM-based XSS through injected HTML or dangerous attributes such as javascript: URLs or event handlers. In this map-overlay skill context, the risk is more relevant because the whole feature is specifically about rendering custom HTML on the page.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The documentation encourages address-to-coordinate and coordinate-to-address lookups, which inherently involve sensitive location data, but it provides no warning that these values may be transmitted to Baidu's servers or require user consent and privacy review. In a mapping/geocoding skill, omission of privacy and data-handling guidance can lead developers to process precise user location and address data without notice, minimization, or compliance controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The text states that Geocoder only supports Chinese and English, and that all other languages automatically fall back to Chinese. This is a language/locale policy concern because the skill imposes a language choice on users without offering opt-in or documenting a user-selectable alternative.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation explicitly allows InfoWindow content to be provided as raw HTML or DOM elements without warning that untrusted data can introduce XSS. In a map UI, InfoWindows often display user- or server-supplied location metadata, so developers may directly inject unsanitized content into the page context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Documenting the title field as supporting HTML fragments encourages insertion of raw markup into a visible UI surface. If developers pass attacker-controlled strings into the title, this can result in script execution or markup injection depending on how the library renders the value.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The maxContent option is documented as accepting raw HTML with no security warning, creating another injection sink for expanded InfoWindow views. Because expanded detail panes are likely to contain rich remote data, this increases the chance developers will pass unsanitized content and expose users to XSS.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation describes an onClosing callback that can cancel window closure, but that capability is not documented elsewhere in the file and may not exist in the actual API. Developers who rely on this example could implement security- or workflow-critical logic assuming the close can be blocked, leading to bypass of confirmation, consent, or state-preservation checks when the window closes anyway.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents all instructions, headings, and examples exclusively in Chinese. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill content is presented only in Chinese, which can constitute a language or locale policy violation when no user opt-in or justification is provided. The file does not indicate that the content is region-specific or that users may choose another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document presents all instructions, headings, and examples only in Chinese, which can amount to a language policy violation when no user opt-in or alternative locale is provided. The file does not indicate that the skill is intentionally region-specific or that users can choose another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file appears to force a specific language/locale for all users because all headings, explanations, and examples are presented only in Chinese. Under the stated policy, language constraints should either be optional for the user or clearly documented as region-specific and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file is natural-language documentation, and it uses Chinese throughout the headings, parameter descriptions, and examples. Under the policy criteria, forcing a specific language without user opt-in can be a locale or language policy violation when no alternative or choice is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language content forces a specific language/locale for the skill documentation, and there is no indication that users can opt into another language or that the constraint is intentionally region-specific. Under SQP-3, language policy issues can be flagged when a skill mandates a language without user choice or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The title and all instructional content are written exclusively in Chinese, with no indication that users can choose another language or locale. Under the policy, language constraints should be optional or explicitly justified; this file presents a single forced locale without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document title and all instructional content are written entirely in Chinese, with no indication that users may choose another language or locale. This can violate a language/locale policy when a skill implicitly requires a specific language without documenting justification or offering opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file presents all instructions and examples exclusively in Chinese, and there is no indication that the user can choose another language or that the skill is intended only for a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in can constitute a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file documents map.clearOverlays() for removing all overlays, but it does not warn users that the action clears existing map overlays in bulk. For markdown files, destructive behaviors that can affect user data or system state should include a brief warning about the impact.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file presents all user-facing instructions, headings, and explanations in Chinese only. The policy requires flagging language or locale constraints when the skill forces a specific language without user opt-in, and no alternative language option or justification is provided here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The example configuration hard-codes language: BMAPGL_LANGUAGE_ZH, and the later language section states Chinese is the default. This can be a locale-policy issue because the skill documentation presents a fixed language choice without offering user selection or opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

该文件的自然语言说明全部为中文,但未见提供多语言选项、用户语言选择机制,或说明这是仅面向中文用户/中国区域的文档。按规则,未获用户选择即强制特定语言/locale 可能构成自然语言组织政策违规。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.