Software Supply Chain Security: From Log4Shell to Slopsquatting
Most of the code you ship was written by people you have never met. Here is how attackers target dependencies, build pipelines, and now AI coding assistants, and the habits that keep your supply chain clean.

Open a typical web project and count the lines of code your team actually wrote. Then count the lines in node_modules, your Python virtual environment, your base container image, and your CI actions. For most applications, the second number is orders of magnitude bigger.
That code is your software supply chain, and attackers have figured out that compromising one popular component can be far more efficient than attacking thousands of applications one at a time.
How supply chain attacks happen
Known vulnerabilities. The most common risk is the simplest: a library you use has a published CVE and you have not updated. Log4Shell is the canonical example, and Equifax’s 2017 breach began with an Apache Struts flaw that had a patch available about two months before exploitation started.
Malicious packages. Attackers publish packages designed to steal credentials or install backdoors, often with typosquatted names (think reqeusts instead of requests) or posing as handy utilities.
Dependency confusion. If your company uses an internal package called acme-auth-utils, an attacker can publish a package with the same name and a higher version on the public registry. A misconfigured build may prefer the public one.
Compromised maintainers. Attackers take over a legitimate maintainer’s account, or patiently earn their way into a project. The 2024 XZ Utils backdoor involved an attacker who spent years building trust as a maintainer before inserting a sophisticated backdoor into a widely used compression library. Several large npm compromises in 2025 used phished maintainer credentials and self-spreading malware that stole tokens from developer machines and CI systems.
Compromised builds. In the SolarWinds attack, the build system itself was modified to insert malicious code into signed updates. CI pipelines are also attacked through malicious pull requests and compromised third-party actions.
The AI twist: slopsquatting
AI coding assistants sometimes recommend packages that do not exist. They sound plausible, and the same made-up names tend to come up repeatedly. Slopsquatting is the attack where someone registers those hallucinated names on public registries. When a developer accepts the assistant’s suggestion and runs pip install or npm install, the attacker’s package fills the gap.
The defense is a simple habit: before installing any package an AI suggested, confirm that it exists, that it is the one you expect, and that it is reputable. Check its download history, repository, and maintainers. It takes seconds.

Defending your dependencies
Know what you use. Software Composition Analysis (SCA) tools inventory direct and transitive dependencies and match them against vulnerability databases:
npm audit --omit=dev
pip-audit -r requirements.txt
osv-scanner scan source -r .
trivy image myapp:latest
Keep an SBOM. A Software Bill of Materials in CycloneDX or SPDX format lets you answer “where do we use this library?” in minutes during the next Log4Shell-style emergency, instead of days.
Prioritize smartly. SCA tools can report hundreds of findings. Rank them by severity, then by real-world exploitation signals such as the CISA Known Exploited Vulnerabilities catalog and EPSS scores, then by reachability (does your code call the vulnerable function?) and exposure (is it internet-facing?).
Update continuously. Small, frequent updates beat large, painful ones. Let Dependabot or Renovate open pull requests, and pin versions with lockfiles so changes are deliberate.
Vet new dependencies. Is it maintained? Widely used? Does it drag in fifty transitive packages? Could ten lines of your own code replace it? The OpenSSF Scorecard helps with these questions.
Stop dependency confusion. Use scoped names like @acme/auth-utils, configure registries so internal names only resolve privately, and claim your internal names on public registries.
Harden the pipeline itself
Your CI/CD system holds the keys to production. Treat it that way:
- Give pipeline tokens the least privilege they need, and keep them short-lived.
- Use OIDC federation to get cloud credentials at build time instead of storing long-lived secrets.
- Pin third-party actions to a full commit hash, not a mutable tag.
- Do not expose secrets to workflows triggered by pull requests from forks.
- If you publish packages, protect maintainer accounts with phishing-resistant MFA, use trusted publishing, sign releases, and publish provenance.
Misconfiguration: the other half of the problem
Supply chain attacks get headlines, but plain misconfiguration causes a huge share of incidents: debug mode left on, default credentials, exposed .git or .env files, verbose error pages, missing security headers, and public cloud storage. The cure is boring and effective: secure baselines, infrastructure and policy as code, and drift detection that alerts when reality stops matching the template. Errors should fail closed and reveal nothing useful.
AI models and tools are supply chain too
Machine learning models, datasets, and MCP tool servers are now dependencies like any other. Some model formats, such as pickle-based checkpoints, can execute code when loaded. Tool servers can change their behavior after you approve them. Vet them, pin versions, prefer safe formats, and give them the least privilege possible.
Key takeaways
- Your supply chain includes dependencies, build systems, containers, CI actions, and AI models and tools.
- Attacks range from unpatched CVEs to typosquatting, dependency confusion, compromised maintainers, and poisoned builds.
- Slopsquatting exploits AI-hallucinated package names. Verify before you install.
- Use SCA, SBOMs, risk-based prioritization, continuous updates, and careful vetting.
- Harden CI/CD with least-privilege tokens, OIDC, and pinned actions.
Go deeper with the book
This article is adapted from Web Security in the Age of AI: Attacks, Defenses, Tools, and Bug Hunting for Modern Web Applications and LLM Systems by Rupak (see Chapter 15, “Supply Chain Security and Security Misconfiguration”).
The book pairs every attack with its fix across 27 chapters, from core vulnerabilities and professional tools to bug bounty hunting, attacking and defending LLM applications, and lessons from real breaches. It includes hands-on labs, review questions, a full testing checklist, a security headers reference, and an LLM red teaming playbook.
Related reading
- AI Code Review and Autofix: Can AI Fix Your Security Bugs?
- 7 Real-World Breaches and the Security Lessons They Teach







