T08 · Insecure Dependencies
- Location
scripts/update-openclaw.sh:110- Finding
Unpinned npm Packages Are Installed Globally During Unattended Updates
- Content
View full analysis
Vulnerability Details
File Location:
scripts/update-openclaw.sh:57-60, 110-115; scheduled execution is documented inSKILL.md:48-65, and elevated execution is suggested inSKILL.md:101
Vulnerability Type: Unpinned dependency installation and unsafe automatic updates
Risk Level: HighVulnerable Code
bash # Get latest version from npm get_latest_version() { npm view @openclaw/core version 2>/dev/null || npm view openclaw version 2>/dev/null || echo "" }bash if ! npm install -g @openclaw/core@latest 2>&1 | tee -a "$LOG_FILE"; then # Try alternative package name if ! npm install -g openclaw@latest 2>&1 | tee -a "$LOG_FILE"; then log "${RED}Update failed! Check $LOG_FILE for details.${NC}" return 1 fi fiThe accompanying instructions enable unattended execution:
bash 0 3 * * * /bin/bash ~/.openclaw/workspace/skills/openclaw-updater/scripts/update-openclaw.sh >> ~/.openclaw/logs/cron-update.log 2>&1The troubleshooting instructions also suggest elevated installation:
bash sudo npm install -g @openclaw/core@latestTechnical Analysis
The updater installs the mutable
latestnpm tag without pinning an approved version, validating package integrity, or verifying a trusted signature. npm installation can execute package lifecycle scripts, so package installation is also a code-execution boundary.The fallback from the scoped
@openclaw/corepackage to the separate unscopedopenclawpackage broadens the supply-chain trust boundary. A failure involving the intended package can cause a different package to be installed automatically.The documented cron configuration is optional and consistent with the declared auto-update feature; it is not silently registered by the script and therefore is not, by itself, malicious persistence. Nevertheless, scheduling the updater changes a sup ...[truncated 1499 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an explicitly approved, immutable version:bash npm install -g "@openclaw/core@${APPROVED_VERSION}" - Validate the downloaded package against an independently trusted integrity hash or signature before installation.
- Remove the unscoped
openclawfallback unless its provenance and equivalence are explicitly verified. A failed installation should stop safely rather than silently switch package identities. - Separate update checking from installation. Scheduled jobs should only check and notify; installation should require explicit user approval.
- If unattended installation is essential, use a restricted service account, a controlled package mirror, an allowlisted version, and a staged rollout process.
- Avoid
sudoand root cron. Configure npm with a user-owned prefix or use a version manager so global installation does not require administrative privileges. - Consider disabling package lifecycle scripts with
--ignore-scriptsif OpenClaw's package does not require them, followed by explicit trusted setup steps. - Verify that the installed version exactly equals the approved target rather than merely checking that it differs from the previous version.
- Replace
