T08 · Insecure Dependencies
- Location
app/package.json:13- Finding
Unpinned Electron Dependency and Automatic Package Installation
- Content
View full analysis
/app npm install ``` ### Technical Analysis The project does not include a dependency lockfile and declares Electron using the mutable version range `^34.0.0`. Consequently, separate installations can resolve different Electron versions and transitive dependency graphs. The launcher automatically invokes `npm install` when `node_modules` is absent. npm installation can download packages from the configured registry and execute package lifecycle scripts with the privileges of the invoking user. The subsequent `npx electron .` command executes the installed Electron package. No malicious dependency is present in the reviewed source, and Electron is a legitimate package. The weakness is that installation is not deterministic and depends on the integrity of the registry, npm configuration, package publisher account, and dependency versions available at installation time. ### Attack Path 1. A user invokes `scripts/launch.sh` on a system where `node_modules` does not exist, or manually follows the documented `npm install` instructions. 2. npm resolves `electron` and its transitive dependencies without a reviewed lockfile. 3. An attacker compromises the configured npm registry, a relevant publisher account, the local npm registry configuration, or a future dependency release accepted by the version range. 4. npm downloads the attacker-controlled package content. 5. Malicious lifecycle code can execute during installation, or malicious runtim ...[truncated 586 chars]- Remediation
View remediation
