Back to skill

Security audit

uniapp-expert

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent uni-app/Vue testing skill, but its included automation scripts contain real unsafe code-generation paths that could run unintended local JavaScript.

Install only if you are comfortable with a development skill that runs local Python and Node automation against WeChat DevTools. Use it in a disposable or low-privilege dev environment, pin npm dependencies, avoid real credentials and production data, do not pass untrusted endpoint or test-step values, and re-enable Mini Program domain validation after testing.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (6)

T09 · Insecure Skill Coding Practices

Error
Location
skills/weapp-automated-testing/scripts/weapp_automation.py:126
Finding

Arbitrary JavaScript Execution Through Unsafely Interpolated WebSocket Endpoint

Content
View full analysis
str: ws_endpoint = self.config.ws_endpoint if hasattr(self.config, 'ws_endpoint') else 'ws://localhost:9420' base_script = ''' const automator = require('miniprogram-automator'); async function runTest() { const miniProgram = await automator.connect({ wsEndpoint: '%%WS_ENDPOINT%%' }); // ... } ''' # ... return base_script.replace('%%WS_ENDPOINT%%', ws_endpoint) % "".join(js_code) ``` The same unsafe construction occurs in the console and performance utilities: ```python ws_endpoint = self.ws_endpoint script_content = f''' const automator = require('miniprogram-automator'); async function getLogs() {{ try {{ const miniProgram = await automator.connect({{ wsEndpoint: '{ws_endpoint}' }}); // ... }} catch (error) {{ // ... }} }} ''' ``` ### Technical Analysis The configurable `ws_endpoint` value is inserted directly into a JavaScript single-quoted string. It is not encoded as a JavaScript string literal, escaped, or constrained to an expected URL format. The generated source is written to a temporary `.js` file and executed with Node.js: ```python result = subprocess.run( ["node", script_path], capture_output=True, text=True, timeout=30 ) ``` A malicious endpoint containing a quote followed by JavaScript statements can terminate the intended string and introduce arbitrary JavaScript. Because Node.js exposes filesystem, process, and child-process APIs, successful injection can become arbitrary command execution under the account running the Skill. This ope ...[truncated 1307 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
skills/weapp-automated-testing/scripts/weapp_automation.py:169
Finding

Arbitrary JavaScript Injection Through Unvalidated Batch Action Parameters

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
skills/weapp-automated-testing/scripts/weapp_automation.py:84
Finding

Predictable Executable Files in a Shared Temporary Directory

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
skills/weapp-automated-testing/SKILL.md:52
Finding

Unpinned Third-Party Package Installation and Execution

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
skills/vue-expert/references/state-management.md:387
Finding

Authentication Token Persisted in JavaScript-Readable Session Storage

Content
View full analysis
{ const token = ref(null) const user = ref(null) return { token, user } }, { persist: { key: 'auth-storage', storage: sessionStorage, paths: ['token'] // Only persist token, not user } }) ``` ### Technical Analysis The example explicitly persists an authentication token in `sessionStorage`. Session storage is available to JavaScript executing in the same origin and does not provide the confidentiality boundary of an `HttpOnly` cookie. If the application has an XSS vulnerability, a malicious script can read the stored token and transmit it to an attacker. Limiting persistence to the token rather than the user object does not reduce this central credential-theft risk. This conflicts with the more secure Nuxt example elsewhere in the project, which uses a `Secure`, `HttpOnly`, `SameSite=Strict` session cookie. ### Attack Path 1. A developer adopts the reference implementation. 2. A user authenticates, and the bearer or session token is stored in `sessionStorage`. 3. An attacker exploits an XSS flaw or compromises a same-origin script dependency. 4. The malicious script reads the `auth-storage` entry. 5. The attacker extracts the authentication token. 6. The token is replayed against the application until it expires or is revoked. ### Impact Assessment The obtainable privilege is that represented by the stolen token. Depending on the application, this can include: - Account takeover. - Access to personal or confidential application data. - Unauthorized actions under the victim's identity. - Administrative access if a privileged user's token is stolen. - Continued access until token ...[truncated 29 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:314
Finding

Automation Guidance Requires Disabling Mini Program Domain Validation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (50)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · skills/vue-expert/references/build-tooling.md (reported line 67)May include surrounding context.

Environment Variables

typescript
// .env
VITE_API_URL=https://api.example.com
VITE_APP_TITLE=My App

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · skills/vue-expert/references/build-tooling.md (reported line 71)May include surrounding context.

md
VITE_API_URL=https://api.example.com
VITE_APP_TITLE=My App

// .env.development
VITE_API_URL=http://localhost:3000

// .env.production

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · skills/vue-expert/references/build-tooling.md (reported line 74)May include surrounding context.

// .env.development VITE_API_URL=http://localhost:3000

// .env.production VITE_API_URL=https://api.production.com

text

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · skills/vue-expert/references/components.md (reported line 98)May include surrounding context.

v-model (Two-way Binding)

vue
<!-- Parent Component -->
<script setup lang="ts">
import { ref } from 'vue'
import CustomInput from './CustomInput.vue'

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · skills/vue-expert/references/nuxt.md (reported line 46)May include surrounding context.

File-based Routing

vue
<!-- pages/index.vue -->
<script setup lang="ts">
definePageMeta({
  title: 'Home',

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · skills/vue-expert/references/nuxt.md (reported line 100)May include surrounding context.

md
<nav>Navigation</nav>
    </header>
    <main>
      <slot /> <!-- Page content goes here -->
    </main>
    <footer>Footer</footer>
  </div>

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · skills/vue-expert/references/state-management.md (reported line 446)May include surrounding context.

md
| `storeToRefs()` | Maintain reactivity when destructuring |
| `store.$subscribe()` | Watch for state changes |
| `store.$patch()` | Batch state updates |
| `store.$reset()` | Reset state to initial |
| Plugins | Add global functionality (logger, persistence) |
| Accessing stores | Use other stores in actions |
| Testing | Use `setActivePinia()` for isolated tests |

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · skills/vue-expert/references/typescript.md (reported line 318)May include surrounding context.

Generic Components

vue
<!-- GenericList.vue -->
<script setup lang="ts" generic="T extends { id: number }">
interface Props {
  items: T[]

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · skills/weapp-automated-testing/scripts/weapp_automation.py (reported line 91)May include surrounding context.

python
try:
            # Ensure NODE_PATH includes global npm modules so temp scripts can find them
            env = os.environ.copy()
            if "NODE_PATH" not in env:
                try:
                    npm_global = subprocess.run(

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Using shell=True for a helper command creates a parameter-abuse surface because command resolution is delegated to the shell and inherited environment. Even though the literal command string is fixed, an attacker controlling PATH or shell startup context may redirect execution to a malicious program, making the automation tool more dangerous in shared or untrusted environments.

Content

Scanner excerpt · skills/weapp-automated-testing/scripts/weapp_automation.py (reported line 94)May include surrounding context.

python
env = os.environ.copy()
            if "NODE_PATH" not in env:
                try:
                    npm_global = subprocess.run(
                        "npm root -g",
                        capture_output=True, text=True, timeout=10,
                        shell=True,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill includes actionable code and operational guidance that clearly implies use of shell, filesystem, environment variables, and networked tooling, but it does not declare any permissions or allowed-tools scope. In an agent ecosystem, this ambiguity can cause overbroad tool access or make reviewers and runtime policy engines unable to enforce least privilege, increasing the chance of unintended command execution or file/network operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file’s user-facing description is presented exclusively in Chinese, and the rest of the skill documentation continues in that language without indicating that users may choose another language. This can violate a language/locale policy when a skill implicitly forces one language on all users without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

Across the markdown content, all headings, guidance, warnings, and examples are written in Chinese, with no statement that other languages are supported on request. Under the stated policy, a skill should not force a specific language unless the locale restriction is clearly documented and justified or the user is given a choice.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The provided manifest context says the skill is a 'uni-app 跨平台开发专家技能' covering Vue2/Vue3 migration and WeChat mini-program automation testing. This file instead defines 'vue-expert' for Vue 3, Nuxt 3, Quasar, Capacitor, and Vite, with no uni-app, Vue2 migration, or mini-program testing scope. That is a semantic mismatch between the claimed skill purpose and the actual documented behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Overly broad triggers such as generic framework terms can cause the skill to be invoked in unrelated conversations, creating prompt-routing confusion and expanding the skill's effective authority beyond intended contexts. In an agent system, unintended invocation can suppress more appropriate skills, produce irrelevant code-oriented output, or propagate unsuitable implementation guidance into tasks that only mention common Vue terminology.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Generic triggers like build/tooling and optimization terms are prone to accidental matching across many frontend discussions, which can lead to unintended skill activation and prompt-scope overreach. While this is not direct code compromise, it is a real security/control issue in agentic systems because it increases the chance of incorrect expert selection, policy bypass through misrouting, and lower-trust outputs being injected into unrelated workflows.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file documents camera and geolocation usage, including continuous location watching, but does not include any warning or disclosure about collecting sensitive user data or the need to explain that behavior to users. Under the markdown-file criteria for SQP-2, omission of warnings for privacy-impacting behavior is a reportable issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The logger plugin prints raw mutation payloads and full new state, which can leak tokens, PII, credentials, or other sensitive application data into browser consoles, log collectors, screenshots, or shared debugging sessions. As sample code in a development skill, it is likely to be reused broadly, making accidental data exposure more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The persistence example explicitly stores an authentication token in browser storage, which increases exposure to token theft through XSS, compromised extensions, shared devices, or debugging access. In a reference skill, this is especially risky because developers may copy the pattern directly without understanding the tradeoffs or safer alternatives.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill’s activation text is very broad and effectively claims most Vue-related requests, without clear boundaries for when it should or should not activate. In an agent ecosystem, this can cause inappropriate routing, overshadow more specialized skills, and increase the chance that the agent follows irrelevant or lower-quality guidance in sensitive workflows.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.