Dependencies are the long tail of your attack surface. The security industry keeps selling you a longer telescope. What you need is a shorter tail.

01 Flip the axis

Your application has 1,200 dependencies. You chose maybe forty of them. The other 1,160 were dragged in by the forty you chose, and by the dependencies of those dependencies, and by the dependencies of those. You have never read their code. You do not know who maintains them. In some cases, nobody does.

Each of those 1,160 packages is individually negligible. Nobody loses sleep over a three-line utility six levels deep in a transitive graph. But an attacker only needs one of them. One burned-out maintainer who hands over the keys to a stranger. One post-install script that phones home. One moment where the probability of compromise across the entire graph tips from unlikely to inevitable.

This is the long tail — the same shape Chris Anderson described in 2004 when he argued that the aggregate value of obscure products exceeds the value of the blockbusters. He was talking about Amazon and Netflix. The same curve applies to software risk. Most security effort concentrates on the head: your application code, the operating system, the major framework. But the actual attack surface — the place where breaches happen — is dominated by the tail. Hundreds of packages nobody is watching, each one too small to matter, together too numerous to secure.

Anderson's long tail was enabled by near-zero distribution costs. Digital shelves are infinite. The dependency long tail was enabled by the same force: near-zero integration costs. npm install is frictionless. go get is frictionless. The cost of adding a dependency is zero at the point of decision. The security cost accumulates silently, invisibly, until it detonates. A classic externality — the bill arrives later, and someone else pays it.

The industry's entire answer to this has been additive: buy something that watches the tail. Scanners, dashboards, software bills of materials, monitoring agents. This article ends up somewhere else, at a position I will call reductive security — and the case for it takes some building, because the additive model is not stupid and the alternative is not "write everything yourself." Worth knowing that is where this goes before we look at what the tail has cost people who were watching it carefully.

02 The tail is where the attacks are

In September 2018, a user called right9ctrl sent an email to Dominic Tarr, the original author of event-stream, a package with two million weekly downloads. Tarr had not touched the code in years. He was tired. He handed over full publishing rights to a stranger on the internet.

Right9ctrl added a single dependency — flatmap-stream — containing an encrypted payload that specifically targeted the Copay Bitcoin wallet. The code was surgically precise: it only activated inside Copay's build environment, making it invisible to anyone else who installed the package. It ran undetected for two and a half months and was downloaded around eight million times in that window.8 Event-stream sat deep in the dependency trees of thousands of other projects, including Vue CLI, VS Code and nodemon.8

No phishing. No credential theft. No zero-day exploit. The attacker identified a fatigued maintainer in the tail and was handed the keys voluntarily. The long tail's defining feature — that nobody watches the individual items — was the entire attack vector.

That was 2018. The trajectory since has been vertical.

September & November 2025

Shai-Hulud: the tail learns to propagate

Malicious versions of popular npm packages were published containing post-install scripts that harvested developer credentials. But Shai-Hulud was not just theft. It was a worm. When a compromised package found npm tokens in the victim's environment, it automatically published malicious versions of every other package that account could access. The tail grew itself.

The first wave compromised over 500 packages before it was contained, and CISA issued a formal alert recommending organisations pin all dependencies to pre-attack versions and rotate every developer credential immediately.3 It was the first successful self-propagating attack in npm's history. A second wave — Shai-Hulud 2.0 — returned in late November and took a further 600 to 800 packages, which tells you the containment was of an incident, not of a technique.

Q4 2025

IndonesianFoods: manufacturing the tail

The IndonesianFoods campaign generated over 100,000 malicious packages in a matter of days, publishing a new one every seven seconds. A single campaign effectively doubled the total volume of malware on npm. This was not surgical. It was industrial.

March 2026

Axios: the nation-state in your node_modules

The widely-used Axios HTTP client was compromised via a maintainer account takeover. Five major supply chain attacks hit in March 2026 alone, including compromises of Trivy and KICS — vulnerability scanners — and LiteLLM, an AI infrastructure library with 3.4 million daily downloads. The Axios attack was attributed to a North Korean threat actor. The dependency graph is now strategic infrastructure for state-level adversaries.

Event-stream was one attacker, one package, one target. Shai-Hulud weaponised the graph itself. IndonesianFoods industrialised the creation of malicious surface area. Axios confirmed that nation-states treat your node_modules folder as an attack vector. The escalation is not linear. It is compounding.

03 The numbers

The narrative is supported by data that has gone from concerning to absurd. Sonatype has catalogued over 1.233 million malicious open source packages since it began counting in 2019.6 More than 454,600 of those were published in 2025 alone — across npm, PyPI, Maven Central, NuGet and Hugging Face — with nearly 89% of the year's total logged in the fourth quarter. The curve is not steepening gradually. It is bending.

30%
of breaches now involve a third party — up from 15% the previous year10
Verizon DBIR 2025
267
days on average to detect and contain a supply chain compromise — the longest of any attack vector12
IBM 2025
$60B
projected global cost of supply chain attacks in 20255
Cybersecurity Ventures
1 in 3
organisations feel prepared to defend against software supply chain threats13
Ivanti 2025

Black Duck's 2025 OSSRA report, drawn from audits of 965 commercial codebases, found the average project now carries over 1,200 dependencies — a 30% increase year-on-year — and that 64% of the open source components it found were transitive rather than directly chosen.7 Most of what you ship is other people's work, pulled in by other people's decisions, maintained by other people's volunteers.

And the tail is not just unwatched. It is unmaintained — the overwhelming majority of vulnerable components in circulation have a fixed version already published, sitting unused because nobody upgraded.

The long tail compounds
Cumulative malicious packages tracked vs. global cost of supply chain attacks
Cumulative malicious packages (thousands) — Sonatype Global cost $B — Cybersecurity Ventures / Gartner
Chart data: both series trending sharply upward with malicious packages growing exponentially.
Sources: Sonatype State of the Software Supply Chain (2022–2026), Cybersecurity Ventures (2024), Gartner (2024), IBM Cost of a Data Breach (2025). Package counts are cumulative totals since 2019. Cost projections based on 15% YoY growth.

OWASP ranked Software Supply Chain Failures as the third most critical web application security risk in its 2025 Top 10, and half of the community survey respondents ranked it first.2 The probability of any single package in a graph of 1,200 nodes being compromised is low. The probability of none of them being compromised is lower.

04 AI steepens the curve

The industry narrative is that artificial intelligence will save defenders. The data from 2025 and 2026 says it is saving attackers faster.

This matters to the long tail argument specifically, not just to cybersecurity in general. AI does not change the shape of the dependency curve. It steepens it. It makes the tail longer on the attack side and no shorter on the defence side. Three capabilities explain why.

AI scales the creation of malicious surface area. Sonatype's own count makes the point without needing a vendor's threat-research headline: roughly 89% of 2025's malicious packages were published in the final quarter alone.6 That is not a campaign. That is a production line, and no human-paced operation produces that curve. The barrier to manufacturing the tail has collapsed.

AI enables precision social engineering against maintainers. A controlled field experiment presented at USENIX Security 2026, run across 7,741 participants, found that personalised AI-generated phishing achieved 2.4 times the click rate of generic phishing, at a cost of roughly three cents per message — and the authors call that a conservative estimate, because they used simple locally-run models against participants who had already had security training.11 Compare the economics. Event-stream in 2018 required a human to build trust with Dominic Tarr over a period of weeks. The Axios compromise in March 2026 needed a maintainer account and nothing else. Personalised, convincing, targeted social engineering now costs less than a stamp, and every solo maintainer in the tail has a public email address.

AI powers autonomous propagation. Shai-Hulud's worm behaviour — compromising a package, finding tokens, publishing malicious versions of other packages — is exactly the kind of sequential, adaptive task that agentic AI excels at. The next Shai-Hulud will not need human orchestration at all.

The defender's AI can only monitor the dependencies it knows about. The attacker's AI can generate, compromise, and propagate through the ones it doesn't.

The asymmetry is structural, not temporary. A study led from Johannes Kepler University Linz ran autonomous AI agents across 23 attack/defence CTF battlegrounds.1 Defensive agents achieved 54.3% unconstrained patching success against 28.3% offensive initial access — an apparent defender advantage. Tighten the definition of success and it evaporates: 23.9% when the patch must also preserve availability, and 15.2% when it must additionally keep the attacker out. The authors are blunt about what that means — the 39.1-point gap between basic patching and complete defence "indicates that apparent defensive superiority may result from unrealistic assessment criteria." Once defence is scored operationally, no statistically significant advantage remains. The World Economic Forum's Global Cybersecurity Outlook 2026 — 804 respondents across 92 countries — found 87% identifying AI-related vulnerabilities as the fastest-growing cyber risk of 2025.9

Defence, meanwhile, has mostly bolted a chatbot onto the SOC. The gap is not that defenders lack AI. It is that attackers are using it to manufacture surface area faster than defenders can read it.

AI does not close the long tail. It makes the tail grow faster than any scanner can read it.

05 The additive trap

Every solution the security industry has offered to the supply chain problem is additive. Add Snyk. Add Dependabot. Add SBOM tooling. Add SCA scanning. Add Sonatype Repository Firewall. Add Trivy to your CI pipeline. Each of these is itself software, with its own dependencies, its own attack surface, its own maintainer accounts, its own update cycle.

The response to the long tail has been to make the tail longer.

In February–March 2026, the TeamPCP group systematically compromised Trivy and KICS — vulnerability scanners — along with LiteLLM, an AI gateway library. The exact tools organisations bolt onto CI pipelines to detect malicious dependencies became the attack vector. The defenders' telescope was in the tail all along.

This is not a failure of any particular vendor. It is a structural failure of the additive model. When your defence against compromised dependencies is itself a dependency, you have added a node to the graph you are trying to shrink. When your scanner has transitive dependencies of its own — and it does — each of those is another package that can be poisoned, another maintainer who can be phished, another post-install script that can execute in your build environment.

The incentives make this worse. The security industry is a market. Markets grow by selling product. Every vendor's revenue model depends on your problem being large enough, persistent enough, and frightening enough to justify a subscription. Nobody in that market has a commercial incentive to tell you to use fewer dependencies. The advice that would most reduce your attack surface — write less code, import less code, depend on fewer strangers — is advice that shrinks the addressable market for the people selling you protection. So instead you get dashboards. You get scanners. You get more software to protect you from software.

Even Chainguard — whose entire brand is built on minimal container images and attack surface reduction — put it well in their own 2026 analysis: "the smart move is to eliminate entire categories of vulnerability, freeing up teams to focus on the remaining areas." Correct. Now note what they are selling you: a product. A product you add to your pipeline to make your containers smaller. The company preaching reduction is running an additive business model. Their own words are a better argument against the industry's approach than anything a critic could write. When even the vendors who understand the problem can only monetise it by giving you another tool to install, the structural incentive is laid bare.

The additive model assumes the graph is a given and the solution is visibility. More monitoring. More scanning. More tools. But visibility is not control, and monitoring the tail does not shorten it. You cannot telescope your way out of a problem caused by the length of the thing you are looking at.

06 The case for dependencies

Before arguing for reduction, it is honest to argue the other side. Dependencies exist for good reasons, and a blanket rejection of them is not serious engineering — it is nostalgia dressed as security.

Cryptography is the obvious case. Rolling your own TLS implementation is not reductive security. It is recklessness. The Go standard library ships crypto/tls and crypto/aes precisely because these are problems that should be solved once, correctly, by specialists, and reused by everyone else. The same principle applies to image decoding, compression, and any domain where subtle implementation errors create exploitable vulnerabilities. Using a well-audited, widely-deployed library for these tasks is strictly safer than writing your own.

There is also a workforce reality. Not every team has the depth to reimplement what a mature library provides. A four-person startup building a SaaS product cannot write their own HTTP framework from scratch and still ship. Dependencies let small teams punch above their weight. That leverage is real and valuable.

And even the standard library argument has a crack in it. Go's stdlib is itself a massive dependency maintained by a single organisation — Google. If Google's build infrastructure were compromised, the blast radius would dwarf any npm incident. The stdlib is not zero dependencies. It is one very large, very trusted dependency. The risk is concentrated rather than distributed, which is a different profile, not the absence of risk.

The goal of reductive security is not zero dependencies. It is the minimum dependencies necessary, each one chosen deliberately, each one auditable, each one carrying its weight.

The distinction is between dependencies as a considered engineering decision and dependencies as accumulated habit. Between importing a cryptographic library because the domain demands it and importing a left-pad utility because npm install is easier than writing four lines of code. Between a dependency tree you can draw on a whiteboard and one that requires specialised tooling to visualise.

Dependencies are not the enemy. Uncontrolled dependencies are the enemy. The long tail is not built from the thirty packages you chose carefully. It is built from the 1,170 that came along for the ride.

So the question is not whether to use dependencies. It is how many, chosen how carefully, controlled how tightly. And that question has a name.

07 Reductive security

The security industry has spent two decades selling additive solutions to a problem caused by addition. Reductive security is the counter-position: the deliberate, architectural elimination of attack surface rather than the addition of monitoring for it.

The foundational axiom is simple. All code carries risk. Every line is a liability. Every dependency is a bet on the honesty, competence, and continued attention of a stranger. Every tool you add to watch that bet is another bet. Reductive security asks: what if we placed fewer bets instead of hiring more people to watch them?

Consider the difference in practice. A typical Go web service — HTTP API, database, structured logging — has three or four dependencies total. The Go standard library ships HTTP servers, TLS, JSON parsing, HTML templating, testing and profiling out of the box, and a driver-agnostic SQL interface in database/sql that you pair with one driver. A service built on the stdlib and that driver has a dependency graph you can hold in your head. You can read every line of third-party code in your project in an afternoon. No packages to install at build time. No maintainer accounts to phish. No post-install scripts to execute. No transitive graph to traverse. The attack surface is the runtime and your code. Two things. Both auditable. The binary that comes out the other end is a single static file. You deploy it. It runs. There is no supply chain to attack at deployment time, no dependency resolution in production, no node_modules folder for a worm to crawl through. What you built is what you run.

Now place that next to the alternatives. Django — one of the most mature and security-conscious web frameworks in existence — ships with three direct dependencies: asgiref, sqlparse, and tzdata on Windows. A typical Go web service has three or four. The average JavaScript project on GitHub pulls in 683 transitive dependencies from roughly ten direct ones — and that figure is from 2020.4

Notice that Django and the Go service land in the same place. That is the more useful observation, because it rules out the lazy reading of this argument. This is not Go being virtuous and Python being profligate — a batteries-included Python framework with two decades of production use arrives at the same number as a Go service written against the stdlib. Lean dependency graphs are achievable in any ecosystem. They are a function of culture and taste, not of language.

Which leaves one outlier, and it is an order of magnitude away from everything else. That is not a spectrum of capability — Django and Express and a Go stdlib service can all build the same product. It is a spectrum of philosophy. One end treats dependencies as free. The other treats them as debt that accrues interest. The distance between three dependencies and 683 is not a technical decision. It is the long tail, measured in packages.

The word "reductive" does real work here. It positions against the industry assumption that security is always additive — that the answer to a growing attack surface is more scanning, more monitoring, more tools. The reductive position is that every scanner you add is code you must trust, every monitoring agent is a process that can be subverted, and every SBOM generator is itself a dependency in your pipeline. The only tool that cannot be compromised is one you did not install.

08 What this looks like in practice

Reductive security is a design philosophy, but it has to survive contact with a codebase. These are the decisions where it becomes real.

Before introducing a dependency, ask what it brings and what it costs. Assess its maintainer count, commit frequency, and transitive tree. If you need one function from a library that brings sixty packages with it, write the function. Six lines of code you understand will always be more secure than six hundred lines you have never read.

Pin exact versions and commit your lockfile. Semantic versioning is a social contract, not a security guarantee. A caret range like ^3.3.5 is what allowed event-stream's malicious 3.3.6 to silently propagate to every project that depended on it. Treat npm install in CI as a code smell — use npm ci, which fails if the lockfile does not match. Better yet, vendor your dependencies: copy the source into your repository, audit it, and remove the live fetch from your build entirely. You trade convenience for control. In a regulated environment, that trade is not even close.

Disable post-install scripts by default. Many supply chain attacks — including both Shai-Hulud campaigns — execute during the install phase, before your application runs a single line of its own code. Allowlist only the packages that genuinely need lifecycle hooks. Everything else runs silent.

Finally, treat dependency count as a metric. Track it. Report it. Set a ceiling. When someone proposes adding a package, the question is not "does this save time?" It is "is the time saved worth the perpetual security exposure?" The answer is sometimes yes. It should never be unasked.


The long tail of software security is not a metaphor. It is a measurable, documented, accelerating reality. 1,200 dependencies per project. over 454,600 malicious packages published in a single year. 30% of breaches involving third parties. A projected global cost of $60 billion for 2025, climbing to $138 billion by 2031.5 Self-propagating worms traversing dependency graphs. Nation-state actors treating npm as strategic infrastructure. AI amplifying every one of these trends faster on the attack side than the defence side.

The industry response has been additive: more tools, more scanners, more monitoring. Those tools are themselves dependencies. They have been compromised. They will be compromised again.

Reductive security is not a rejection of open source or of dependencies. It is the recognition that every dependency is a decision with security consequences, and that most dependency graphs are not the result of decisions at all — they are the accumulated residue of convenience. The answer is not zero dependencies. It is fewer, chosen deliberately, each one earning its place, each one auditable by the team that depends on it.

Every dependency you do not take is a mass compromise you will never be part of. Every line of code you do not import is a maintainer account that cannot be phished to reach you. Every tool you do not add to your pipeline is a tool that cannot be turned against you.

The long tail of software security is not a problem to be managed. It is a problem to be shortened. The shortest tail is no tail at all.

References

  1. Balassone, F., Mayoral-Vilches, V., Rass, S., Pinzger, M., Perrone, G., Romano, S. P., Schartner, P. "Cybersecurity AI: Evaluating Agentic Cybersecurity in Attack/Defense CTFs," arXiv:2510.17521, October 2025. 23 Attack/Defense CTF battlegrounds; 54.3% unconstrained patching, 23.9% operational defence, 15.2% complete defence, 28.3% offensive initial access. arxiv.org
  2. OWASP. Top 10:2025 — A03 Software Supply Chain Failures. Highest average incidence rate in the contributed data at 5.19%; ranked first by 50% of community survey respondents. owasp.org
  3. CISA. "Widespread Supply Chain Compromise Impacting npm Ecosystem," alert issued 23 September 2025, covering 500+ affected packages. The second wave (Shai-Hulud 2.0) followed in late November 2025. cisa.gov
  4. GitHub. The State of the Octoverse 2020. A JavaScript project with a median of ten direct dependencies pulls in an average of 683 transitive dependencies. Figure is from 2020 and is included here for scale rather than currency. octoverse.github.com
  5. Cybersecurity Ventures. "Software Supply Chain Attacks To Cost The World $60 Billion By 2025." A projection based on 15% year-on-year growth from $46 billion in 2023, reaching $138 billion by 2031 — not a measured figure. cybersecurityventures.com
  6. Sonatype. State of the Software Supply Chain, 2026 edition. Over 1.233 million malicious packages catalogued since 2019; more than 454,600 published during 2025 across npm, PyPI, Maven Central, NuGet and Hugging Face, with roughly 89% of the year's total logged in Q4. sonatype.com
  7. Black Duck. 2025 Open Source Security and Risk Analysis (OSSRA) Report. Based on 1,658 audits of 965 commercial codebases across 16 industries during 2024: average project exceeds 1,200 dependencies, a 30% year-on-year increase; 64% of open source components found were transitive. blackduck.com
  8. npm. "Details about the event-stream incident," November 2018; and Snyk, "Malicious code found in npm package event-stream downloaded 8 million times in the past 2.5 months." Package took ~2 million downloads weekly; malicious flatmap-stream introduced in v3.3.6 on 9 September 2018, discovered 20 November. blog.npmjs.org · snyk.io
  9. World Economic Forum, in collaboration with Accenture. Global Cybersecurity Outlook 2026, January 2026. 804 qualified respondents across 92 countries, including 316 CISOs. weforum.org
  10. Verizon. 2025 Data Breach Investigations Report. 22,052 incidents and 12,195 confirmed breaches across 139 countries, 1 November 2023 – 31 October 2024. Third-party involvement in breaches doubled from 15% to 30%. verizon.com
  11. Czybik, S. et al. "A Large-Scale Study of Personalized Phishing using Large Language Models," USENIX Security Symposium 2026. BIFOLD/TU Berlin, Inria and Ruhr University Bochum; controlled field experiment across 7,741 participants. Personalised AI-generated phishing achieved 2.4× the click rate of generic phishing at roughly $0.03 per message. usenix.org
  12. IBM. Cost of a Data Breach Report 2025. Supply chain compromise accounted for 15% of breaches at an average cost of $4.91m — the second most expensive vector — and took 267 days on average to identify and contain, the longest of any vector measured. ibm.com
  13. Ivanti. State of Cybersecurity Report 2025. Just one in three organisations feel prepared to defend against software supply chain threats; 84% of leaders call monitoring the software supply chain "very important", while 48% have not identified the most vulnerable components in their own. ivanti.com