Back to skill

Security audit

AI小程序前后端SKILL

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a coherent Ushopun mini-program integration guide, but it requires a tenant-level ApiToken and includes live financial/account actions without enough scoping guidance.

Install only if you are comfortable with a broad Ushopun commerce integration. Do not paste a production or tenant-wide ApiToken into an agent chat for ordinary code generation; use the bundled OpenAPI file first, and provide a short-lived least-privilege test credential only for explicit live testing. Require manual review before generated code submits orders, starts payments, performs wallet recharge/withdrawal, upgrades agent status, posts content, or sends messages.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
Prompt.md:11
Finding

Mandatory Collection of an Unnecessary Tenant-Level API Token

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:14 and Prompt.md:11-15
Vulnerability Type: Excessive credential collection and violation of least privilege
Risk Level: High

Vulnerable Snippet

The following is a faithful English rendering of the relevant instructions from Prompt.md:11-15:

text
## Prerequisite Guidance (Required Before Generation)

- Before generating code, instruct the user to log in to ushopun.com,
  enter the administration console, create or copy the "Connector ApiToken,"
  and provide it to the Agent.
- If the ApiToken has not been obtained, ask the user for it first and do
  not generate the complete code.
- The ApiToken is a tenant-level sensitive credential. It is only to be
  used to read openapi.json, validate fields, or perform integration tests.
  It must not be hardcoded into generated Mini Program source code.

The equivalent instruction in SKILL.md:14 states:

text
When this Skill is used by an AI Agent, the Agent must first direct the user
to log in to ushopun.com, create a connector, copy the "Connector ApiToken,"
and provide it to the Agent.

Technical Analysis

The project already includes openapi.json as a local file. Reading that file, validating its documented fields, and generating client code from it do not require a tenant credential. Nevertheless, the Skill makes disclosure of a tenant-level ApiToken to the Agent a mandatory prerequisite and instructs the Agent to withhold complete code until the credential is supplied.

No connector URL, authentication protocol, narrowly scoped operation, or technical reason for requiring this token is defined in the audited files. The requested privilege therefore exceeds what is necessary for the documented code-generation task and violates the principle of least privilege.

Although the instructions warn against hardcoding the token into generated source code, they still require the u ...[truncated 1802 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the requirement to obtain an ApiToken before generating code.
  2. Generate code and validate endpoint fields exclusively from the bundled openapi.json when live access is not explicitly requested.
  3. Request a credential only when the user explicitly asks for live integration testing that cannot be completed from the local specification.
  4. Before requesting any credential, document:
    • The exact destination service and endpoint.
    • The operation that will be performed.
    • The minimum required token scopes.
    • How long the token will be retained.
    • Which tools or subprocesses will receive it.
  5. Require a short-lived, revocable, least-privileged testing token rather than a general tenant-level token.
  6. Never request that users paste production secrets directly into conversational context. Use an approved secret manager or protected runtime secret-input mechanism.
  7. Redact the token from tool arguments, logs, traces, error messages, generated files, and conversation exports.
  8. Add explicit token rotation and revocation guidance for credentials that may already have been disclosed.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:267
Finding

Sensitive WeChat Authentication and Personal-Data Parameters Sent in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:267-280, SKILL.md:994-1003, Prompt.md:138-139, and openapi.json:8604-8689
Vulnerability Type: Sensitive information exposure through GET query parameters
Risk Level: Medium

Vulnerable Snippet

SKILL.md:267-280 documents the affected endpoints and calls:

javascript
// WeChat login
api.get(weixinminilogin, { code, state, encryptedData, iv })
  .then(res => {
    wx.setStorageSync('guid', res.data.guid)
    wx.setStorageSync('token', res.data.token)
    wx.setStorageSync('openId', res.data.openId)
  })

// Bind or retrieve the phone number
api.get(weixinminiphone, { code, encryptedData, iv })
  .then(res => wx.setStorageSync('phone', res.data.phone))

Prompt.md:138-139 repeats the insecure invocation pattern:

javascript
api.get(weixinminilogin, { code, state, encryptedData, iv })
api.get(weixinminiphone, { code, encryptedData, iv })

The bundled OpenAPI definition at openapi.json:8604-8689 specifies both operations as GET requests with sensitive values in the query:

json
"/api/v2/weixinopen/login": {
  "get": {
    "parameters": [
      { "name": "code", "in": "query" },
      { "name": "state", "in": "query" },
      { "name": "encryptedData", "in": "query" },
      { "name": "iv", "in": "query" }
    ]
  }
},
"/api/v2/weixinopen/phonenumber": {
  "get": {
    "parameters": [
      { "name": "code", "in": "query" },
      { "name": "encryptedData", "in": "query" },
      { "name": "iv", "in": "query" }
    ]
  }
}

Technical Analysis

The generic request wrapper passes options.data directly to wx.request for GET requests. The WeChat login code, state value, encrypted personal-data payload, and initialization vector are therefore serialized into the request URL.

HTTPS protects the URL while it is in transit, but it does not prevent URL retention at either en ...[truncated 2867 chars]

Remediation
View remediation

Remediation Suggestions

  1. Change /api/v2/weixinopen/login and /api/v2/weixinopen/phonenumber from GET to POST.
  2. Place code, state, encryptedData, and iv in an application/json request body.
  3. Update openapi.json, SKILL.md, and Prompt.md together so generated clients do not revert to the insecure GET pattern.
  4. Retain HTTPS and enforce modern TLS for all authentication requests.
  5. Configure gateways, proxies, application servers, tracing platforms, and error-reporting systems to redact:
    • Authorization codes.
    • Tokens.
    • Encrypted personal-data fields.
    • Initialization vectors.
    • Phone-number-related parameters.
  6. Ensure authorization codes are short-lived, single-use, audience-bound, and rejected after successful exchange.
  7. Add replay detection and rate limiting to authentication and phone-number endpoints.
  8. Review existing access logs and telemetry for historical query-string exposure, restrict log access, reduce retention, and purge sensitive entries where feasible.
  9. If backward compatibility requires temporary GET support, disable query logging for these routes and establish a short migration deadline before removing GET entirely.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (20)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
调用示例。当用户需要开发对接 Ushopun 后端(优社云)的微信小程序商城时调用此 Skill。后端接口文档参考同目录 openapi.json(#File ./openapi.json,servers 为 {tenant}.ushopun.com 泛域名模板,开发填 dev,正式替换租户子域名)。"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
调用示例。当用户需要开发对接 Ushopun 后端(优社云)的微信小程序商城时调用此 Skill。后端接口文档参考同目录 openapi.json(#File ./openapi.json,servers 为 {tenant}.ushopun.com 泛域名模板,开发填 dev,正式替换租户子域名)。"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
调用示例。当用户需要开发对接 Ushopun 后端(优社云)的微信小程序商城时调用此 Skill。后端接口文档参考同目录 openapi.json(#File ./openapi.json,servers 为 {tenant}.ushopun.com 泛域名模板,开发填 dev,正式替换租户子域名)。"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
调用示例。当用户需要开发对接 Ushopun 后端(优社云)的微信小程序商城时调用此 Skill。后端接口文档参考同目录 openapi.json(#File ./openapi.json,servers 为 {tenant}.ushopun.com 泛域名模板,开发填 dev,正式替换租户子域名)。"

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The wallet withdrawal endpoint initiates a sensitive financial transfer and collects payout details such as bank account or payment identifiers, but the documentation lacks strong warning/confirmation guidance. In an agent setting this is highly dangerous because a mistaken or manipulated invocation can cause direct monetary loss and exposure of financial data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The prompt defines the role and the entire skill content exclusively in Chinese, framing the assistant as a WeChat Mini Program expert for a Chinese-language workflow. There is no indication that users may choose another language or locale, which can violate language/locale policy when a skill implicitly forces one language by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document presents the skill entirely as '微信小程序商城 Ushopun(优社云 V2)开发规范', and all instructions and examples are written in Chinese with no indication that other languages are supported. This can violate language/locale policy when a skill effectively requires Chinese output or interaction without explicit user opt-in or a documented region-specific justification.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
| 端点常量 | HTTP | 子路由 | 参数 | 返回 | 鉴权 |
|----------|------|--------|------|------|------|
| `pickuplist` | GET | /pickuplist | - | List\<MoPickupPoint\> | - |
| `shopsearch` | GET | /shopsearch | keyword, lat, lng, page=1, size=20 | object | - |
| `shipments` | GET | /shipments | oid | MoShipmentBrief | ✔ |

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
| 端点常量 | HTTP | 子路由 | 参数 | 返回 | 鉴权 |
|----------|------|--------|------|------|------|
| `pickuplist` | GET | /pickuplist | - | List\<MoPickupPoint\> | - |
| `shopsearch` | GET | /shopsearch | keyword, lat, lng, page=1, size=20 | object | - |
| `shipments` | GET | /shipments | oid | MoShipmentBrief | ✔ |

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
| 端点常量 | HTTP | 子路由 | 参数 | 返回 | 鉴权 |
|----------|------|--------|------|------|------|
| `pickuplist` | GET | /pickuplist | - | List\<MoPickupPoint\> | - |
| `shopsearch` | GET | /shopsearch | keyword, lat, lng, page=1, size=20 | object | - |
| `shipments` | GET | /shipments | oid | MoShipmentBrief | ✔ |

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
| 端点常量 | HTTP | 子路由 | 参数 | 返回 | 鉴权 |
|----------|------|--------|------|------|------|
| `pickuplist` | GET | /pickuplist | - | List\<MoPickupPoint\> | - |
| `shopsearch` | GET | /shopsearch | keyword, lat, lng, page=1, size=20 | object | - |
| `shipments` | GET | /shipments | oid | MoShipmentBrief | ✔ |

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Agent/distribution and commission-management endpoints let an agent alter account role/state and access referral or earnings-related workflows not clearly disclosed by the skill description. Hidden or under-disclosed privileged business functions broaden the blast radius of prompt misuse and can trigger irreversible account/business changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The agent upgrade action changes a user's account/business status but is documented without a clear warning about its side effects. In a skill already broader than its stated ecommerce scope, silent role/status mutation is dangerous because an agent may trigger it based on vague or adversarial instructions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is described as a mall frontend integration, but the exposed API surface also includes blog/social capabilities that expand what an agent can do with user data and account context. This overbroad scope increases the chance of misuse, confused-deputy behavior, or accidental invocation of unrelated features such as diary posting or private messaging.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The order submission endpoint performs a real transactional action, yet the documentation provides no warning that invoking it places an order. In an agent-mediated environment, omission of explicit transactional guidance increases the risk of accidental purchases or manipulation through ambiguous user prompts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Quick order submission is especially risky because it compresses review steps and can immediately create a purchase with less friction than normal checkout. In a conversational agent context, the lack of warning materially raises the chance of unintended financial commitment from a single misunderstood instruction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Wallet recharge, withdrawal, and related financial-account operations materially exceed a normal storefront browsing/ordering integration and enable movement of funds. In an agent setting, exposing payout and recharge primitives without tight scoping creates substantial risk of unauthorized financial actions or social-engineered transaction initiation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Recharge creates a real payment transaction, but the API description does not clearly warn that calling it initiates account funding. In a commerce agent, missing warnings around money movement can lead to accidental charges or abuse through deceptive prompts.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Under the /api/v2/page/* paths and Page tag, the summaries say '获取品牌列表', '获取推荐的品牌列表', '获取单个品牌制信息', and '获取品牌的推荐商品'. That documentation describes brand operations rather than page operations, which actively conflicts with the endpoint grouping and intent conveyed by the path/tag.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
99% confidence
Finding

The PM endpoints clearly implement private messaging operations such as send, list, mark read, and delete. However, the PM tag is documented as '订单接口', which directly contradicts the actual intent and can mislead integrators about the capability.

Content

No source excerpt is available for this finding.