Skip to content

security: Auto-update script execution without integrity verification #3297

@louisgv

Description

@louisgv

Summary

The auto-update mechanism in packages/cli/src/update-check.ts downloads and executes a remote install script without cryptographic verification.

Location

  • File: packages/cli/src/update-check.ts
  • Function: performAutoUpdate()
  • Lines: 279-345

Vulnerability

The function fetches the install script via HTTPS from a CDN and executes it directly:

const scriptBytes = executor.execFileSync('curl', ['--proto', '=https', '-fsSL', installUrl], ...);
// ... writes to temp file, then executes via bash/PowerShell

While HTTPS provides transport security, there is no integrity verification (checksum, signature) of the downloaded script. If the CDN is compromised, DNS is hijacked, or a network attacker performs a TLS downgrade, arbitrary code execution is possible.

Impact

  • An attacker who compromises the CDN or intercepts the download can execute arbitrary code with the user's privileges
  • The auto-update runs automatically (when SPAWN_AUTO_UPDATE=1) without user interaction

Recommendation

  1. Add SHA256 checksum verification of the downloaded script against a signed manifest
  2. Use GPG signature verification if available
  3. Consider pinning the CDN TLS certificate or using certificate transparency logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    safe-to-workSecurity triage: safe for automated processingsecurity-review-requiredSecurity review found critical/high issues - changes required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions