T08 · Insecure Dependencies
- Location
SKILL.md:54- Finding
Unpinned npm Packages Are Executed During Android Project Setup
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:54; duplicated guidance inreferences/options-analysis.md:35-36
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: MediumVulnerable code in
SKILL.md:sh npm init @capacitor/appRelated code in
references/options-analysis.md:sh npm init @capacitor/app npx cap add androidTechnical Analysis
The skill directs users to execute npm-distributed command-line tools without specifying exact, reviewed package versions or requiring integrity verification. Package resolution can therefore change after the skill has been audited.
npm init @capacitor/appresolves and executes the initializer package selected by the npm registry. The subsequentnpx cap add androidcommand can also resolve executable code from the project dependencies or, depending on the project state and npm behavior, obtain a package through the configured registry. npm package installation and execution may run package code and lifecycle scripts with the invoking user's privileges.This is a supply-chain weakness rather than evidence that the current Capacitor package is malicious. Exploitation requires compromise or substitution of a resolved package, one of its transitive dependencies, the package registry, or the user's registry configuration.
Attack Path
- An attacker compromises a package or transitive dependency resolved by the unpinned command, or causes the environment to use an attacker-controlled registry or package version.
- A user follows the skill and runs
npm init @capacitor/appornpx cap add android. - npm resolves the package at execution time without an exact reviewed version and integrity baseline.
- The malicious package code or lifecycle script executes under the user's account.
- The payload can inspect or modify files accessible to that account, alter generated Android sources, collect locally avai ...[truncated 766 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the initializer and Capacitor CLI to exact versions that have been reviewed, rather than relying on the registry's current default version.
- Generate and commit
package-lock.json, review dependency changes, and usenpm cifor reproducible installation. - Invoke the locally installed, lockfile-controlled Capacitor CLI instead of allowing
npxto download an absent package dynamically. Use an option such asnpx --no-install cap add androidwhere supported. - Configure npm to use an explicitly trusted registry and retain integrity hashes in the lockfile.
- Enable automated dependency scanning, package provenance checks, and lockfile review in pull requests.
- Run setup and build commands in an isolated, least-privileged environment without unrelated credentials.
- In CI, expose only the minimum required token permissions and secrets, and pin third-party GitHub Actions to immutable commit SHAs.
