

Software Supply Chain Attacks: How They Work, What They Steal, and How to Detect Them

A supply chain attack reaches its target through something the target already trusts. NIST’s glossary, drawing on the 2022 edition of CNSSI 4009, defines it as an adversary exploiting weaknesses in the product or service supply network of the intended victim. The 2023 compromise of 3CX’s desktop app shows how far that can travel: Mandiant traced it to a tampered installer from another vendor, the first time it had seen one software supply chain attack lead to another.
In software, recent high-profile incidents have targeted legitimate open-source packages and the pipelines that publish them. Daylight’s research team analyzed the Trivy 0.69.4 compromise and the LiteLLM 1.82.8 release. In both, the payload was built to harvest credentials, so once a malicious version ran, exposure extended to every token, cloud key, and publish credential its runtime could reach.
TL;DR:
- Known-bad matching lags a new malicious release by hours, and malicious releases have shipped with valid provenance.
- Credential theft is a recurring goal in recent campaigns, which makes identity, secrets, and cloud API telemetry a primary detection surface.
- High-signal detections watch install-time behavior: lifecycle scripts spawning shells, build agents contacting new hosts, and Python startup hooks appearing in site-packages.
- Response starts with containment, and in the Trivy compromise an attacker survived a partial credential rotation by holding a second identity.
How Software Supply Chain Attacks Work in 2026
Typosquats and other brand-new packages still account for most malware published to registries like PyPI, according to PyPI’s incident report. Many of the widest-reaching incidents have come from compromising the identities and pipelines that publish legitimate packages. MITRE ATT&CK tracks this activity as T1195.001, Compromise Software Dependencies and Development Tools, and recent incidents have started in one of the following ways.
1. Maintainer Account Takeover
Phishing remains one of the most effective ways into a popular package. In September 2025, attackers used a lookalike npmjs.help domain to phish a maintainer and pushed malicious versions of widely used packages, including debug and chalk. In the Axios compromise on March 31, 2026, a hijacked maintainer account published Axios versions that pulled in a new dependency, plain-crypto-js, which dropped a remote access trojan.
2. CI/CD Pipeline Compromise
Nx’s August 2025 s1ngularity incident started with an injection into a pull_request_target workflow in its GitHub Actions publishing pipeline that exposed the npm token used for publishing. On March 19, 2026, attackers force-pushed malicious commits over almost every version tag in aquasecurity/trivy-action, and setup-trivy was compromised the same day. Pipelines that ran against those tags during the exposure window pulled credential-stealing code, and Daylight’s Trivy analysis notes that many pipelines can pull updates automatically with no strict version pinning.
3. Self-Propagating Worms
The Shai-Hulud payload republished trojanized versions of every package a stolen npm token could reach, turning each token into a new distribution channel. The pattern repeated through 2026 with Mini Shai-Hulud and the August keyv and cacheable wave known as ChainDrop, which put more than 2,200 malicious versions on npm by early August 2026. Once the Mini Shai-Hulud source was posted publicly in May 2026, copycat variants followed.
4. Slopsquatting
Slopsquatting registers the package names that AI coding assistants hallucinate. A USENIX Security 2025 study found that hallucinated packages made up at least 5.2% of commercial models’ suggestions and 21.7% of open-source models’ in its testing. The names also repeat across runs of the same prompt, which makes them predictable targets.
Confirmed exploitation is harder to pin down, but the exposure is real: Aikido found the hallucinated name react-codeshift already referenced in 237 GitHub repositories before registering it defensively.
What the Payload Wants: Credentials, Then Reach
The Trivy payload arrived through the malicious v0.69.4 release and the compromised trivy-action and setup-trivy GitHub Actions. It went after cloud credentials for AWS, GCP, and Azure, along with SSH keys, Kubernetes tokens, npm and Docker registry tokens, database credentials, and crypto wallets. Stolen data left over HTTP POST, with a fallback that uploaded it to a public GitHub repository named tpcp-docs.
PyPI’s incident report traces the malicious LiteLLM and Telnyx releases to an API token exposed through the Trivy compromise days earlier. Datadog researchers believe tokens left unrotated after s1ngularity gave Shai-Hulud its initial access, and in December 2025, Wiz found over 60% of leaked npm tokens from Shai-Hulud 2.0 still valid.
LiteLLM versions 1.82.7 and 1.82.8, published to PyPI on March 24, 2026, both carried a malicious payload in proxy_server.py, and 1.82.8 also added litellm_init.pth. During normal startup, Python processes .pth files in site-packages and runs their import lines. As Daylight’s analysis notes, that let the 1.82.8 hook run even when nothing imported the library, across developer machines, servers, and production systems as well as CI. On long-lived hosts it installed sysmon.py to poll checkmarx[.]zone for follow-on payloads.
LiteLLM’s release pipeline was compromised again on October 21, 2026. Version 1.107.0 used the same startup-hook technique and stayed available for under two hours on PyPI and about two and a half hours on Docker Hub.
Why Package Scanning Alone Misses Active Compromise
Vulnerability and known-malware matching depend on existing intelligence, and in the first hours of an attack there often isn’t any. Socket flagged plain-crypto-js within six minutes, yet the malicious Axios versions stayed installable for hours, and any install in that window that resolved to a compromised version and allowed lifecycle scripts could run the dropper.
Behavioral package analysis can flag suspicious install scripts before a release is formally classified, but whether a bad version ran, and what it reached, shows up in runtime and identity telemetry.
Provenance doesn’t close that gap either: on May 11, 2026, 84 malicious versions across 42 @tanstack packages were published through TanStack’s trusted publisher, and OpenSSF’s analysis notes the attestations correctly named the repository, workflow, and ref. A signature tells you where and how an artifact was built, and Sigstore’s threat model is explicit that it can’t tell you whether the code is safe.
Upstream of detection, Daylight’s engineering team pairs a behavior-scanning registry firewall with MDM-enforced routing, a cooldown on new releases, and CI hardening, and reports that keyv still executed weeks after npm v12 made dependency install scripts opt-in as of July 2026.
How to Detect a Supply Chain Attack in Progress
Each signal below is ambiguous on its own, so supply chain attack detection depends on correlating install-time behavior with what happens next on the network and in your identity systems.
1. Install-Time Process Lineage
Watch for package managers spawning shells, curl, wget, or unexpected runtimes. Elastic ships prebuilt rules for Node.js install scripts and for curl or wget spawned by Node.js. Microsoft’s Shai-Hulud 2.0 guidance includes a hunting query that makes a useful starting point:
DeviceProcessEvents | where FileName has "node" and ProcessCommandLine has_any ("setup_bun.js", "bun_environment.js")
Shai-Hulud payloads used the open-source secret scanner TruffleHog to hunt for credentials. TruffleHog on a developer laptop is unremarkable, and TruffleHog inside an npm install process tree deserves an alert. Datadog’s runtime rules tag every process under npm install with a shared correlation key so related alerts group together.
2. First-Seen Egress From Build Agents
CI runners talk to a small, stable set of hosts, so a new destination stands out. StepSecurity’s Harden-Runner caught the tj-actions/changed-files compromise in March 2025 when an unexpected endpoint appeared in workflow traffic. Daylight’s Trivy analysis lists these indicators: DNS queries to scan[.]aquasecurtiy[.]org, connections to 45.148.10[.]212, execution of v0.69.4 on runners or endpoints, and pipelines using setup-trivy. A package manager contacting the cloud metadata endpoint at 169.254.169.254 during an install is rarely legitimate and worth alerting on.
3. Credential File Reads and Cloud API Use
Reads of ~/.npmrc, ~/.git-credentials, .env, and ~/.aws/credentials during an install window deserve attention. Reads of Runner.Worker process memory deserve more, since the TanStack payload pulled secrets straight from it.
Downstream, GuardDuty’s CredentialAccess:IAMUser/AnomalousBehavior finding covers anomalous calls to Secrets Manager such as GetSecretValue. Once you know which access key IDs were exposed, filter CloudTrail on them and look for calls from IPs outside your CI and corporate ranges. Stolen keys can show up in identity telemetry before anything else, which is where identity threat detection comes in.
4. GitHub and Registry Audit Events
New public repositories with worm branding (Shai-Hulud, tpcp-docs), self-hosted runners named SHA1HULUD, and writes to .github/workflows/discussion.yaml are all documented artifacts of persistence or exfiltration. GitHub’s packages.package_version_published event carries the token ID and scopes behind each publish.
5. Python Startup Hooks
Treat any new .pth file outside a known-good baseline as a critical alert. Elastic’s prebuilt .pth creation rule covers this on Linux, so macOS and Windows developer machines need their own coverage.
Responding Once a Compromise Is Confirmed
Treat any host or CI job that ran the bad version as a full credential exposure event, even before telemetry confirms what the payload read. Track three findings separately: an affected artifact was present, malicious code executed, and credentials were accessed or sent out. Those findings drive scope and priority during incident response triage.
Contain first: isolate affected hosts and pause compromised workflows while preserving evidence. With Python startup-hook payloads, inspect the environment from a known-clean system with trusted tools: Microsoft’s LiteLLM guidance warns against running python, pip, or anything else that starts the affected interpreter, since startup reruns the hook.
Scope by time window as well as by version. In the Trivy compromise, the trivy-action exposure ran about 12 hours from 17:43 UTC on March 19, 2026, setup-trivy was exposed for about four hours, and malicious images reached Docker Hub three days later.
Copies pulled during a window can run long after it closes, so search caches, internal mirrors, build outputs, and container images too. Match all of it against CI run history, and move quickly: GitHub keeps workflow logs for 90 days by default, and those logs capture only step output, so correlate them with audit events and network telemetry.
Revoke or rotate every credential the compromised environment could reach, including all secrets injected into affected CI jobs, as CISA’s Axios guidance advises, and issue replacements from a clean machine so they can’t be captured again. Aqua’s Trivy incident conclusion shows why partial rotation fails: “while we rotated credentials of a specific compromised user, that attacker was still present in the system with another user.”
A GITHUB_TOKEN expires when its job ends, but personal access tokens stay usable until they expire or are revoked, so revoke them explicitly.
Hunt persistence before you rebuild. A litellm_init.pth file on a host confirms the malicious hook is present. Process and network telemetry show whether it ran and whether data left, and the host stays suspect either way. CSA notes a .pth file dropped during installation can keep running after the package is removed.
Check for sysmon.py, rogue self-hosted runners, and the editor and agent hooks that the keyv worm planted in .claude/settings.json and .vscode/tasks.json. Daylight’s Trivy guidance recommends rebuilding CI environments from clean, trusted images, since in-place cleanup leaves too much room for a missed foothold.
Deciding Where to Invest First
If your workflows reference third-party actions by tag, pin to commit SHAs so a moved tag can’t swap the action code. Pin and verify the tools those actions download as well, because even an untampered setup-trivy commit downloaded the compromised v0.69.4 binary. GitHub Actions workflow lockfiles, generally available since October 2026, record the exact commits of actions and their dependencies once you generate and commit one for a workflow.
If any workflow runs on pull_request_target, review it now. From December 2, 2026, GitHub plans to block that trigger by default in public repositories unless a policy allows it.
If CI still holds long-lived npm or PyPI publish tokens, move to trusted publishing and restrict the OIDC subject to the specific branch and workflow file.
If you have no process telemetry on CI runners, start there. Install-time lineage and first-seen egress are often your only evidence that a bad version actually ran in your environment.
If developers or agents install packages suggested by AI assistants, gate installs on registry existence, package age, and a malware check before the command runs.
If you can’t say within an hour which runners executed a given version between two timestamps, fix log retention and centralization first, since every response step above depends on that answer.
Why Supply Chain Response Is a Cross-System Investigation
Daylight’s LiteLLM investigation began with a Wiz alert, “Python script executed base64 encoded code,” which on its own looked only mildly suspicious. The verdict depended on connecting that alert to a package version, a .pth file, an outbound domain, and the credentials in scope. In most environments, those facts sit in the EDR, the cloud provider, GitHub, the identity provider, and the CI system, each owned by a different team. Together, those systems hold the answer to what the runtime touched and where the exposed credentials went next.
Frequently Asked Questions About Supply Chain Attacks
How Is a Supply Chain Attack Different From a Third-Party Breach?
A third-party breach exposes data a vendor holds about you. In software security, a supply chain attack usually uses a vendor’s product, package, or update channel to run attacker code inside your environment. The two often overlap in incident reports, but the response differs: a third-party breach starts with notification and data scoping, while a supply chain attack starts with finding every system that executed the bad artifact.
How Long Should a Dependency Cooldown Be?
Three to seven days is a reasonable range. PyPI’s guidance suggests three days, and Daylight’s engineering team uses seven. In one analysis of past attacks, eight of ten had windows under a week, so a seven-day cooldown would have blocked them. The tradeoff is slower security fixes, which is why security updates typically skip the cooldown. GitHub’s package firewall, in public preview for npm on GitHub Enterprise Cloud, can enforce a cooldown at the registry.
Do SBOMs Help Detect Supply Chain Attacks?
An SBOM tells you which component versions you shipped, which speeds up the first question when an advisory lands: did we pull the bad version? It can’t tell you whether a malicious version executed, what it read, or where it sent credentials. Pair SBOM inventory with the runtime and identity signals above.
How Do These Incidents Map to MITRE ATT&CK?
The techniques around the package compromise matter more for detection than the compromise itself. ATT&CK’s TeamPCP entry maps the injection of credential-stealing payloads into legitimate CI/CD workflows to T1677, Poisoned Pipeline Execution, and the use of stolen tokens to inject code and exfiltrate data to T1550.001, Application Access Token. Those two mappings point detections at the pipeline and identity side, where attacker activity is easier to see.
Subscribe to newsletter
Subscribe to receive the latest blog posts to your inbox every week.
.avif)




Related posts
.avif)

For expert judgment, scaled to your world, head for Daylight



