Protecting your Supabase projects from npm supply chain attacks
npm supply chain attacks reach Supabase users through three common paths: maintainer compromise, typosquatting (including a real `supabase-javascript` package and AI-hallucinated names), and build pipeline compromise like the TanStack attack via `pull_request_target` and a poisoned Actions cache. Malicious lifecycle scripts can exfiltrate env vars, cloud metadata, kubeconfig, npm tokens and SSH keys before `npm install` even returns. The recommended layered defenses are pnpm 11 with a 3–7 day `minimumReleaseAge`, exact version pins for sensitive deps, committed and reviewed lockfiles, disabled install scripts with an allowlist, verifying `@supabase/` scopes, SHA-pinned GitHub Actions, and credential rotation after suspected exposure. A ready-made prompt lets a coding agent apply these settings across pnpm, npm, yarn and bun.
Related posts
- Dependency prefixes are a supply chain risk: let's fix them
Sourcegraph mediumAdept
SemVer range prefixes like ^, ~ and wildcards in package.json act as a trust policy that lets compromised or hijacked packages flow into CI and production on the next install. The recommended controls are to commit lockfiles and install with npm ci, pnpm --frozen-lockfile or yarn --immutable, pin exact versions for high-blast-radius packages such as build tools, auth libraries and native-binding deps, set save-exact defaults, disable install scripts with an allowlist for exceptions, and run audits against the locked tree. To roll this out across hundreds of repositories, a Sourcegraph Batch Changes spec with a Node script rewrites React dependency ranges to approved exact versions and refreshes lockfiles without running scripts.
- Our response to the TanStack npm supply chain attack
OpenAI easyNovice
Two OpenAI employee devices were compromised via the malicious TanStack npm package in the Mini Shai-Hulud supply chain attack, leading to credential-focused exfiltration from a limited set of internal repositories that held code-signing certificates for iOS, macOS and Windows apps. OpenAI isolated systems, revoked sessions, rotated credentials, blocked new notarizations with the old certificate, and is rotating signing certificates, which requires macOS users to update apps before the revocation deadline (extended to June 26, 2026). The affected devices had not yet received hardening controls rolled out after the Axios incident, including package manager minimumReleaseAge settings and provenance validation, which would have blocked the malicious package. No customer data, IP or signed malware was found.
- Defending Your Software Supply Chain: What Every Engineering Team Should Do Now
Docker mediumAdeptRecent supply chain compromises (the axios npm hijack attributed to Lazarus Group, the TeamPCP campaign via Trivy's GitHub Action, Shai-Hulud, GlassWorm) share one root cause: implicit trust in mutable tags, broad long-lived tokens and unsandboxed runners. The recommended defenses start with pinning Actions to commit SHAs and images to digests, using lock files with npm ci, and applying 3-day cooldowns on new dependency versions, since most malicious releases live only hours. Further layers are short-lived scoped CI credentials, avoiding pull_request_target, artifact proxies and build-time SBOMs, plus canary tokens and credential cleanup on developer machines. AI coding agents should run in microVM sandboxes and MCP servers should be governed. Many recommendations are paired with Docker products such as Hardened Images, Scout, Sandboxes and MCP Gateway.
- Securing Python projects from supply-chain attacks
Astral mediumAdeptHash-pinning is the core defense against compromised maintainer accounts or hacked distribution servers, because version pins alone fail when PyPI files can be added post-release and GitHub Action tags can be force-pushed. Concrete hardening steps for Python projects on GitHub: pin Actions by commit SHA (via pinact, Dependabot or Renovate), verify SHA-256 hashes of downloaded binaries in Bash, Python or TypeScript, use PyPI Trusted Publishing over OIDC, require approvals on release environments, and lint workflows with zizmor. With uv, add dependency cooldowns via exclude-newer, lock CI tools as dependency groups and run them with UV_LOCKED, lock PEP 723 scripts, and set no-build to avoid executing source-distribution build backends.
- Edge Functions: Node and native npm compatibility
Supabase mediumAdeptSupabase Edge Functions now natively support npm modules (via `npm:` imports) and Node built-in APIs, so existing Node apps using Express, node-postgres and Drizzle can migrate with minimal changes. Under the hood, the open-source Deno-based Supabase Edge Runtime serializes each function's module graph into a single eszip at deploy time and loads all modules from it in the hosted, local and self-hosted environments alike. This avoids fetch latency, dependency conflicts with locally installed packages, and bugs such as failures when a deno.lock file is present. The release also adds regional invocation via an `x-region` header, CPU/memory and status-code metrics in the dashboard, and error tracking through Sentry's Deno SDK.