T08 · Insecure Dependencies
- Location
scripts/double6_ppt_cli/bootstrap.py:44- Finding
Unverified npm Lifecycle Scripts Execute During OfficeCLI Bootstrap
- Content
View full analysis
Vulnerability Details
File Location:
scripts/double6_ppt_cli/bootstrap.py:44-51
Vulnerability Type: Third-party supply-chain code execution
Risk Level: MediumVulnerable Code
python proc = subprocess.run( [npm, "install", "--ignore-scripts=false", "--save-exact", f"@officecli/officecli@{OFFICECLI_PIN_VERSION}"], cwd=node_dir, capture_output=True, text=True, timeout=900, ) log.append({"command": f"npm install @officecli/officecli@{OFFICECLI_PIN_VERSION}", "returncode": proc.returncode, "stdout": proc.stdout, "stderr": proc.stderr}) if proc.returncode: raise D6PPTError("Pinned OfficeCLI installation failed", "bootstrap_failed", log)Technical Analysis
The bootstrap process invokes
npm installwith--ignore-scripts=false, explicitly allowingpreinstall,install, andpostinstalllifecycle scripts from OfficeCLI or any transitive dependency to execute.The direct package is pinned to version
1.0.144, and bootstrap requires explicit user authorization. These controls reduce accidental installation and version drift, but they do not provide artifact-level integrity. The reviewedUPSTREAM_LOCK.jsonrecords the package version and upstream commit but does not contain an npm tarball digest or npm integrity value. No package lock containing verified transitive dependency integrity values was present in the audited package.Consequently, bootstrap trusts the package registry and its resolved dependency graph at installation time. If the registry artifact, publisher account, or transitive dependency is compromised, lifecycle code not present during this audit can execute locally.
The absent
requirements-core.lockcauses a fresh bootstrap to fail at the preceding Python dependency installation step in this artifact. This currently limits reachability through an unmodified package, but it is a packaging defect rather than a reliable security control. If that file is restored—as the implementation e ...[truncated 1392 chars]- Remediation
View remediation
Remediation Suggestions
- Disable npm lifecycle scripts by default with
--ignore-scripts=true. - If OfficeCLI requires a lifecycle step, identify and review that exact script, then execute only the required operation in a constrained subprocess instead of enabling scripts for the entire dependency graph.
- Commit a package lock containing integrity values for the direct package and all transitive dependencies.
- Replace
npm installwithnpm ciagainst the reviewed lockfile. - Record and verify the trusted npm tarball SHA-256 or registry integrity value before installation.
- Configure npm to use an explicitly approved registry and reject unexpected package sources, aliases, Git dependencies, and URL dependencies.
- Install in a sandbox with minimal filesystem access, a sanitized environment, and network access restricted to the approved registry.
- Repair the missing
requirements-core.lockpackaging issue and ensure all dependency locks are included and validated by the attribution or integrity guard. - Extend the bootstrap receipt to record the lockfile digest, resolved package integrity values, registry origin, and whether lifecycle scripts were disabled.
- Disable npm lifecycle scripts by default with
