# Software Supply Chain Security
> Supply chain attacks compromise code before it reaches you. The target is a dependency, a registry account, a build pipeline, a vendor or a developer workstation, and the payload then runs with the full trust of every downstream consumer.
## What it is
The discipline of controlling everything your software trusts by **name, tag, identity or vendor connection**: packages and their registries, CI/CD systems and the actions/plugins they run, IDE extensions and AI tooling on developer machines, model artifacts, and third-party access into your network. The attacker doesn't exploit your application. They get their code executed inside your build, your workstation or your inference server, then harvest the credentials found there.
Why it matters to appsec in 2025–2026:
- **Payloads converged on credential theft.** Install-time hooks dump `process.env`, `~/.npmrc`, cloud keys, IMDS credentials and run TruffleHog over `$HOME`; stolen npm/GitHub tokens then republish the victim's own packages ([[Shai-Hulud Worm]]).
- **Developer machines and CI runners are the primary target**, not production hosts. EDR sees applications, not the npm packages, IDE extensions, browser plugins and agent skills inside them ([[raw/aikido.dev/why-developer-machines-are-now-the-number-one-target-for-supply-chain-8279|Aikido]]). GitGuardian reports 59% of machines compromised in one early worm wave were CI/CD runners ([[CI-CD Pipeline Attacks|CI/CD Pipeline Attacks]]).
- **Valid provenance no longer means clean.** TanStack, AsyncAPI, bee-js and tensorlake shipped malware through the projects' own pipelines with valid SLSA/Sigstore attestations ([[SBOM and Provenance]]). Microsoft's `agent-framework` went out through its real release service, apparently with a stolen ESRP client certificate: "the credential was valid, the publisher was not" ([[raw/medium.com/the-credential-was-valid-the-publisher-was-not-15854|VeritasChain]]).
- **Third parties extend the perimeter.** The Verizon 2025 DBIR found third-party involvement in breaches doubled from 15% to 30% in a year ([[raw/medium.com/the-back-door-was-a-vendor-lessons-from-the-cr-dit-mutuel-ark-a-bank-h-13843|Crédit Mutuel Arkéa writeup]]).
## Core concepts
**Four entry points.** Every incident in this topic starts at one of them:
| Entry point | Mechanism | Pages |
|---|---|---|
| Name resolution | Resolver pulls an attacker-controlled name: internal name published publicly, lookalike, or LLM-hallucinated name | [[Dependency Confusion]], [[Typosquatting]], [[Slopsquatting]] |
| Publisher takeover | Legitimate package ships a malicious version after phishing, social engineering, dormant/forgotten accounts or leaked publish tokens | [[Malicious Packages]], [[Shai-Hulud Worm]] |
| Pipeline compromise | Untrusted input runs with secrets in CI: pwn requests, expression injection, mutable tags, cache poisoning, poisoned scanners | [[GitHub Actions Security]], [[Pwn Requests]], [[CI-CD Pipeline Attacks\|CI/CD Pipeline Attacks]], [[tj-actions changed-files Compromise]] |
| Long-con infiltration | A trusted contributor plants a backdoor in release artifacts only | [[XZ Utils Backdoor]] |
**Execution hooks by ecosystem.** npm `preinstall`/`postinstall`/`prepare`, `binding.gyp`, git/remote-URL `optionalDependencies`; PyPI `.pth` files (run on every interpreter start, pip included; LiteLLM, `agent-framework`), import-time code and build-backend options; crates.io `build.rs`; RubyGems install loaders; IDE extension code prepended to the bundle so it runs before `activate` ([[Malicious Packages]], [[raw/bymustfa.medium.com/vs-code-eklenti-g-venli-i-g-ncellemeyi-nce-okuyun-13071|vsx-diff writeup]]). Import-time and build-time hooks are **not** stopped by `--ignore-scripts`.
**Mutable references.** Tags (`@v4`, Docker `:alpine`), "latest" resolution and unpinned scanner images resolve at run time, so a force-pushed tag changes what runs. A full SHA doesn't prove the commit belongs to the named repo, because fork-network and orphan commits resolve under the parent ([[GitHub Actions Security]], [[tj-actions changed-files Compromise]]).
**Provenance vs. integrity.** SBOMs say what an artifact contains; SLSA/Sigstore/npm and PyPI attestations say which pipeline built it from which repo. Neither proves the source or pipeline was clean. SLSA Build L3 still allows a malicious source repo or compromised maintainer account ([[SBOM and Provenance]]).
**The newest version is the riskiest one.** Old versions carry known CVEs; a release published an hour ago may carry injected code that no one has examined yet. Most malicious versions are found within hours and nearly all within a day, so a minimum release age of at least a day (Datadog's common recommendation is a week) removes the fast, noisy attacks while a security fast lane keeps patches flowing ([[raw/cyb3rops.medium.com/the-sweet-spot-is-a-day-old-15955|Roth]]; [[Malicious Packages]]).
**Credential hygiene is the multiplier** (OWASP CICD-SEC-6). A poisoned dependency or poisoned pipeline execution is only as bad as the credentials the job or laptop can reach, which ties this topic to [[Secrets Management]], [[Developer Workstation Secrets]], [[Leaked Cloud Credentials]] and [[Workload Identity Federation]].
**AI as a new link.** LLMs hallucinate package names and domains ([[Slopsquatting]]), malware drives local AI CLIs with `--dangerously-skip-permissions`/`--yolo` (Nx), AI-powered GitHub Actions can be steered by issue text, malicious packages now install full agents as implants (`@leadstack/crm-connect`), and model chat templates are an RCE vector on inference servers. See [[AI Coding Assistant Risks]].
## How to approach it
Work outward from where code executes, then close the publish side.
1. **Inventory what executes.** Direct and transitive dependencies (SBOM: `syft`), every `uses:` in workflows including composite/transitive actions, CI plugins and scanner images, IDE extensions and AI tools on developer machines, models pulled from hubs/OCI registries, and vendor accounts with network access.
2. **Map resolution paths.** For each ecosystem: which registries, in what priority, through which proxy? Any pip `--extra-index-url`, unclaimed npm scope, or merged public/private index is a [[Dependency Confusion]] finding.
3. **Map what each execution context can reach.** Env vars, `~/.npmrc`, cloud profiles, IMDS, `GITHUB_TOKEN` scope, OIDC trust, Vault tokens. Treat CI identity as production identity.
4. **Audit CI triggers and references.** `pull_request_target`/`workflow_run`/`issue_comment` handling of fork content, `${{ github.event.* }}` in `run:`, mutable tags, shared caches, self-hosted runners ([[Pwn Requests]], [[GitHub Actions Security]]).
5. **Gate intake.** Release-age cooldowns, install-script blocking, pre-install scanning, allowlisting proxy registry, lockfiles with hashes.
6. **Harden publishing.** Trusted Publishing (OIDC) only, revoke leftover API tokens, staged/2FA-gated publish, Environments with required reviewers, tag protection and Immutable Releases.
7. **Verify against policy.** Provenance checked against the expected repo + workflow path + ref, not "has a signature"; watch for provenance-state changes.
8. **Prepare response.** Searchable SBOMs fleet-wide, mass credential revocation, egress telemetry on runners, and an order of operations that images infected hosts before revoking tokens.
## Key techniques
### Getting malicious code resolved
- **[[Dependency Confusion]]**: publish the internal name publicly with `99.99.99`/`100.100.100`; pip `--extra-index-url` picks the highest version regardless of source. Alex Birsan (2021) got execution inside Apple and Microsoft; PyTorch `torchtriton` shipped malware in nightlies for five days ([[raw/spectralops.io/5-examples-of-dependency-confusion-attacks-spectral-4468|Spectral]]). The May 2026 `oob.moika[.]tech` cluster squatted corporate-looking scopes, spoofed internal repo/Jira metadata and **skipped execution when `CI` was set** ([[raw/microsoft.com/malicious-npm-packages-abuse-dependency-confusion-to-profile-developer-8363|Microsoft]]).
- **[[Typosquatting]]**: swapped/repeated characters, separator changes, suffixes (`reqeusts`, `rustdecimal`, `Newtonsoftt.Json.Net`), plus brandjacking. The `vpmdhaj` cluster imitated OpenSearch/Elastic tooling and stole IMDS, ECS, Secrets Manager and npm tokens, setting `CI=false` to fool build-aware code ([[raw/microsoft.com/typosquatted-npm-packages-used-to-steal-cloud-and-ci-cd-secrets-8364|Microsoft]]).
- **[[Slopsquatting]]**: register names LLMs repeatedly hallucinate. In one study 19.7% of 2.23M recommended packages didn't exist and 43% of hallucinated names recurred ([[raw/medium.com/slopsquatting-when-your-ai-assistant-invents-a-package-name-someone-el-12528|Slopsquatting writeup]]). Unit 42's phantom squatting applies the same idea to hallucinated domains and webhook URLs ([[raw/unit42.paloaltonetworks.com/phantom-squatting-ai-hallucinated-domains-as-a-software-supply-chain-v-9992|Unit 42]]).
### Taking over legitimate packages
- **[[Malicious Packages]]**: maintainer phishing (`npmjs.help` against chalk/debug), DPRK social engineering of the Axios maintainer, dormant gems (SleeperGem), forgotten contributor accounts (Mastra), leftover API tokens beside Trusted Publishing (Ultralytics round 2). Payload tradecraft: a pre-staged clean dependency then a malicious bump (`plain-crypto-js` 4.2.0 → 4.2.1), anti-forensic decoy `package.json`, WAV steganography (Telnyx), CI-gated exit to target laptops.
- **Agent-as-implant.** `@leadstack/crm-connect` (nine versions, 16 Nov 2026) used `postinstall` to install Nous Research's Hermes Agent, pulled its `.env` and `SOUL.md` persona from `72[.]62[.]1[.]108`, bound it to the attacker's Telegram bot and registered it as `leadstack-routing.service` (passing `--run-as-user root`; 1.0.18 fell back to a user service with linger). From 1.0.19 the tarball held no payload and fetched code at runtime, keeping `sdkVersion()` side-effect free "for CI lockfile checks" ([[raw/safedep.io/malicious-npm-package-turns-hermes-agent-into-a-backdoor-15719|SafeDep]]).
- **Self-propagation.** [[Shai-Hulud Worm]]: validate token via `/whoami`, enumerate `maintainer:<user>`, inject, `npm version patch --force && npm publish`. Waves from Sep 2025 (500+ pkgs) through 2.0 (796 pkgs, Bun-based `setup_bun.js`, `SHA1HULUD` self-hosted runner, `discussion`-triggered injection as C2, `shred` wiper) to Mini Shai-Hulud (TeamPCP: SAP, TanStack, AntV, Bitwarden CLI; revocation-triggered wiper) and Miasma (`binding.gyp`).
### Compromising the pipeline
- **[[Pwn Requests]]**: `pull_request_target` + checkout of PR head, script injection via PR title/branch (`$(...)` + `${IFS}`), artifact/cache poisoning into release jobs. Label gates are TOCTOU. GitHub's 2026 changes (`actions/checkout` refusing fork refs, read-only cache tokens for untrusted triggers, `pull_request_target` blocked by default in public repos from 2026-12-02) still leave pre-backport SHA pins, `gh pr checkout`/`git fetch`, `issue_comment`, `repository_dispatch` and private repos.
- **[[GitHub Actions Security]]**: open egress by default on hosted and nearly all self-hosted runner stacks (GhostAction's one POST to a bare IP), forks retargeting `runs-on` to self-hosted runners, `hackerbot-claw` automating PRs against weak workflows ([[raw/karlkfi.medium.com/your-ci-can-reach-the-whole-internet-why-15956|karlkfi]]), expression injection, tag repointing and imposter commits, reading `Runner.Worker` memory (`/proc/<pid>/mem`) for every decrypted secret, log-masking bypass via base32/base64, `persist-credentials` tokens in artifacts, cache leakage (`cargo miri` env dump), non-ephemeral self-hosted runners, and AI-powered actions trusting any `[bot]` actor.
- **[[tj-actions changed-files Compromise]]**: SpotBugs maintainer PAT leaked via `pull_request_target` → reviewdog `@v1` → `tj-actions-bot` PAT → every tag repointed to `0e58ed8`, printing double-base64 secrets to public logs. Tag pushes aren't in the org audit log.
- **[[CI-CD Pipeline Attacks|CI/CD Pipeline Attacks]]**: OWASP CICD-SEC Top 10; direct PPE; GitLab incoming-email `glimt-` token → `-merge-request@` patch to `.gitlab-ci.yml`; Jenkins script console and Docker-socket abuse; JFrog Artifactory admin-token minting (CVE-2026-82329); Leaky Vessels build escapes; poisoned tools the pipeline trusts (Codecov uploader, Trivy/KICS/Checkmarx Jenkins plugin); build-time execution (`proc-macro1` `build.rs`).
### Developer tooling, models and vendors
- **IDE extensions** run with the editor's full permissions and auto-update silently. Cases: trojanized Nx Console 18.95.0 (CVE-2026-48027) shipped via auto-update and led to theft of GitHub internal repos; `Anthropic.claude-code` 2.1.312/2.1.313 on the **Cursor** marketplace (29 Oct 2026) added an attacker SSH key, opened a reverse SSH tunnel and persisted via LaunchAgent/scheduled task, so uninstalling the extension wasn't enough ([[raw/bymustfa.medium.com/vs-code-eklenti-g-venli-i-g-ncellemeyi-nce-okuyun-13071|vsx-diff writeup]], [[raw/thehackernews.com/cursor-says-stolen-fireworks-ai-key-led-to-trojanized-claude-code-exte-15244|THN]]). Wiz found 550+ validated secrets leaked by extension publishers, 100+ granting update rights.
- **Model artifacts.** RunSybil escaped Jinja's `ImmutableSandboxEnvironment` through a CPython out-of-bounds read in `_Py_subs_parameters` (crafted `__typing_subst__`/`__typing_prepare_subst__` hooks make it read `argitems[-1]`; on CPython ≥ 3.14 that word is a tuple's cached hash, which the template controls). A backdoored `chat_template.jinja` on a Qwen2.5-0.5B-Instruct copy executed code in vLLM's serving process. CPython doesn't treat sandbox escapes as vulnerabilities and declined to backport ([[raw/runsybil.com/cpython-0-days-threaten-the-ai-supply-chain-jinja-model-template-sandb-15664|RunSybil]]). Pulling containers and models from OCI registries is itself an attack surface even without privileges or a Docker socket ([[raw/youtube.com/def-con-34-no-socket-no-privs-no-problem-weaponizing-oci-registries-15696|DEF CON 34]]). See [[Model Deserialization Attacks]], [[Python Sandbox Escapes]], [[Jinja2 SSTI]], [[AI Infrastructure Vulnerabilities]].
- **Untrusted build archives.** BentoML rendered a `dockerfile_template` shipped inside an imported bento with an unsandboxed `jinja2.Environment` (`jinja2.ext.do`, `jinja2.ext.debug`), so `bentoml containerize` ran template code on the **host** before Docker started, bypassing container isolation; on a CI runner that is pipeline compromise. Fix: `SandboxedEnvironment` and drop `do`/`debug` ([[raw/github.com/bentoml-ssti-via-unsandboxed-jinja2-in-dockerfile-generation-15849|GHSA-v959-cwq9-7hr6]]; [[Jinja2 SSTI]]).
- **Vendor access.** Crédit Mutuel Arkéa (4 Nov 2026): attackers came in through a service provider's platform and used the bank's own account to wire funds out, converted to USDC/USDT (ZachXBT estimated up to EUR 118M) ([[raw/medium.com/the-back-door-was-a-vendor-lessons-from-the-cr-dit-mutuel-ark-a-bank-h-13843|Arkéa writeup]]).
### Defending and verifying
- **[[SBOM and Provenance]]**: SBOM + VEX for "where are we running X", SLSA Build L1–L3, Fulcio/Cosign/Rekor keyless signing, npm provenance, PyPI attestations, GitHub Artifact Attestations, verified against policy.
- **PyPI security signals (live Nov 2026).** Each release shows **Full Provenance** (100% of files carry a PyPI Publish or SLSA Build Provenance attestation) or **No Provenance**, plus warnings for: some files attested and others not (wheels via Trusted Publishing, sdist via API token), files from different build systems or repos, a different repo/workflow than the previous release, and a project that stopped attesting. Late files uploaded more than 14 days after release are flagged; since July 2026 they're rejected ([[raw/blog.pypi.org/pypi-s-redesigned-project-pages-with-clearer-security-signals-are-now-15656|PyPI]]).
- **Secretless CI.** Replace stored tool tokens with [[Workload Identity Federation]]: SonarQube Cloud exchanges the job's GitHub/GitLab OIDC token (RFC 8693, `id-token: write`) for a token scoped to **one project for 30 minutes**, checks issuer, audience, expiry and single-use `jti`, and binds by repository **ID** rather than name to stop repo-jacking. A compromised step in the same job can still use the token, but only for that project and window ([[raw/sonarsource.com/inside-secretless-analysis-from-ci-identity-to-project-scoped-access-15755|SonarSource]]).
- **Verifiable evidence.** Steve Springett's "No Receipts No Trust!" keynote argues trust requires auditable evidence across development and distribution ([[raw/youtube.com/owasp-appsec-days-india-2026-day-1-keynote-steve-springett-15697|OWASP AppSec Days India 2026]]). More talks: [[Supply Chain and Cloud Talks]].
## Tools
| Need | Tool / command |
|---|---|
| Scan a package before install | `guarddog pypi scan <pkg> --version <v>` / `guarddog npm scan <pkg>` (also Go, RubyGems, Actions, VS Code extensions) |
| Local pre-install gate | Aikido Safe Chain; Device Protection for IDE/browser/AI tool inventory |
| Block install hooks | `npm ci --ignore-scripts`, `npm config set ignore-scripts true`; npm v12 blocks lifecycle scripts, git deps and remote URLs by default |
| Lockfile audit | `lockfile-lint` for unexpected resolved hosts and aliasing ([[Dependency Confusion]]) |
| Typosquat detection | TypoGard (npm), Typomania (deployed in crates.io) ([[Typosquatting]]) |
| Workflow static analysis | `zizmor`, CodeQL for Actions, OpenSSF Scorecard `Dangerous-Workflow` |
| Offensive Actions enumeration | `gato`, Gato-X, `trajan` (self-hosted runners, artifact token leaks) |
| Pin and lock actions | `gh actions-lock` → `.github/workflows/actions.lock`; `pinact --min-age 7`; Renovate `minimumReleaseAge` |
| Runner egress monitoring | StepSecurity Harden-Runner (caught tj-actions) |
| Default-deny Kubernetes runners | GitHub Actions Gateway 2.0: per-tenant default-deny NetworkPolicy, egress proxy to GitHub ranges, metadata blocked, fork jobs refused, Kata support ([[GitHub Actions Security]]) |
| Release-age cooldown | npm `min-release-age` (days), pnpm `minimumReleaseAge` (minutes), Bun `minimumReleaseAge` (seconds), Deno `minimumDependencyAge`, uv `exclude-newer`, pip `--uploaded-prior-to P1D`, Yarn `npmMinimalAgeGate`, Cargo `registry.global-min-publish-age` ([[Malicious Packages]]) |
| Find `.pth` hooks | list lines starting with `import` in every `*.pth` under `site.getsitepackages()` + user site; review unfamiliar ones ([[raw/medium.com/microsoft-s-ai-agent-package-was-hijacked-on-pypi-here-s-how-to-check-15853|incident guide]]) |
| SBOM / scan / sign | `syft dir:. -o cyclonedx-json > sbom.json`; `grype sbom:sbom.json`; `cosign sign` / `cosign verify` |
| Verify npm provenance | `cosign verify-blob-attestation --bundle npm-provenance.sigstore.json --new-bundle-format --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity-regexp='^https://github.com/<org>/<repo>/.github/workflows/<release>.yml' <pkg>.tgz` |
| IDE extension updates | `npx vsx-diff <publisher.name> --from A --to B`; `vsx-diff compare old.vsix new.vsix --fail-on high`; `vsx-diff pin`/`rollback`/`cooldown 7`/`check`. Scores publisher changes, new executables, `eval`/`new Function` |
| Incident hunting | `semgrep --config r/10Uz5qo/semgrep.tj-actions-compromised`; GitHub code search `org:<org> path:**/shai-hulud-workflow.yml`; openwall `detect.sh` for xz |
Tool sources: [[raw/github.com/guarddog-cli-tool-to-identify-malicious-pypi-and-npm-packages-4339|GuardDog]] · [[raw/aikido.dev/why-developer-machines-are-now-the-number-one-target-for-supply-chain-8279|Aikido]] · [[raw/blog.trailofbits.com/we-hardened-zizmor-s-github-actions-static-analyzer-8645|Trail of Bits]] · [[raw/github.com/github-praetorian-inc-gato-github-actions-pipeline-enumeration-and-att-6914|gato]] · [[raw/medium.com/github-actions-got-a-lockfile-on-october-14-it-locks-the-code-you-revi-12862|Actions lockfile]] · [[raw/nathanberg.io/supply-chain-security-in-ci-sboms-slsa-and-sigstore-2765|Nathan Berg]] · [[raw/blog.sigstore.dev/cosign-verification-of-npm-provenance-and-github-attestations-4036|Sigstore]] · [[raw/bymustfa.medium.com/vs-code-eklenti-g-venli-i-g-ncellemeyi-nce-okuyun-13071|vsx-diff]].
Pwn-request audit grep from Wiz (full regex on [[Pwn Requests]]):
```bash
grep -rnE 'pull_request_target|workflow_run|issue_comment|repository_dispatch|allow-unsafe-pr-checkout|self-hosted|download-artifact|gh (pr checkout|repo clone)|refs/pull|\$\{\{ *github\.(event\.|head_ref)' .github/workflows/
```
Baseline workflow hardening ([[GitHub Actions Security]]):
```yaml
permissions: {} # grant per job
jobs:
build:
permissions: { contents: read }
steps:
- uses: actions/checkout@<40-char-sha> # vX.Y.Z
with: { persist-credentials: false }
- env: { TITLE: "${{ github.event.issue.title }}" }
run: some-command "$TITLE" # data, not code
```
## Pitfalls
- **Trusting provenance alone.** TanStack's 84 versions carried valid SLSA provenance after cache poisoning plus OIDC theft from `Runner.Worker` memory; AntV forged Sigstore attestations with Fulcio certs minted from stolen OIDC tokens. Verify the repo/workflow/ref **and** pair with time-based soak ([[Shai-Hulud Worm]], [[SBOM and Provenance]]).
- **SHA-pinning to an old version.** Pinning `actions/checkout` to a pre-backport SHA (e.g. v4.3.0) bypasses GitHub's 2026 pwn-request fix that `@v4` gets ([[Pwn Requests]]). The Actions lockfile locks whatever you resolved, including an already poisoned tag; never automate `--accept-moved`.
- **Assuming `--ignore-scripts` is enough.** `.pth` files, import-time code, `build.rs`, `require()`-triggered droppers and runtime fetches (`@leadstack/crm-connect` ≥ 1.0.19) all bypass it.
- **Assuming `permissions: {}` protects secrets.** It restricts `GITHUB_TOKEN`, not `secrets.*`; `Runner.Worker` memory exposes every decrypted secret in the job.
- **Transitive actions float.** A composite action inside a pinned action isn't covered by your pin (reviewdog inside `tj-actions/eslint-changed-files`).
- **Incomplete rotation.** TeamPCP used credentials from the Trivy/KICS breach to publish the malicious Checkmarx Jenkins plugin weeks later; Ultralytics was hit twice through a leftover PyPI token ([[CI-CD Pipeline Attacks|CI/CD Pipeline Attacks]], [[Credential Rotation and Revocation]]).
- **Cooldown unit mistakes.** pnpm counts minutes (1440 = a day), Bun counts seconds (1440 = 24 minutes); Go, Maven, Gradle and SwiftPM have no setting yet ([[raw/cyb3rops.medium.com/the-sweet-spot-is-a-day-old-15955|Roth]]).
- **Trusting the installed version string.** Swarm Desktop auto-offered clean 0.56.3 after malicious 0.56.2, so a compromised machine can look current ([[raw/ethswarm.org/swarm-incident-malicious-bee-js-13-3-0-and-swarm-desktop-0-56-2-15953|Swarm Foundation]]).
- **Default-deny egress as the whole answer.** prt-scan exfiltrated through workflow logs and PR comments, inside GitHub's own IP ranges ([[raw/karlkfi.medium.com/your-ci-can-reach-the-whole-internet-why-15956|karlkfi]]).
- **Revoking before imaging.** Mini Shai-Hulud and Miasma descendants run token-revocation monitors that wipe the host.
- **Unpinned security tools in CI.** LiteLLM ran Trivy unpinned, so the scanner stole its PyPI publishing credentials.
- **Uninstall ≠ remediate.** The Cursor-served Claude Code extension and Hermes implant leave independent persistence (LaunchAgent, scheduled task, systemd unit renamed to look like a CRM daemon).
- **Editor auto-update bypasses your cooldown.** vsx-diff's policy is ignored unless the editor's own auto-update is disabled; the tool doesn't cover the Cursor marketplace.
- **Treating template/model sandboxes as boundaries.** RunSybil recommends assuming code execution through Jinja and other CPython sandboxes; "security fix only" CPython lines won't get these memory-safety fixes, and much of the AI stack sits on 3.12 until late 2028. DigitalOcean's multi-tier isolation for bring-your-own-model contained the escape.
- **Bug-bounty PoC names becoming footholds.** The `mr.4nd3r50n` account published "BugBounty testing" dependency-confusion packages from 2024 before shipping malware in 2026 ([[Dependency Confusion]]).
- **Unwatched vendor accounts.** Always-on connections, shared passwords, no MFA ([[raw/medium.com/the-back-door-was-a-vendor-lessons-from-the-cr-dit-mutuel-ark-a-bank-h-13843|Arkéa writeup]]).
## Real-world cases
- **SolarWinds SUNBURST (2019–2020):** build injection tested Oct 2019, trojanized signed Orion updates from Mar 2020 ([[raw/fortinet.com/solarwinds-supply-chain-attack-fortinet-4466|Fortinet]]).
- **Codecov Bash Uploader (2021):** credential in a Docker image layer → one added line exfiltrated CI env vars; caught by a customer comparing SHA-256 ([[raw/netlas.io/supply-chain-attack-how-attackers-weaponize-software-3757|Netlas]]).
- **Birsan dependency confusion (2021) / PyTorch `torchtriton` (Dec 2022):** higher-versioned public packages won over internal names ([[raw/spectralops.io/5-examples-of-dependency-confusion-attacks-spectral-4468|Spectral]]).
- **XZ Utils CVE-2024-3094:** multi-year Jia Tan takeover, tarball-only `build-to-host.m4`, Ed448-gated sshd pre-auth RCE ([[raw/openssf.org/xz-backdoor-cve-2024-3094-openssf-4042|OpenSSF]]).
- **Polyfill.io (Jun 2024):** acquired domain served malware to 100K+ sites ([[raw/snyk.io/polyfill-supply-chain-attack-embeds-malware-in-javascript-cdn-assets-9483|Snyk]]).
- **Ultralytics (Dec 2024):** branch-name injection → pip cache poisoning → XMRig wheels from the real workflow, then a leftover API token ([[raw/blog.pypi.org/supply-chain-attack-analysis-ultralytics-4045|PyPI]]).
- **tj-actions / reviewdog (Mar 2025, CVE-2025-30066/30154):** ~23,000 repos, aimed at Coinbase ([[raw/unit42.paloaltonetworks.com/github-actions-supply-chain-attack-coinbase-to-tj-actions-4038|Unit 42]]).
- **Nx s1ngularity (Aug 2025):** `pull_request_target` injection; payload drove Claude Code/Gemini/q with permission-skipping flags; 5,500+ private repos flipped public ([[raw/blog.gitguardian.com/the-nx-s1ngularity-attack-inside-the-credential-leak-4032|GitGuardian]], [[raw/snyk.io/weaponizing-ai-coding-agents-for-malware-in-the-nx-malicious-package-s-9063|Snyk]]).
- **chalk / debug (Sep 2025):** phished maintainer, browser wallet-swapping payload, ~2 h exposure ([[raw/upwind.io/npm-supply-chain-attack-debug-chalk-16-packages-compromise-upwind-4481|Upwind]]).
- **Shai-Hulud 1 → 2.0 (Sep–Nov 2025):** self-replicating npm worm; 2.0 hit 796 packages / 25K+ repos ([[raw/stepsecurity.io/shai-hulud-self-replicating-worm-compromises-500-npm-packages-4047|StepSecurity]], [[raw/securitylabs.datadoghq.com/shai-hulud-2-0-npm-worm-analysis-4052|Datadog]]).
- **TeamPCP cascade (Mar 2026):** Trivy tags → LiteLLM 1.82.7/1.82.8 (`.pth`) → Telnyx (WAV stego); KICS images and Checkmarx extensions ([[raw/snyk.io/how-a-poisoned-security-scanner-became-the-key-to-backdooring-litellm-3398|Snyk]], [[raw/reversinglabs.com/inside-the-teampcp-cascading-supply-chain-attack-6846|ReversingLabs]]).
- **Axios (31 Mar 2026):** DPRK UNC1069 social-engineered the maintainer; `
[email protected]` dropped WAVESHAPER.V2 ([[raw/cloud.google.com/dprk-threat-actor-compromises-axios-npm-package-4028|Google Cloud]]).
- **TanStack / Mini Shai-Hulud (May 2026):** pwn request + cache poisoning + OIDC theft → first malicious npm releases with valid provenance ([[raw/snyk.io/tanstack-npm-packages-hit-by-mini-shai-hulud-7901|Snyk]]).
- **Nx Console VS Code extension (2026):** trojanized extension led to theft of GitHub internal repositories ([[raw/cyberscoop.com/github-says-internal-repositories-were-taken-in-poisoned-vs-code-exten-8148|CyberScoop]]).
- **AsyncAPI (Jul 2026):** pwn request stole bot PAT; project's own OIDC trusted publishing shipped 5 malicious versions ([[raw/wiz.io/m-red-team-asyncapi-supply-chain-compromise-via-github-actions-10369|Wiz]]).
- **bee-js 13.3.0 / Swarm Desktop:** hijacked accounts ran real release workflows; valid npm provenance and signed, notarized desktop builds ([[raw/medium.com/signed-provenanced-and-malicious-hijacked-accounts-shipped-malware-in-14298|Signed, Provenanced and Malicious]]).
- **tensorlake 0.5.144:** worm release with valid provenance, blocked by a 72 h soak rule ([[raw/hextrap.io/tensorlake-0-5-144-a-worm-with-valid-provenance-and-the-firewall-rule-12277|Hextrap]]).
- **JFrog Artifactory CVE-2026-82329:** unauthenticated admin-token minting, exploited in the wild ([[raw/thehackernews.com/attackers-exploit-critical-jfrog-artifactory-flaw-to-mint-admin-tokens-11853|THN]]).
- **Cursor marketplace Claude Code extension (29 Oct 2026):** stolen Fireworks AI key → trojanized 2.1.312/2.1.313 with SSH backdoor ([[raw/thehackernews.com/cursor-says-stolen-fireworks-ai-key-led-to-trojanized-claude-code-exte-15244|THN]]).
- **Crédit Mutuel Arkéa (4 Nov 2026):** vendor platform → bank's own account → up to EUR 118M in stablecoins ([[raw/medium.com/the-back-door-was-a-vendor-lessons-from-the-cr-dit-mutuel-ark-a-bank-h-13843|Arkéa writeup]]).
- **Swarm bee-js 13.3.0 / Desktop 0.56.2 (9 Nov 2026):** maintainer creds + release-bot token, no second approver; loader stole node keys/passwords and installed a RAT; AUR rebuild extended exposure ([[raw/ethswarm.org/swarm-incident-malicious-bee-js-13-3-0-and-swarm-desktop-0-56-2-15953|Swarm Foundation]]).
- **BentoML GHSA-v959-cwq9-7hr6:** malicious bento archive → host code execution during `bentoml containerize` ([[raw/github.com/bentoml-ssti-via-unsandboxed-jinja2-in-dockerfile-generation-15849|GHSA-v959-cwq9-7hr6]]).
- **Microsoft `agent-framework` 1.26.1/1.26.2 (17 Nov 2026):** `.pth` stealer for Azure/CI/OIDC credentials, live < 1 h, suspected ESRP cert theft; PYSEC-2026-4388 / GHSA-764m-3ppc-5m73 ([[raw/medium.com/microsoft-s-ai-agent-package-was-hijacked-on-pypi-here-s-how-to-check-15853|incident guide]], [[raw/medium.com/the-credential-was-valid-the-publisher-was-not-15854|VeritasChain]]).
- **`@leadstack/crm-connect` (16 Nov 2026):** npm `postinstall` installs Hermes Agent as a Telegram-controlled root systemd backdoor ([[raw/safedep.io/malicious-npm-package-turns-hermes-agent-into-a-backdoor-15719|SafeDep]]).
- **CPython/Jinja chat-template escape (2026):** backdoored model template → RCE in vLLM; AWS Bedrock mitigated, DigitalOcean contained ([[raw/runsybil.com/cpython-0-days-threaten-the-ai-supply-chain-jinja-model-template-sandb-15664|RunSybil]]).
## Checklist
**Intake (consumers)**
- [ ] One proxy registry owns internal namespaces; no pip `--extra-index-url`; internal npm scopes claimed publicly.
- [ ] Exact pins and hashed lockfiles committed; `lockfile-lint` in CI.
- [ ] Release-age cooldown ≥ 1 day (a week is common): Dependabot (72 h default for version updates), Renovate `minimumReleaseAge`, pip 26.1, npm/pnpm/Yarn/Bun/Deno/uv settings with units checked, RubyGems, Cloudsmith policies; security fixes get a reviewed fast lane ([[raw/bleepingcomputer.com/github-pypi-add-time-absed-defenses-against-supply-chain-attacks-10766|BleepingComputer]], [[raw/cyb3rops.medium.com/the-sweet-spot-is-a-day-old-15955|Roth]]).
- [ ] Hash-pinned Python installs (`--require-hashes`); executable `.pth` files reviewed.
- [ ] Install scripts disabled (`--ignore-scripts` / npm v12 defaults); installs sandboxed without secrets.
- [ ] Pre-install scanning (GuardDog, Safe Chain or a commercial feed); new unapproved deps fail CI; agent installs go through an allowlist.
- [ ] Provenance checked against expected repo + workflow; PyPI provenance warnings and npm provenance mismatches alert.
**CI/CD**
- [ ] No `pull_request_target`/`workflow_run` executing fork content; no `${{ github.event.* }}` / `github.head_ref` in `run:`.
- [ ] `permissions: {}` default; `persist-credentials: false`; no `toJson(secrets)` / `secrets: inherit`.
- [ ] Actions pinned by full SHA from the official repo (current, post-backport versions); Actions lockfile with "Require lockfile"; allowed-actions policy with SHA enforcement.
- [ ] Scanner images and uploader scripts pinned by digest and hash-verified.
- [ ] Ephemeral runners only; no self-hosted runners on public repos; fork jobs refused on self-hosted runners; default-deny egress and metadata server blocked ([[GitHub Actions Security]]).
- [ ] Cloud and tool access via OIDC / [[Workload Identity Federation]] with short-lived, project-scoped tokens; CI doesn't hold CD credentials.
- [ ] `zizmor` / CodeQL for Actions on every workflow change; CODEOWNERS on pipeline files.
**Publishing (maintainers)**
- [ ] Trusted Publishing only; all legacy API tokens revoked; npm staged publishing with 2FA approval ([[raw/github.blog/disrupting-supply-chain-attacks-on-npm-and-github-actions-10825|GitHub]]).
- [ ] Publish job in an Environment with required human approval, so stolen maintainer creds + bot token can't publish alone ([[raw/ethswarm.org/swarm-incident-malicious-bee-js-13-3-0-and-swarm-desktop-0-56-2-15953|Swarm Foundation]]); tag protection and Immutable Releases; no signing certs in `workflow_dispatch` workflows.
- [ ] Commit signing; MFA for anyone who can push tags.
**Developer machines and vendors**
- [ ] IDE extensions allowlisted; auto-update off or delayed (VS Code 1.123 two-hour delay); updates diffed (`vsx-diff`).
- [ ] Local AI CLIs not run with permission-skipping flags by default; credential files kept out of reach ([[Developer Workstation Secrets]], [[AI Coding Assistant Risks]]).
- [ ] Model templates, model code and imported build archives (bentos, Dockerfile templates) treated as untrusted code; template engines sandboxed; multi-tier isolation for BYOM inference.
- [ ] Vendor accounts inventoried, routed through PAM with MFA, time-limited and recorded sessions; four-eyes on large transfers.
**Response**
- [ ] SBOMs searchable fleet-wide; runtime inventory for long-lived hosts.
- [ ] Mass revocation runbook (GitHub self-service credential revocation, June 2026); image infected hosts before revoking.
- [ ] Any host that installed a bad version is rebuilt and every reachable credential rotated ([[Secret Scanning]], [[Credential Rotation and Revocation]]).
## Sub-pages
- [[Dependency Confusion]]: public package shadows an internal name via `--extra-index-url`, unclaimed scopes or version inflation.
- [[Typosquatting]]: lookalike and brandjacked package names, detection metrics and campaigns.
- [[Slopsquatting]]: registering package names and domains that LLMs hallucinate.
- [[Malicious Packages]]: execution hooks per ecosystem, maintainer takeover and major 2024–2026 campaigns.
- [[GitHub Actions Security]]: dangerous triggers, expression injection, tag repointing, runners, AI-powered actions, lockfile.
- [[Pwn Requests]]: `pull_request_target`/`workflow_run` handling of fork code and GitHub's 2026 changes.
- [[CI-CD Pipeline Attacks|CI/CD Pipeline Attacks]]: OWASP CICD-SEC Top 10, PPE, Jenkins/GitLab/registry compromise, poisoned tooling, IDE extensions.
- [[Shai-Hulud Worm]]: self-replicating npm credential worm from Sep 2025 through Mini Shai-Hulud and Miasma.
- [[tj-actions changed-files Compromise]]: CVE-2025-30066 chain from SpotBugs via reviewdog, aimed at Coinbase.
- [[XZ Utils Backdoor]]: CVE-2024-3094 maintainer takeover with tarball-only build injection.
- [[SBOM and Provenance]]: SBOM/VEX, SLSA, Sigstore, npm/PyPI attestations and where they fail.
## Sources
- [[raw/aikido.dev/why-developer-machines-are-now-the-number-one-target-for-supply-chain-8279|Why developer machines are now the number one target for supply chain attacks]]
- [[raw/medium.com/the-back-door-was-a-vendor-lessons-from-the-cr-dit-mutuel-ark-a-bank-h-13843|The Back Door Was a Vendor: Lessons From the Crédit Mutuel Arkéa Bank Heist]]
- [[raw/bymustfa.medium.com/vs-code-eklenti-g-venli-i-g-ncellemeyi-nce-okuyun-13071|VS Code Eklenti Güvenliği: Güncellemeyi Önce Okuyun]]
- [[raw/spectralops.io/5-examples-of-dependency-confusion-attacks-spectral-4468|5 Examples of Dependency Confusion Attacks (Spectral)]]
- [[raw/microsoft.com/malicious-npm-packages-abuse-dependency-confusion-to-profile-developer-8363|Malicious npm packages abuse dependency confusion to profile developer environments]]
- [[raw/microsoft.com/typosquatted-npm-packages-used-to-steal-cloud-and-ci-cd-secrets-8364|Typosquatted npm packages used to steal cloud and CI/CD secrets]]
- [[raw/medium.com/slopsquatting-when-your-ai-assistant-invents-a-package-name-someone-el-12528|Slopsquatting: When Your AI Assistant Invents a Package Name, Someone Else Registers It]]
- [[raw/unit42.paloaltonetworks.com/phantom-squatting-ai-hallucinated-domains-as-a-software-supply-chain-v-9992|Phantom Squatting: AI-Hallucinated Domains as a Software Supply Chain Vector]]
- [[raw/safedep.io/malicious-npm-package-turns-hermes-agent-into-a-backdoor-15719|Malicious npm package turns Hermes Agent into a backdoor]]
- [[raw/thehackernews.com/cursor-says-stolen-fireworks-ai-key-led-to-trojanized-claude-code-exte-15244|Cursor Says Stolen Fireworks AI Key Led to Trojanized Claude Code Extension Incident]]
- [[raw/runsybil.com/cpython-0-days-threaten-the-ai-supply-chain-jinja-model-template-sandb-15664|CPython 0-days threaten the AI supply chain (Jinja model-template sandbox escape)]]
- [[raw/youtube.com/def-con-34-no-socket-no-privs-no-problem-weaponizing-oci-registries-15696|DEF CON 34 - No Socket, No Privs, No Problem: Weaponizing OCI Registries]]
- [[raw/blog.pypi.org/pypi-s-redesigned-project-pages-with-clearer-security-signals-are-now-15656|PyPI's redesigned project pages with clearer security signals are now live]]
- [[raw/sonarsource.com/inside-secretless-analysis-from-ci-identity-to-project-scoped-access-15755|Inside secretless analysis: from CI identity to project-scoped access]]
- [[raw/youtube.com/owasp-appsec-days-india-2026-day-1-keynote-steve-springett-15697|OWASP AppSec Days India 2026 Day 1 Keynote - Steve Springett]]
- [[raw/github.com/guarddog-cli-tool-to-identify-malicious-pypi-and-npm-packages-4339|GuardDog: CLI Tool to Identify Malicious PyPI and npm Packages]]
- [[raw/blog.trailofbits.com/we-hardened-zizmor-s-github-actions-static-analyzer-8645|We hardened zizmor's GitHub Actions static analyzer]]
- [[raw/github.com/github-praetorian-inc-gato-github-actions-pipeline-enumeration-and-att-6914|GitHub - praetorian-inc/gato: GitHub Actions Pipeline Enumeration and Attack Tool]]
- [[raw/medium.com/github-actions-got-a-lockfile-on-october-14-it-locks-the-code-you-revi-12862|GitHub Actions Got a Lockfile on October 14. It Locks the Code You Reviewed. It Does Not Review It.]]
- [[raw/nathanberg.io/supply-chain-security-in-ci-sboms-slsa-and-sigstore-2765|Supply Chain Security in CI: SBOMs, SLSA, and Sigstore]]
- [[raw/blog.sigstore.dev/cosign-verification-of-npm-provenance-and-github-attestations-4036|cosign Verification of npm Provenance and GitHub Attestations]]
- [[raw/fortinet.com/solarwinds-supply-chain-attack-fortinet-4466|SolarWinds Supply Chain Attack (Fortinet)]]
- [[raw/netlas.io/supply-chain-attack-how-attackers-weaponize-software-3757|Supply Chain Attack: How Attackers Weaponize Software]]
- [[raw/openssf.org/xz-backdoor-cve-2024-3094-openssf-4042|xz Backdoor CVE-2024-3094 - OpenSSF]]
- [[raw/snyk.io/polyfill-supply-chain-attack-embeds-malware-in-javascript-cdn-assets-9483|Polyfill supply chain attack embeds malware in JavaScript CDN assets]]
- [[raw/blog.pypi.org/supply-chain-attack-analysis-ultralytics-4045|Supply-chain attack analysis: Ultralytics]]
- [[raw/unit42.paloaltonetworks.com/github-actions-supply-chain-attack-coinbase-to-tj-actions-4038|GitHub Actions Supply Chain Attack: Coinbase to tj-actions]]
- [[raw/blog.gitguardian.com/the-nx-s1ngularity-attack-inside-the-credential-leak-4032|The Nx s1ngularity Attack: Inside the Credential Leak]]
- [[raw/snyk.io/weaponizing-ai-coding-agents-for-malware-in-the-nx-malicious-package-s-9063|Weaponizing AI Coding Agents for Malware in the Nx Malicious Package Security Incident]]
- [[raw/upwind.io/npm-supply-chain-attack-debug-chalk-16-packages-compromise-upwind-4481|npm Supply Chain Attack: Debug, Chalk + 16 Packages Compromise (Upwind)]]
- [[raw/stepsecurity.io/shai-hulud-self-replicating-worm-compromises-500-npm-packages-4047|Shai-Hulud: Self-Replicating Worm Compromises 500+ NPM Packages]]
- [[raw/securitylabs.datadoghq.com/shai-hulud-2-0-npm-worm-analysis-4052|Shai-Hulud 2.0 npm worm: analysis]]
- [[raw/snyk.io/how-a-poisoned-security-scanner-became-the-key-to-backdooring-litellm-3398|How a Poisoned Security Scanner Became the Key to Backdooring LiteLLM]]
- [[raw/reversinglabs.com/inside-the-teampcp-cascading-supply-chain-attack-6846|Inside the TeamPCP cascading supply chain attack]]
- [[raw/cloud.google.com/dprk-threat-actor-compromises-axios-npm-package-4028|DPRK Threat Actor Compromises Axios NPM Package]]
- [[raw/snyk.io/tanstack-npm-packages-hit-by-mini-shai-hulud-7901|TanStack npm Packages Hit by Mini Shai-Hulud]]
- [[raw/cyberscoop.com/github-says-internal-repositories-were-taken-in-poisoned-vs-code-exten-8148|GitHub says internal repositories were taken in poisoned VS Code extension attack]]
- [[raw/wiz.io/m-red-team-asyncapi-supply-chain-compromise-via-github-actions-10369|M-Red-Team: AsyncAPI Supply Chain Compromise via GitHub Actions]]
- [[raw/medium.com/signed-provenanced-and-malicious-hijacked-accounts-shipped-malware-in-14298|Signed, Provenanced and Malicious: Hijacked Accounts Shipped Malware in bee-js 13.3.0]]
- [[raw/hextrap.io/tensorlake-0-5-144-a-worm-with-valid-provenance-and-the-firewall-rule-12277|
[email protected]: A Worm With Valid Provenance, and the Firewall Rule That Stops It]]
- [[raw/thehackernews.com/attackers-exploit-critical-jfrog-artifactory-flaw-to-mint-admin-tokens-11853|Attackers Exploit Critical JFrog Artifactory Flaw to Mint Admin Tokens Days After Disclosure]]
- [[raw/bleepingcomputer.com/github-pypi-add-time-absed-defenses-against-supply-chain-attacks-10766|GitHub PyPI add time-absed defenses against supply chain attacks]]
- [[raw/github.blog/disrupting-supply-chain-attacks-on-npm-and-github-actions-10825|Disrupting supply chain attacks on NPM and GitHub Actions]]
- [[raw/slsa.dev/defender-s-perspective-dep-confusion-and-typosquatting-slsa-4470|Defender's Perspective: Dep Confusion and Typosquatting (SLSA)]]
- [[raw/snyk.io/reconstructing-the-tj-actions-changed-files-github-actions-compromise-9226|Reconstructing the TJ Actions Changed Files GitHub Actions Compromise]]
- [[raw/cyberarmy.tech/supply-chain-attacks-2025-2026-axios-shai-hulud-and-more-3761|Supply Chain Attacks 2025-2026: Axios, Shai-Hulud, and More]]
- [[raw/medium.com/pin-your-github-actions-by-commit-sha-and-lock-workflow-permissions-14598|Pin your GitHub Actions by commit SHA and lock workflow permissions]]
- [[raw/wiz.io/the-pwn-request-reckoning-what-still-works-against-github-actions-12396|The Pwn Request Reckoning: What Still Works Against GitHub Actions]]
- [[raw/infoq.com/vs-code-1-123-adds-two-hour-extension-update-delay-to-limit-supply-cha-9565|VS Code 1.123 Adds Two-Hour Extension Update Delay to Limit Supply Chain Attacks]]
- [[raw/jfrog.com/npm-v12-s-biggest-security-change-from-implicit-to-explicit-trust-9551|npm v12’s Biggest Security Change: From Implicit to Explicit Trust]]
- [[raw/cyb3rops.medium.com/the-sweet-spot-is-a-day-old-15955|The Sweet Spot Is a Day Old]]
- [[raw/ethswarm.org/swarm-incident-malicious-bee-js-13-3-0-and-swarm-desktop-0-56-2-15953|Swarm incident: malicious bee-js 13.3.0 and Swarm Desktop 0.56.2]]
- [[raw/github.com/bentoml-ssti-via-unsandboxed-jinja2-in-dockerfile-generation-15849|BentoML: SSTI via unsandboxed Jinja2 in Dockerfile generation]]
- [[raw/karlkfi.medium.com/your-ci-can-reach-the-whole-internet-why-15956|Your CI Can Reach the Whole Internet. Why?]]
- [[raw/medium.com/microsoft-s-ai-agent-package-was-hijacked-on-pypi-here-s-how-to-check-15853|Microsoft's AI Agent Package Was Hijacked on PyPI: Here's How to Check If You're Affected]]
- [[raw/medium.com/the-credential-was-valid-the-publisher-was-not-15854|The Credential Was Valid. The Publisher Was Not.]]