Back to skill

Security audit

vue-composition-api-best-practices

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly Vue documentation, but it presents an unsafe JSONP pattern as production-grade guidance.

Install only if you are comfortable reviewing generated Vue code carefully. In particular, do not adopt the JSONP search-suggestion example without replacing it with data-only fetch logic or adding strict trusted-origin controls.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
reference/composable-design-patterns.md:485
Finding

Dynamic Third-Party Script Execution Through JSONP

Content
View full analysis

Vulnerability Details

File Location: reference/composable-design-patterns.md:485-488
Vulnerability Type: Dynamic remote JavaScript retrieval and execution
Risk Level: High

Vulnerable Code

typescript
const url = currentEngine.value.suggestionUrl(keyword, callbackName)
scriptEl = document.createElement('script')
scriptEl.src = url
document.head.appendChild(scriptEl)

Technical Analysis

The documented production-grade composable constructs a URL from the active search engine and assigns it to the src property of a dynamically created script element. Appending that element to the document causes the browser to retrieve the response and execute it as JavaScript in the application's page context.

Unlike a normal JSON request, JSONP does not treat the response as inert data. The remote endpoint can return arbitrary executable JavaScript. The example does not enforce HTTPS, validate the URL scheme, restrict the destination to an explicit hostname allowlist, or otherwise establish that the selected endpoint is trusted. Removing the element afterward does not reverse code that has already executed.

This is classified as remote payload retrieval and execution because the effective executable payload is hosted externally and can change independently after the Skill has been reviewed.

Attack Path

  1. An attacker compromises a configured suggestion service, controls an engine configuration, or causes currentEngine.value.suggestionUrl(...) to return an attacker-controlled URL.
  2. A user enters a non-empty search term and the application invokes fetch(keyword).
  3. The composable creates a script element whose source is the generated URL.
  4. The browser retrieves and executes the endpoint's response in the application's page context.
  5. The malicious response performs actions available to page JavaScript before the cleanup routine removes the script element.

Impact Assessment

Su ...[truncated 757 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace JSONP with fetch() or a trusted HTTP client and require the endpoint to return JSON rather than executable JavaScript.
  2. Parse the response as data and validate its schema before assigning it to reactive state. Confirm that the response is an array of strings and enforce length and size limits.
  3. Require HTTPS and reject all other URL schemes.
  4. Maintain an explicit allowlist of trusted origins and validate the URL with the URL API before making a request.
  5. Avoid deriving an executable script URL from mutable store data or user-controlled configuration.
  6. Deploy a restrictive Content Security Policy, particularly script-src, that prevents execution from unauthorized origins. Do not weaken it with broad wildcards or unsafe-inline.
  7. If JSONP cannot be removed, use a fixed, audited endpoint and fixed callback protocol, strictly validate configuration, document the residual remote-code-execution risk, and handle script load errors. These controls reduce exposure but cannot make untrusted JSONP equivalent to inert JSON.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (24)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 19)May include surrounding context.

md
| `defineOptions` | 3.3+ | [script-setup](reference/script-setup-best-practices.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 20)May include surrounding context.

md
| `defineOptions` | 3.3+ | [script-setup](reference/script-setup-best-practices.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 21)May include surrounding context.

md
| `defineOptions` | 3.3+ | [script-setup](reference/script-setup-best-practices.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 23)May include surrounding context.

md
| `defineOptions` | 3.3+ | [script-setup](reference/script-setup-best-practices.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 24)May include surrounding context.

md
| `defineOptions` | 3.3+ | [script-setup](reference/script-setup-best-practices.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 35)May include surrounding context.

md
| `defineOptions` | 3.3+ | [script-setup](reference/script-setup-best-practices.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 40)May include surrounding context.

md
| `defineOptions` | 3.3+ | [script-setup](reference/script-setup-best-practices.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 49)May include surrounding context.

md
| `defineOptions` | 3.3+ | [script-setup](reference/script-setup-best-practices.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
| 如何组织新的组合式函数文件 | [组合式函数设计模式](reference/composable-design-patterns.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
| 如何组织新的组合式函数文件 | [组合式函数设计模式](reference/composable-design-patterns.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 55)May include surrounding context.

md
| 如何组织新的组合式函数文件 | [组合式函数设计模式](reference/composable-design-patterns.md) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 61)May include surrounding context.

md
| 如何组织新的组合式函数文件 | [组合式函数设计模式](reference/composable-design-patterns.md) |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown skill file presents its description and instructional content exclusively in Chinese, and there is no indication that users can opt into another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

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 its title, descriptions, guidance, and examples exclusively in Chinese, which effectively forces a specific language on users. The policy allows language constraints only when users are given a choice or when the locale restriction is clearly documented and justified, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents the skill entirely in Chinese, beginning with the title and description, without offering any language choice or explaining that the skill is intended only for a Chinese-speaking audience. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s instructional content is predominantly written in Chinese, including the title, headings, descriptions, and checklist items, with no indication that the user can choose another language or that the locale restriction is required for a region-specific purpose. This creates a natural-language locale policy issue because the skill effectively imposes a specific language on users without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file title and introductory description are entirely in Chinese and provide no indication that language is configurable or optional. Under the policy, forcing a specific language without user opt-in can be a natural-language locale violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

前文的 useDesign 示例返回的是 prefixCls 和 variables(L186-L195),但这里的测试却解构并断言 getPrefixCls、simplePrefixCls 以及 variables.namespace。这不是单纯的文档不完整,而是测试文档主动描述了一个与前文实现不一致的公开接口,容易误导使用者对 composable 实际行为的理解。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

在前文边界示例中,useEngine 返回的是 currentEngine 和 switchEngine(L402-L406),但本测试却使用 selectEngine、engineInfo、nextEngine、updateSelectEngine。该测试文档因此陈述了一个不同的 API 形态,和文中已有实现示例直接冲突。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

前文 usePageIcon 示例返回 pageIcon、addPageIcon、removePageIcon(L70-L84, L261-L269),但测试却使用 curPageIcons。这会让读者误以为公开返回值名称不同,属于文档/示例层面的明确接口矛盾。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains user-facing instructional content in Chinese, including the title and impact description, but does not indicate that the language is optional or that the skill is intended only for a Chinese-speaking audience. Under the policy rules, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing instructional content entirely in Chinese, including the title, descriptions, and all guidance. Under the policy, forcing a specific language without user opt-in can be a natural-language locale violation unless the locale constraint 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
81% confidence
Finding

Line L200 explicitly labels Chinese comments as the recommended style for a team context. This is a natural-language locale preference that does not present user opt-in or alternative guidance at the policy level, so it can be read as forcing a specific language convention.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Chinese, and there is no indication that the skill is region-specific or that users can opt into another language. Per the policy, forcing a specific language without user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.