T08 · Insecure Dependencies
- Location
skill.md:70- Finding
Unpinned Executable Package and Mutable Project Templates
- Content
View full analysis
Vulnerability Details
File Location:
skill.md:70-77
Vulnerability Type: Supply-chain exposure through unpinned packages and mutable template references
Risk Level: MediumVulnerable Code
bash # Vue 3 + Vite version npx degit dcloudio/uni-present-vue#vite my-project cd my-project npm install # Vue 2 version npx degit dcloudio/uni-preset-vue#v2 my-project-vue2 cd my-project-vue2 npm installTechnical Analysis
The guide instructs users to execute
degitthroughnpxwithout specifying an audited package version. Depending on the local npm configuration and cache state,npxmay retrieve and execute the current package release from the npm registry.The project templates are selected through mutable branch references (
viteandv2) rather than immutable commit hashes or verified release tags. Their contents can therefore change after the Skill has been reviewed. Runningnpm installin the resulting projects may also execute dependency lifecycle scripts included by the downloaded template.The first source,
dcloudio/uni-present-vue#vite, differs from the laterdcloudio/uni-preset-vue#v2source. This may be a typographical error and increases the risk of retrieving an unintended repository. The audit did not establish that either current source is malicious; the vulnerability is the absence of source and version integrity controls.Attack Path
- A user follows the project-creation instructions.
npxdownloads an unpinned release ofdegitwhen no trusted cached version is available.degitretrieves a template from a mutable repository branch, potentially including an unintended source caused by the apparent naming discrepancy.- The user enters the downloaded directory and runs
npm install. - If the package, repository, branch, or one of the template dependencies has been compromised, attacker-controlled lifecycle code executes with the privileges of ...[truncated 568 chars]
- Remediation
View remediation
Remediation Suggestions
- Verify and correct the apparent
uni-present-vueversusuni-preset-vuerepository-name discrepancy. - Pin
degitto a reviewed version, for example by invoking an explicitly versioned package rather than the latest available release. - Pin each template to an immutable, reviewed commit hash instead of a mutable branch.
- Use only template sources listed in the official uni-app documentation and provide the expected repository URL.
- Include and preserve a reviewed lockfile, then use deterministic installation such as
npm ci. - Enable lockfile integrity verification and dependency scanning in CI.
- Review dependency lifecycle scripts before installation. Where compatible with the project, initially install with lifecycle scripts disabled and explicitly permit only required scripts.
- Avoid running project setup or dependency installation with administrator or root privileges.
- Verify and correct the apparent
