T08 · Insecure Dependencies
Warning
- Location
- package.json:10
- Finding
- Non-Reproducible Dependency Installation Without a Lockfile<![CDATA[ ## Vulnerability Details **File Location**: `package.json:10-12`; installation guidance at `SKILL.md:28-31` **Vulnerability Type**: Supply-chain exposure caused by an unlocked dependency range **Risk Level**: Medium ### Vulnerable Code `package.json:10-12`: ```json "dependencies": { "googleapis": "^140.0.0" } ``` `SKILL.md:28-31`: ```bash cd google-sheet-api npm install ``` No dependency lockfile is present in the audited project. ### Technical Analysis The project permits any semver-compatible `googleapis` release through the caret range and instructs users to run `npm install`. Without a committed `package-lock.json`, the exact direct and transitive dependency versions installed are determined at installation time rather than by the versions reviewed during the audit. This is especially sensitive because installed dependency code executes in the same Node.js process as the CLI. It can therefore access: - Service-account credentials loaded into memory. - Environment variables available to the process. - Credential files readable by the current user. - Spreadsheet identifiers, request payloads, and returned spreadsheet data. - The network and filesystem privileges of the invoking user. The audit found no malicious dependency declaration or unsafe package source in the current manifest. Exploitation therefore requires a future compromised, malicious, or unexpectedly vulnerable direct or transitive package version. Nevertheless, the absence of a lockfile prevents reproducible installation and creates a material supply-chain risk. ### Attack Path 1. An attacker compromises a future semver-compatible release of `googleapis` or one of its transitive dependencies, or a newly resolved version introduces exploitable behavior. 2. A user follows the documented instruction and runs `npm install`. 3. npm resolves the dependency tree at that time because no reviewed lockfile constrains it. 4. The compromised dependency is installed and loaded by: ...[truncated 850 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Generate and commit a reviewed `package-lock.json`. 2. Replace the documented `npm install` workflow with `npm ci` for production and automated installations. 3. Consider pinning `googleapis` to an exact reviewed version instead of using a caret range. 4. Review lockfile changes as security-sensitive code changes. 5. Run dependency vulnerability and provenance checks in CI, such as `npm audit` and an appropriate software-composition-analysis tool. 6. Use automated dependency updates that produce reviewable pull requests rather than resolving new versions during deployment. 7. Run the CLI in an environment with only the credential and filesystem access required for the specific operation. ]]>
