Back to skill

Security audit

Vue3全家桶 Antd

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Vue3/Ant Design documentation skill; its risky parts are example networking and token-handling patterns users should harden before production.

Installers should treat this as Chinese-language Vue frontend reference material. Before copying its fetch wrapper into a real application, validate API origins, avoid sending bearer tokens to caller-controlled URLs, prefer safer session handling than persistent localStorage for sensitive tokens, and pin/review the publish-commons dependency version.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
examples/fetch-wrapper.md:27
Finding
Bearer Token Forwarding to a Caller-Controlled Network Destination<![CDATA[ ## Vulnerability Details **File Location**: `examples/fetch-wrapper.md`, lines 27 and 50–72 **Vulnerability Type**: Credential disclosure through an insufficiently constrained authenticated HTTP client **Risk Level**: Medium ### Vulnerable Code ```typescript const baseURL = options.baseURL || import.meta.env.VITE_API_BASE_URL ``` ```typescript // Add authentication token const token = localStorage.getItem('token') if (token) { headers.Authorization = `Bearer ${token}` } // Create an AbortController for timeout handling const controller = new AbortController() const timeoutId = setTimeout(() => { controller.abort() }, timeout) try { // Send request const response = await fetch(fullURL, { ...options, headers, signal: controller.signal, // HTTPS-specific configuration credentials: import.meta.env.PROD ? 'same-origin' : 'include', redirect: 'follow' }) ``` ### Technical Analysis The wrapper automatically attaches the browser's ambient bearer token to every request. At the same time, `options.baseURL` allows a caller to override the request destination. There is no same-origin check, HTTPS enforcement, or destination allowlist before the `Authorization` header is added. Consequently, code that can invoke this wrapper may cause the bearer token to be transmitted to an unintended origin. The `credentials` setting does not protect the bearer token because it only controls browser-managed credentials such as cookies. The explicitly assigned `Authorization` header remains attached to the request. Following redirects also increases the need for strict destination validation, although browser redirect behavior may limit forwarding of authorization headers in some cross-origin cases. This network behavior is related to the Skill's declared authenticated API-wrapper functionality, but unconstrained destination selection exceeds the minimum privilege required. An authenticated client should only release credentials to expl ...[truncated 1070 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove per-request `baseURL` overrides from authenticated clients. - Configure a fixed first-party API origin when constructing the client. - Validate the final URL with `new URL()` before adding credentials. - Require HTTPS outside explicitly isolated local-development environments. - Maintain an exact allowlist of trusted origins and reject all other destinations. - Add the `Authorization` header only after destination validation. - Use separate authenticated and unauthenticated request functions. - Avoid accepting absolute URLs in methods intended for first-party API paths. - Set `redirect: 'error'` or manually validate every redirect destination for sensitive requests. - Configure server-side token audience restrictions, short expirations, rotation, and revocation. - Add tests proving that tokens are never attached to cross-origin or non-HTTPS requests. Example hardening: ```typescript const API_ORIGIN = new URL(import.meta.env.VITE_API_BASE_URL) if (API_ORIGIN.protocol !== 'https:' && !import.meta.env.DEV) { throw new Error('The API origin must use HTTPS') } const target = new URL(url, API_ORIGIN) if (target.origin !== API_ORIGIN.origin) { throw new Error('Untrusted API destination') } const token = getAccessToken() if (token) { headers.Authorization = `Bearer ${token}` } const response = await fetch(target, { ...options, headers, signal: controller.signal, credentials: 'same-origin', redirect: 'error' }) ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
skill.md:553
Finding
Persistent Bearer Tokens Stored in Browser localStorage<![CDATA[ ## Vulnerability Details **File Location**: `skill.md`, lines 553 and 613–620; `examples/fetch-wrapper.md`, lines 50–53 and 126–127 **Vulnerability Type**: JavaScript-readable persistent storage of authentication credentials **Risk Level**: Medium ### Vulnerable Code From `skill.md`: ```typescript this.token = localStorage.getItem('token') ``` ```typescript setToken(token: string) { this.token = token localStorage.setItem('token', token) } clearToken() { this.token = null localStorage.removeItem('token') } ``` From `examples/fetch-wrapper.md`: ```typescript // Add authentication token const token = localStorage.getItem('token') if (token) { headers.Authorization = `Bearer ${token}` } ``` ```typescript // Unauthorized: clear token and redirect to login localStorage.removeItem('token') ``` ### Technical Analysis `localStorage` persists data across page reloads and browser sessions and is readable by JavaScript executing in the same origin. It does not support the `HttpOnly` protection available to cookies. Any successful cross-site scripting vulnerability, compromised same-origin dependency, malicious browser-injected script, or other script-execution flaw can therefore read and export the token. The token can then be replayed independently of the browser if the server treats it as a bearer credential. Clearing the token after an HTTP 401 response does not mitigate prior theft. The pattern is presented as reusable implementation guidance, so applications copying it may inherit the same exposure. ### Attack Path 1. An attacker obtains JavaScript execution in the application's origin, for example through a separate XSS flaw or compromised frontend dependency. 2. The malicious script executes `localStorage.getItem('token')`. 3. The script sends the recovered token to infrastructure controlled by the attacker. 4. The attacker replays the token in an `Authorization: Bearer ...` header against the legitimate API. 5. The API accepts req ...[truncated 592 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Prefer server-managed session cookies marked `Secure`, `HttpOnly`, and with an appropriate `SameSite` policy. - Implement CSRF protection when cookie-based authentication permits cross-site request scenarios. - If bearer tokens are necessary, keep short-lived access tokens in memory rather than persistent JavaScript-readable storage. - Use narrowly scoped, rotated refresh credentials and avoid making refresh credentials available to browser JavaScript. - Enforce short token lifetimes, audience restrictions, least-privilege scopes, rotation, and immediate server-side revocation. - Deploy a strict Content Security Policy and Trusted Types where supported to reduce XSS exposure. - Audit third-party frontend scripts and minimize code that executes within the authenticated origin. - Never log tokens or expose them in URLs, error messages, or telemetry. - Document the security trade-offs rather than presenting `localStorage` as the default authentication-storage mechanism. ]]>

T08 · Insecure Dependencies

Note
Location
skill.md:748
Finding
Unpinned Third-Party Package Installation Guidance<![CDATA[ ## Vulnerability Details **File Location**: `skill.md`, line 748 **Vulnerability Type**: Unversioned dependency installation and supply-chain exposure **Risk Level**: Low ### Vulnerable Code ```bash # Install component library npm install publish-commons ``` ### Technical Analysis The command installs the package version selected by the package registry at installation time. It does not pin an exact reviewed version and the audited project does not provide a corresponding lockfile or integrity value for this instruction. As a result, the effective package and transitive dependency graph can change after the Skill has been reviewed. npm packages may also run lifecycle scripts during installation. If the package, maintainer account, release process, or transitive dependency is compromised, following this instruction could introduce unreviewed code. No evidence establishes that `publish-commons` is currently malicious. The finding concerns unsafe, non-reproducible supply-chain guidance rather than confirmed malicious package content. ### Attack Path 1. An attacker compromises the package, a maintainer account, or a transitive dependency, or publishes an unsafe future release. 2. A user follows the documented `npm install publish-commons` command. 3. npm resolves the package version and dependencies available at that later time. 4. Installation lifecycle scripts may execute with the user's development-account privileges. 5. The installed package may subsequently execute during the build or application runtime. ### Impact Assessment A compromised dependency could access files and environment variables available to the npm process, alter project sources or build output, execute commands with the developer's privileges, or inject malicious browser code into the resulting application. The actual impact depends on npm configuration, lifecycle-script use, developer privileges, accessible secrets, and how the package is imported. This package-installa ...[truncated 172 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pin the dependency to an exact reviewed version, without `^`, `~`, or an unqualified latest-version resolution. - Provide and commit a lockfile containing resolved versions and integrity hashes. - Use `npm ci` in automated and reproducible environments. - Review package ownership, release history, lifecycle scripts, provenance, and transitive dependencies before adoption. - Use registry provenance or signature verification when available. - Test installation with lifecycle scripts disabled where feasible: ```bash npm install --ignore-scripts --save-exact publish-commons@<reviewed-version> ``` - If lifecycle scripts are required, inspect them before enabling execution. - Run dependency installation in a restricted environment without production credentials or unnecessary filesystem access. - Use automated dependency auditing and controlled update review rather than silently consuming future releases. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (8)

Natural-Language Policy Violations

Medium
Confidence
81% confidence
Finding
The title and the entire README are presented only in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This markdown file uses a single forced language for all user-facing instructions, and there is no opt-in, alternative locale, or justification that the skill is intended only for Chinese-speaking users. That matches the policy category for language or locale constraints without user choice.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The natural-language description and instructional content consistently force a specific language/locale for the skill experience, and there is no opt-in, alternative language option, or justification that the skill is region-specific. This matches the language/locale policy violation criteria for SQP-3.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This markdown template uses Chinese headings and labels throughout, which imposes a specific language on generated skill summaries. The file does not offer any user opt-in, language selection, or justification that the template is intended only for a Chinese-language context.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
This markdown skill/example forces a specific language for all instructions and explanations, which can be a natural-language policy concern when no user opt-in or alternative language is offered. There is no indication that the content is intentionally limited to a Chinese-speaking or region-specific audience.

Missing User Warnings

Low
Confidence
88% confidence
Finding
This markdown file explicitly lists network requests, request-wrapper utilities, environment variable configuration, and interceptors as skill topics, and later includes a fetch wrapper example. Under the markdown-specific warning criterion, the description does not provide any user-facing caution about data transmission, API endpoint usage, or handling of sensitive configuration.

Missing User Warnings

Low
Confidence
88% confidence
Finding
This markdown skill description contains HTTP request examples, Authorization header usage, and localStorage token storage, but does not include any warning about sending data to remote services or handling authentication tokens. For markdown files, SQP-2 applies when the description omits warnings about behaviors that could affect user data, privacy, or system integrity.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
This manifest uses Chinese throughout the title and descriptive fields, but does not indicate that the skill is Chinese-only or offer any language/locale choice. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation.

Static analysis

No suspicious patterns detected.