Skip to content

Security: Use npm ci instead of npm install in release-notes.yml to enforce lockfile integrity #267

Description

@LucasMaupin

Severity

Low

Description

The .github/workflows/release-notes.yml workflow installs @anthropic-ai/sdk using npm install without a pre-committed lockfile. npm install resolves the latest satisfying version at run time, meaning different CI runs can silently pull in different (potentially malicious or buggy) transitive dependency versions.

This workflow runs with access to ANTHROPIC_API_KEY and GITHUB_TOKEN, making it a worthwhile supply-chain target.

Risk

  • Non-reproducible builds — transitive dependency versions can differ between runs
  • A compromised package version could be silently introduced without lockfile pinning
  • No integrity check is performed against a known-good dependency tree

Remediation

  1. Create a small dedicated directory (e.g., .github/scripts/release-notes/) containing:
    • package.json declaring @anthropic-ai/sdk as a dependency
    • A committed package-lock.json generated by npm install locally
  2. Update the workflow to use npm ci from that directory:
    - name: Install dependencies
      working-directory: .github/scripts/release-notes
      run: npm ci
  3. Keep the lockfile up to date via Dependabot or Renovate (see issue Add Dependabot config to backend repo for automated dependency updates #253).
  4. Pin the GitHub Actions used in this workflow to full commit SHAs (see issue Security: Pin GitHub Actions to commit SHAs to prevent supply chain attacks #235).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MediumPriority: mediumsecuritySecurity vulnerability or hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions