Back to skill

Security audit

Taro小程序开发技能

Security checks for vulnerabilities and agentic risk

Overview

This Taro mini-program skill is mostly a coherent project template, but its helper initialization script and setup instructions create avoidable local execution and supply-chain risk.

Review before installing. If you use it, pin the Taro CLI in the npx command, add a lockfile, validate or avoid arbitrary project names when running scripts/init_project.sh, and run setup in a normal non-privileged workspace. Treat the API examples as placeholders and verify backend endpoints, token storage, and privacy requirements before enabling real network calls.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/init_project.sh:7
Finding

Project Name Injection Enables Arbitrary Command Execution and Filesystem Writes

Content
View full analysis
/dev/null || true ``` ### Technical Analysis The first command-line argument is accepted as `PROJECT_NAME` without validation or escaping. The same untrusted value is used in two security-sensitive contexts: 1. It becomes part of `PROJECT_DIR`, allowing path separators and `..` components to influence where the template is copied. 2. It is interpolated directly into a GNU `sed` program inside a double-quoted shell string. Shell quoting does not make the value safe for the `sed` language. An argument containing `/`, a newline, or other `sed` metacharacters can terminate the intended substitution and introduce additional `sed` commands. GNU `sed` supports the `e` command, which executes an operating-system command. For example, an attacker capable of controlling the script argument and preparing the required parent directory can use a value structurally equivalent to: ```bash $'safe/g\ne touch PWNED\n#' ``` This can transform the generated `sed` program into commands equivalent to: ```sed s/{{projectName}}/safe/g e touch PWNED #/g ``` The injected `e touch PWNED` command is then executed with the privileges of the user running the initialization script. The path construction is independently unsafe. Values containing `../` or path separators can direct `cp -r` outside the expected project-output location. Quoting prevents shell word splitting but does not prevent path traversal. The trailing `|| tr ...[truncated 1571 chars]
Remediation
View remediation
&2 exit 1 fi if [[ "$PROJECT_NAME" == "." || "$PROJECT_NAME" == ".." ]]; then echo "Invalid project name" >&2 exit 1 fi ``` 2. Reject all path separators, traversal components, control characters, and newlines. 3. Resolve the destination to a canonical path and verify that it remains below an explicitly approved output directory. 4. Do not generate an executable `sed` program using untrusted text. Use a small Node.js or Python script that reads files as data and performs literal string replacement. 5. If `sed` must be retained, escape replacement metacharacters such as `\`, `/`, and `&`; strict input validation should still be applied. 6. Fail closed when replacement fails. Remove `2>/dev/null || true` and report partial initialization errors. 7. Refuse to overwrite existing destinations unless the user explicitly approves the operation. 8. Run the script with ordinary user privileges and in a restricted workspace, particularly in CI environments. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:17
Finding

Unpinned npx Package Is Downloaded and Executed During Initialization

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (22)

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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The component's user-facing strings, including validation messages, labels, placeholders, and button text, are all fixed in Chinese. This can violate a language/locale policy when the skill forces a specific language without user opt-in or documented region-specific scope.

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 · assets/project-template/src/pages/task/publish/index.tsx (reported line 14)May include surrounding context.

tsx
if (!title.trim()) { showToast({ title: '请填写任务标题', icon: 'none' }); return }
    if (!desc.trim()) { showToast({ title: '请填写任务描述', icon: 'none' }); return }
    if (!coin.trim() || isNaN(Number(coin))) { showToast({ title: '请填写正确的金币数量', icon: 'none' }); return }
    const stepList = steps.split('\n').filter(s => s.trim())
    this.setState({ submitting: true })
    try {
      // TODO: await publishTask({ title: title.trim(), desc: desc.trim(), coin: Number(coin), steps: stepList })

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 · assets/project-template/src/pages/task/publish/index.tsx (reported line 17)May include surrounding context.

tsx
if (!title.trim()) { showToast({ title: '请填写任务标题', icon: 'none' }); return }
    if (!desc.trim()) { showToast({ title: '请填写任务描述', icon: 'none' }); return }
    if (!coin.trim() || isNaN(Number(coin))) { showToast({ title: '请填写正确的金币数量', icon: 'none' }); return }
    const stepList = steps.split('\n').filter(s => s.trim())
    this.setState({ submitting: true })
    try {
      // TODO: await publishTask({ title: title.trim(), desc: desc.trim(), coin: Number(coin), steps: stepList })

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file is entirely written in Chinese and presents the specification as the required default, with no indication that users may choose another language or that the locale restriction is intentional for a region-specific audience. Under the policy, forced language constraints without opt-in can be 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 script's natural-language comments and terminal output are entirely in Chinese, which imposes a specific language choice on users without offering an alternative or explaining a locale-specific requirement. This matches the policy category for language or locale constraints without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The natural-language description and headings are entirely in Chinese and target WeChat Mini Program development, but the file does not explicitly state that the skill is Chinese-language only or offer an alternative language. Under the policy, forcing a specific language without opt-in can be a locale/language policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file includes request-layer setup and example login/user-info API calls, which imply transmission of user or system data to backend services. The section does not provide any user-facing warning about network access, data handling, or privacy considerations.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · assets/project-template/package.json (reported line 20)May include surrounding context.

json
"@tarojs/runtime": "3.6.39",
    "@tarojs/taro": "3.6.39",
    "@tarojs/webpack5-runner": "3.6.39",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {

Unverifiable Dependency: react has 2 known advisory(ies) (CVE-2013-7035 (Cross-Site Scripting in react); GHSA-hg79-j56m-fxgv (Cross-Site Scripting in react)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · assets/project-template/package.json (reported line 21)May include surrounding context.

json
"@tarojs/taro": "3.6.39",
    "@tarojs/webpack5-runner": "3.6.39",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",

Unverifiable Dependency: react-dom has 1 known advisory(ies) (CVE-2018-6341 (Cross-Site Scripting in react-dom)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · assets/project-template/package.json (reported line 24)May include surrounding context.

json
"react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@tarojs/cli": "3.6.39",
    "@types/react": "^18.2.0",
    "babel-preset-taro": "3.6.39",

Unverifiable Dependency: @babel/core has 1 known advisory(ies) (CVE-2026-49356 (@babel/core: Arbitrary File Read via sourceMappingURL Comment)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · assets/project-template/package.json (reported line 26)May include surrounding context.

json
"devDependencies": {
    "@babel/core": "^7.24.0",
    "@tarojs/cli": "3.6.39",
    "@types/react": "^18.2.0",
    "babel-preset-taro": "3.6.39",
    "typescript": "^5.0.0",
    "webpack": "4.46.0"

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · assets/project-template/package.json (reported line 28)May include surrounding context.

json
"@tarojs/cli": "3.6.39",
    "@types/react": "^18.2.0",
    "babel-preset-taro": "3.6.39",
    "typescript": "^5.0.0",
    "webpack": "4.46.0"
  }
}

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The tab bar text literals are fixed to Chinese labels ('首页', '任务', '发布', '我的') with no indication of user opt-in, localization support, or documented region-specific scope. This can violate a language/locale policy when a skill forces a specific language experience by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file's natural-language comments are entirely in Chinese, including usage and behavior descriptions, with no indication that this is a region-specific skill or that other language options are available. Under the policy, forcing a specific language without user opt-in or documented justification is a locale/language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The only user-facing descriptive text is written in Chinese and does not provide any language alternative or opt-in. Under the stated policy, forcing a specific language without user choice or documented justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The font-family declaration explicitly prioritizes Chinese locale fonts ("PingFang SC", "Microsoft YaHei") with no indication that this is optional or limited to a region-specific experience. This can reflect a language/locale policy constraint embedded in the skill assets without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file includes wx.clearStorageSync() as a usage example, which is a destructive operation that removes stored local data. The surrounding documentation provides no caution or disclosure about its impact, so users may copy it without realizing it clears all storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This shell script copies a template directory and then edits multiple files in place, which changes the filesystem and project contents. While it prints progress and success messages, there is no prior warning, confirmation, or explanatory comment disclosing that it will create a new directory and rewrite files using sed.

Content

No source excerpt is available for this finding.