Back to skill

Security audit

WeChat Mini Program CI

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent for WeChat Mini Program CI/CD, but it guides users toward sensitive deployments and mutable npm installs without enough scoping or safety controls.

Review carefully before installing. Use a pinned, reviewed package version and a project-local install where possible; avoid alpha tags for production deployment; keep upload private keys out of source control; restrict keys and IP allowlists; and require explicit review of appid, robot, version, cloud environment, and deployment target before any upload or cloud deploy command runs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T08 · Insecure Dependencies

Error
Location
SKILL.md:16
Finding

Unpinned Installation of a Privileged npm Dependency

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 16-18
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: High

Vulnerable Code

bash
npm install miniprogram-ci
# Global install (for CLI usage)
npm install -g miniprogram-ci

Technical Analysis

The documented installation commands resolve the mutable latest version of miniprogram-ci from the user's configured npm registry. No exact package version, lockfile, integrity hash, provenance requirement, or trusted registry URL is specified. The global installation command additionally places package-provided executables in a shared command path.

This dependency operates in a privileged deployment context: the documented workflow supplies it with a WeChat upload private-key path, project source code, and authority to upload releases or modify cloud resources. If the npm package, one of its transitive dependencies, a mutable distribution tag, or the configured registry is compromised, malicious lifecycle or runtime code could execute with the permissions of the user or CI runner.

Attack Path

  1. An attacker compromises the npm package, a transitive dependency, the package's current release, or a registry used by the victim.
  2. The victim follows the documented unpinned installation command.
  3. npm resolves and installs the attacker-controlled release; package lifecycle code may execute during installation.
  4. The victim subsequently invokes the package with access to the Mini Program project and upload private key.
  5. Malicious code reads accessible credentials or source files, impersonates the expected CLI, or abuses authenticated deployment operations.
  6. The attacker can exfiltrate sensitive material or publish unauthorized code within the scope of the victim's WeChat and CI permissions.

Impact Assessment

Exploitation can provide code execution under the invoking developer or CI account. Accessible as ...[truncated 386 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin the dependency to a reviewed exact version rather than a mutable latest tag.
  • Provide and commit a lockfile containing resolved versions and integrity metadata.
  • Use npm ci in automated environments to enforce the reviewed dependency graph.
  • Explicitly configure an approved npm registry and verify package provenance or signatures where supported.
  • Prefer a project-local installation over a global installation and invoke it through a package script or an explicitly pinned local binary.
  • Review transitive dependencies and use automated vulnerability and package-integrity monitoring.
  • Disable npm lifecycle scripts during installation where compatible, then explicitly run only required reviewed build steps.
  • Isolate deployment jobs in short-lived, least-privileged CI workers and expose the private key only to the specific deployment step.
  • Apply the documented IP allowlist and rotate the upload private key immediately if dependency compromise is suspected.

T08 · Insecure Dependencies

Error
Location
references/cloud.md:23
Finding

Mutable Alpha Dependency Used for Cloud Deployment Operations

Content
View full analysis

Vulnerability Details

File Location: references/cloud.md, line 23
Vulnerability Type: Installation from a mutable pre-release distribution tag
Risk Level: High

Vulnerable Code

bash
npm install --save miniprogram-ci@alpha

Technical Analysis

The command installs the package through the mutable alpha distribution tag instead of selecting an immutable, reviewed version. The package version returned by that tag can change without any modification to this project. Alpha releases are also pre-release software and may have received less stability and security validation than production releases.

The dependency is recommended specifically for cloud file uploads and cloud-container deployment. Consequently, it can receive local project or container files and authenticated access to a designated WeChat cloud environment. A compromised tag, package release, dependency, or registry could therefore introduce code that executes during installation or deployment.

Attack Path

  1. An attacker gains control of the alpha tag, compromises a release referenced by that tag, compromises a transitive dependency, or influences the victim's npm registry resolution.
  2. The victim executes the documented command, which resolves whatever release the mutable tag currently references.
  3. Attacker-controlled installation scripts or package code execute with the CI runner's operating-system permissions.
  4. During cloud deployment, the malicious component receives access to local deployment content and the authenticated project context.
  5. It exfiltrates source code or credentials, alters deployment artifacts, uploads unauthorized files, or modifies cloud container deployments within the granted account scope.

Impact Assessment

Successful exploitation can result in code execution as the developer or CI runner, disclosure of locally accessible secrets and deployment content, supply-chain modification of cloud a ...[truncated 201 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not recommend a mutable alpha tag for privileged deployment workflows.
  • Replace it with an exact, reviewed version and record the resolved package and transitive dependency versions in a committed lockfile.
  • If alpha functionality is unavoidable, test and approve a specific pre-release version, mirror it in a controlled internal registry, and pin its integrity.
  • Use npm ci and fail the build when the lockfile or integrity metadata differs from the approved state.
  • Run cloud deployment in an ephemeral, isolated worker with minimal filesystem and network access.
  • Grant credentials access only to the required cloud environment and operations, and inject them only after dependency installation and verification.
  • Scan deployment artifacts and compare their hashes against expected outputs before upload.
  • Monitor package ownership, release changes, and distribution-tag movement; rotate deployment credentials after any suspected supply-chain incident.
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 (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documents capabilities to upload code, generate previews, and deploy cloud resources, all of which can transmit local project contents and modify remote application state. Without an explicit warning or confirmation requirement, a user may invoke these operations without appreciating that sensitive source code, credentials, or production-facing assets could be sent to WeChat services or deployed remotely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file documents safety-relevant behavior: use of a private key (--private-key-path) and commands that upload or preview a mini program, which likely send project data to external services. The document provides no warning about credential sensitivity, network transmission, or safeguarding the private key.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file documents cloud function deployment, static file upload, and container deployment operations that can modify remote cloud resources and affect live services. The examples describe how to perform these actions but do not include any warning about deployment impact, overwriting remote content, traffic changes, or the need to verify the target environment before running them.

Content

No source excerpt is available for this finding.