T08 · Insecure Dependencies
- Location
SKILL.md:377- Finding
Mutable Project Generator Executes Unreviewed Third-Party Code
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:377-389
Vulnerability Type: Supply-chain risk from mutable package resolution and execution
Risk Level: MediumVulnerable Code:
bash # Create a Vue + Leafer project npm create leafer@latest my-vue-app -- --template vue # Create a React + Leafer project npm create leafer@latest my-react-app -- --template react # Create a plain Leafer project npm create leafer@latest my-app # Use pnpm pnpm create leafer@latest my-app # Initialize Leafer in an existing project npm create leafer@latest -- --initTechnical Analysis
The documented
npm createandpnpm createcommands resolve the mutablelatesttag and execute code supplied by the downloaded project-generator package. Becauselatestcan point to a different release after the Skill has been reviewed, the effective executable payload is not reproducible or bounded to an audited version.Project generation legitimately requires running tooling, but using a mutable version exceeds the minimum trust necessary. An exact, reviewed version would provide the same declared functionality while reducing exposure to compromised maintainers, registry accounts, releases, or transitive dependencies.
This is a supply-chain weakness rather than evidence that the current Leafer generator is malicious.
Attack Path
- An attacker compromises the generator's registry account, release process, maintainer environment, or dependency chain.
- The attacker publishes a malicious package version and causes the
latesttag to resolve to it. - A user follows the Skill's initialization instructions.
- The package manager downloads the mutable release and runs its generator code.
- The malicious code executes with the invoking user's permissions and can access resources available to that process.
Impact Assessment
Successful exploitation could provide arbitrary code execution under the ...[truncated 757 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace every mutable
@latestreference with an exact generator version that has been reviewed, for example:bash npm create leafer@2.1.0 my-appThe actual pinned version should be verified against the package's published versions and official documentation before use.
-
Clearly state that project-generator commands download and execute third-party code with the current user's permissions.
-
Recommend inspecting package metadata, provenance, maintainers, release history, and lifecycle scripts before execution:
bash npm view create-leafer version dist.integrity repository maintainers -
Run generators as an unprivileged user in a clean directory or disposable container, without production secrets or unnecessary credentials in the environment.
-
After generation, review changes to dependency manifests, lockfiles, package scripts, CI configuration, and generated source before committing or building the project.
-
Retain lockfiles and integrity metadata for subsequent dependency installation, and use deterministic installation commands such as
npm ciwhere applicable. -
Avoid running package-manager generators with
sudo, administrator rights, or access to sensitive workspaces.
-
