---
title: "Protecting your Supabase projects from npm supply chain attacks"
description: "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."
url: "https://swe.quest/articles/protecting-your-supabase-projects-from-npm-supply-chain-attacks-fac18687d5c6f3f1"
canonical: "https://supabase.com/blog/protecting-your-supabase-projects-from-npm-supply-chain-attacks"
source: "Supabase"
published: "2026-05-26"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["supply-chain-security","javascript","ci-cd","ai-coding"]
---

# Protecting your Supabase projects from npm supply chain attacks

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2026-05-26, 8 min read, How-to. Original: [https://supabase.com/blog/protecting-your-supabase-projects-from-npm-supply-chain-attacks](https://supabase.com/blog/protecting-your-supabase-projects-from-npm-supply-chain-attacks)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Supply chain security](https://swe.quest/tags/supply-chain-security.md) (Security)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)

## Prerequisites

- npm package management ([easy posts on Engineering management](https://swe.quest/tags/engineering-management.md?difficulty=easy))
- GitHub Actions workflows ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))
- semantic versioning ranges

## Keywords

npm, pnpm, Supabase, GitHub Actions, TanStack, pull\_request\_target, typosquatting, Socket.dev

## Related posts

- [Dependency prefixes are a supply chain risk: let's fix them](https://swe.quest/articles/dependency-prefixes-are-a-supply-chain-risk-let-s-fix-them-9228bb37d2c90199.md): Sourcegraph · 2026-05-22 · Medium · 5 min read · Supply chain security, JavaScript, Build systems, Refactoring & migrations
  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.
- [Our response to the TanStack npm supply chain attack](https://swe.quest/articles/our-response-to-the-tanstack-npm-supply-chain-attack-a4ee1bd194da9989.md): OpenAI · 2026-05-13 · Easy · 6 min read · Supply chain security, Incidents & postmortems, JavaScript, CI/CD
  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.
- [Defending Your Software Supply Chain: What Every Engineering Team Should Do Now](https://swe.quest/articles/defending-your-software-supply-chain-what-every-engineering-team-should-do-now-434c4d75b0885a00.md): Docker · 2026-04-02 · Medium · 9 min read · Supply chain security, CI/CD, Containers, AI agents
  Recent 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.
- [Securing Python projects from supply-chain attacks](https://swe.quest/articles/securing-python-projects-from-supply-chain-attacks-9ecc242dbcff9bf0.md): Astral · 2026-11-23 · Medium · 7 min read · Supply chain security, Python, CI/CD, Build systems
  Hash-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.
- [Edge Functions: Node and native npm compatibility](https://swe.quest/articles/edge-functions-node-and-native-npm-compatibility-4f29863e45494db0.md): Supabase · 2023-12-12 · Medium · 3 min read · Serverless, JavaScript, Observability
  Supabase 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
