How 11 Lines of Code Broke the Internet

How 11 Lines of Code Broke the Internet

Aug 16, 2025

On March 22, 2016, a single developer's decision to remove an 11-line JavaScript package brought down major websites and services worldwide for 2.5 hours, including Facebook, Netflix, Spotify, and countless other companies [1]. The left-pad incident remains one of the most significant supply chain failures in software history, exposing fundamental vulnerabilities in how modern applications handle dependencies and sparking ongoing debates about the philosophy of software development itself.

The scale of disruption was staggering: within minutes of the package's removal, NPM observed "hundreds of failures per minute" as build systems worldwide collapsed [2]. What made this particularly shocking was that most affected companies had never heard of left-pad—they were brought down by a transitive dependency buried deep in their dependency trees [3]. This incident fundamentally changed how the industry thinks about software supply chains, leading to new policies, tools, and practices that developers still rely on today.

The story began with a trademark dispute between developer Azer Koçulu and messaging company Kik Interactive, but it revealed much deeper issues about open source governance, corporate influence in developer communities, and the sustainability of volunteer-maintained digital infrastructure [4]. The aftermath sparked a philosophical war in the JavaScript community about whether developers should rely on micro-dependencies or write basic functions themselves—a debate that continues to influence development practices nearly a decade later [5].

image

The trademark dispute that started it all

The crisis originated from what seemed like a routine trademark dispute. Azer Koçulu, an independent programmer in Oakland who had published 273 packages to NPM following Unix philosophy principles, owned a package called "kik"—a development bootstrapping tool [2]. In March 2016, Kik Interactive, the Canadian messaging company with over 200 million users, contacted Koçulu about his package name.

Bob Stratton, a patent and trademark agent representing Kik, sent an initial email asking Koçulu to rename his package, citing trademark concerns. The tone of the correspondence quickly deteriorated. Kik's message stated: "We don't mean to be a dick about it, but it's a registered Trademark in most countries around the world and if you actually release an open source project called kik, our trademark lawyers are going to be banging on your door and taking down your accounts and stuff like that."

Koçulu's response was blunt: "hahah, you're actually being a dick. so, fuck you. don't e-mail me back." When Kik offered $30,000 compensation for Azer to change the package name, he refused.

After the failed negotiation, Stratton contacted NPM directly. On March 18, 2016, Isaac Z. Schlueter, CEO of NPM, made the controversial decision to transfer ownership of the "kik" package to Kik Interactive without Koçulu's permission [2]. NPM justified this under their package name dispute resolution policy, arguing that users would expect "kik" to be related to the messaging app rather than an obscure development tool.

Koçulu was devastated by NPM's decision. He wrote to Schlueter: "I'm very disappointed with your decision here. I know you for years and would never imagine you siding with corporate patent lawyers threatening open source contributors." Feeling betrayed by a platform he had trusted, Koçulu stated he no longer wished to be part of the NPM ecosystem. Schlueter then provided Koçulu with a command script to delete all 273 of his registered modules.

The 11 lines of code that ruled the web

Among Koçulu's 273 packages was left-pad, a seemingly trivial utility that had become embedded in the foundation of the modern web. The package contained just 11 lines of actual code:

javascript

module.exports = leftpad;function leftpad (str, len, ch) {  str = String(str);  var i = -1;  if (!ch && ch !== 0) ch = ' ';  len = len - str.length;  while (++i < len) {    str = ch + str;  }  return str;}

This simple function prepended characters to strings—adding zeros to the beginning of zip codes, for example. Despite its simplicity, left-pad had over 15 million downloads and was a dependency for critical JavaScript ecosystem projects including Babel, Webpack, React, and React Native [3].

The package exemplified the JavaScript community's embrace of "micro-dependencies"—tiny packages that performed single functions. Most projects didn't depend on left-pad directly but inherited it through complex dependency chains. The line-numbers package, for instance, specifically required left-pad version 0.0.3, and line-numbers was used by Babel, which was used by countless web applications.

This dependency tree created a single point of failure that most developers were completely unaware of. Companies running sophisticated web applications with thousands of dependencies had no idea that their entire tech stack could be brought down by the removal of an 11-line utility package.

Two and a half hours that shook the web

On March 22, 2016, at around 2:30 PM Pacific Time, Koçulu executed the deletion script from his desk at Jelly in San Francisco's Presidio building [3]. All 273 of his packages vanished from NPM instantly, including left-pad version 0.0.3.

Within minutes, the internet began breaking. NPM started observing "hundreds of failures per minute" as dependent projects failed when requesting the now-unpublished package [2]. Build systems worldwide collapsed with the same error message:

npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/left-pad
npm ERR! 404 'left-pad' is not in the npm registry.
npm ERR! 404 It was specified as a dependency of 'line-numbers'

The impact was immediate and brutal. Facebook's React framework became unbuildable. Netflix, Spotify, PayPal, Airbnb, and The New York Times all experienced infrastructure failures. Even Kik Interactive—the company whose trademark dispute had started the crisis—found their own developers unable to build their applications.

The pattern of failure was consistent across all affected companies: any project that tried to do a fresh install or build from scratch would fail because the dependency chain couldn't be resolved. Continuous integration servers worldwide ground to a halt. New development environment setup became impossible. Production deployments failed.

Within 10 minutes, community member Cameron Westland stepped in and published a functionally identical version of left-pad. However, he published it as version 1.0.0, while the broken dependency chains specifically required version 0.0.3. The problem persisted.

By this time, Koçulu had stepped away from his desk for a few minutes. When he returned, his friend told him he was trending on Twitter. He quickly published his blog post "I've Just Liberated My Modules," explaining his actions: "This situation made me realize that NPM is someone's private land where corporate is more powerful than the people, and I do open source because, Power To The People."

NPM's unprecedented emergency response

Faced with a crisis that was literally breaking the internet, NPM took the unprecedented step of restoring a deleted package from backup—something previously considered impossible. At 4:05 PM Pacific, they announced their plan to "un-un-publish" left-pad version 0.0.3. By 4:55 PM, they had completed the restoration using backup data.

The total disruption lasted 2.5 hours, but the impact reverberated for years.

Laurie Voss, NPM's CTO, defended the emergency action: "Even within npm we're not unanimous that this was the right call, but I cannot see hundreds of builds failing every second and not fix it." The restoration put "the wider interests of the community of NPM users at odds with the wishes of one author"—NPM chose to prioritize ecosystem stability over individual developer rights.

The incident forced NPM to implement immediate policy changes. Within a week, they announced that packages older than 24 hours could no longer be unpublished if other projects depended on them [6]. They also implemented a security placeholder system to prevent malicious actors from immediately claiming abandoned package names.

How NPM transformed their policies to prevent future left-pad incidents

The left-pad crisis forced NPM to fundamentally rethink their approach to package management and implement sweeping policy changes that remain in effect today. These changes represent one of the most comprehensive overhauls of a package registry in response to a single incident.

The 24-hour unpublish rule became NPM's most significant policy change [6]. Previously, package authors could unpublish their packages at any time for any reason. The new policy states that packages cannot be unpublished if they are older than 24 hours and have other packages depending on them. This "cooling off" period allows developers to remove packages they've just published by mistake while preventing the ecosystem disruption that occurred with left-pad.

Enhanced dependency protection was implemented through multiple mechanisms. NPM introduced "security placeholders" that prevent bad actors from immediately claiming package names after legitimate packages are removed [6]. When a popular package is unpublished, NPM now reserves the name and redirects downloads to prevent supply chain attacks.

Improved dispute resolution processes were established to handle trademark and naming conflicts more fairly. After criticism over the Kik decision, NPM created clearer guidelines for resolving disputes and established appeal processes for authors who disagree with NPM's decisions [2].

Package restoration capabilities were formalized. While NPM had always maintained backups, the left-pad incident forced them to create official procedures for restoring packages in emergency situations. They can now quickly restore packages that cause widespread ecosystem disruption, though this power is used sparingly [2].

Enhanced package security measures include automated malware scanning, suspicious activity detection, and two-factor authentication requirements for high-impact packages. NPM now requires maintainers of popular packages to enable 2FA, reducing the risk of account takeovers that could lead to malicious package updates [7].

Dependency impact analysis tools were developed to help NPM understand the potential consequences of package removals. They can now quickly assess how many projects would be affected by a package's removal, allowing for better decision-making in crisis situations [8].

These policy changes have been largely successful in preventing similar incidents. While there have been other supply chain security issues in the JavaScript ecosystem, none have approached the scale and impact of the left-pad crisis.

The great dependency philosophy war

The left-pad incident sparked a philosophical war in the JavaScript community that continues today. The debate centers on fundamental questions about how software should be built: Should developers rely on external packages for simple functionality, or should they write basic functions themselves?

Critics of micro-dependencies argued that the incident exposed a dangerous culture of over-reliance on external code. David Haney's influential blog post "Have We Forgotten How To Program?" captured this sentiment, criticizing developers who created "hundreds of dependencies and 28,000 files for a blank project template" [5]. He argued that "stringing APIs together and calling it programming doesn't make it programming."

The anti-dependency camp pointed to the absurdity of the situation: major tech companies brought down by 11 lines of code they could have written themselves in seconds. They advocated for self-reliance and warned that developers were losing fundamental programming skills.

Defenders of the micro-dependency philosophy countered that code reuse promotes collaboration, reduces duplication, and allows developers to focus on higher-level problems. They argued that the issue wasn't the existence of small packages but the lack of proper dependency management tools and practices.

This philosophical divide reflects deeper tensions in software development between modularity and self-sufficiency, collaboration and control, and the Unix philosophy of "do one thing well" versus monolithic approaches.

The technical solutions that emerged

The left-pad crisis catalyzed the development of sophisticated dependency management tools that are now standard practice in the JavaScript ecosystem.

Package lock files became universal. NPM's package-lock.json, introduced in npm 5, automatically generates deterministic dependency trees with exact versions and integrity checksums [9]. Yarn's equivalent yarn.lock provides similar functionality. These files ensure that the same dependency tree is installed across all environments, preventing left-pad-style surprises.

Private NPM registries gained widespread adoption among enterprises [10]. Tools like Verdaccio, Sonatype Nexus, JFrog Artifactory, and GitHub Packages allow companies to proxy public packages through their own registries, providing protection against package unpublishing and enabling security policy enforcement.

Automated dependency management tools proliferated. Dependabot, now built into GitHub, automatically creates pull requests for dependency updates and prioritizes security vulnerabilities [11]. Renovate Bot provides highly configurable dependency automation across multiple platforms. These tools help teams stay current with dependencies while maintaining control over the update process.

Security scanning became standard practice. Services like Snyk, npm audit, and GitHub security advisories automatically identify vulnerabilities in dependency chains [12]. Companies now implement mandatory security scanning as part of their CI/CD pipelines.

Other packages that could break the internet

The left-pad incident revealed that numerous other simple packages pose similar risks. Research shows that the JavaScript ecosystem contains hundreds of micro-dependencies with massive download numbers:

is-array receives 880,000 downloads per day despite containing just one line of code that checks if a value is an array. is-number, trim, is-even, and pad-left are similarly simple utilities with millions of downloads each. The package is-positive-integer, containing just 4 lines of code, initially had 3 dependencies of its own—a perfect example of dependency chain complexity.

These packages demonstrate the continued prevalence of micro-dependency culture in JavaScript. While they provide convenient functionality, each represents a potential single point of failure that could theoretically repeat the left-pad scenario.

The key difference today is that the ecosystem has learned from left-pad. Package lock files, private registries, and improved NPM policies make similar incidents less likely to cause widespread disruption. However, the fundamental vulnerability remains: modern applications depend on thousands of packages maintained by volunteers.

Lessons for JavaScript developers today

The left-pad incident offers several actionable lessons for modern JavaScript developers:

Implement comprehensive dependency management. Always use package lock files and commit them to version control. Use npm ci in production for deterministic builds. Regularly audit dependencies with npm audit and remove unused packages.

Consider the trade-offs of micro-dependencies. While there's nothing inherently wrong with small packages, evaluate whether a dependency is worth the risk. For simple functions like left-pad, consider writing your own implementation or using well-established libraries with multiple maintainers.

Understand your dependency tree. Tools like npm ls and bundle analyzers help visualize what your applications actually depend on. Pay special attention to packages with millions of downloads but minimal maintenance.

Implement security practices. Use automated security scanning, pin critical dependency versions, and establish processes for evaluating new dependencies. Consider private registries for critical applications.

Support the ecosystem. The left-pad incident highlighted how volunteer-maintained packages support massive commercial infrastructure. Consider contributing back to packages you depend on through code, documentation, or funding.

The lasting impact on open source governance

Beyond technical solutions, the left-pad incident fundamentally changed how the industry thinks about open source governance and sustainability. The incident demonstrated what researchers call the "tragedy of the commons" in digital infrastructure—critical resources that are free to use but under-maintained and under-funded.

The incident influenced policy changes across package management ecosystems. PyPI, RubyGems, and other registries examined their own unpublishing policies. Academic researchers began studying software supply chain security more seriously, with left-pad becoming a standard case study.

The sustainability movement gained momentum. Initiatives like the Open Source Sustainability Fund, GitHub's Secure Open Source Fund, and corporate open source program offices emerged partly in response to incidents like left-pad. The Ford Foundation's "Roads and Bridges" report, which framed open source software as critical digital infrastructure requiring institutional support, was directly influenced by the left-pad crisis.

The incident also highlighted the power dynamics in open source communities. NPM's decision to side with Kik Interactive in the trademark dispute sparked ongoing debates about corporate influence in developer communities and the balance between commercial interests and developer autonomy.

A cautionary tale for the connected age

The left-pad incident remains relevant nearly a decade later because it revealed fundamental tensions in how we build and maintain software systems. It showed that in our interconnected digital world, even the smallest components can have outsized impacts.

The incident teaches us that convenience comes with hidden costs. The ease of adding dependencies to JavaScript projects masks the complexity and risk of the resulting dependency trees. Modern applications routinely depend on thousands of packages, most of which developers have never examined.

It also demonstrates the fragility of volunteer-maintained infrastructure. Much of the software that powers the modern economy depends on packages maintained by individual volunteers in their spare time. This creates systemic risks that the industry is still learning to address.

Most importantly, the left-pad incident shows that technical problems often have social and economic roots. The crisis wasn't ultimately about code—it was about governance, sustainability, power dynamics, and the tension between individual autonomy and collective stability [13].

As software systems become increasingly complex and interconnected, the lessons of left-pad remain essential. The incident serves as a permanent reminder that in the world of software dependencies, there are no small changes—only small understanding of large systems [14]. Understanding these systems, managing their risks, and supporting their maintenance isn't just good engineering practice—it's critical infrastructure for the digital age.

🚀 Join the Developer Universe

Ready to level up your React game? Connect with me across the digital cosmos where I share cutting-edge insights, exclusive tutorials, and behind-the-scenes development magic:

🎥 YouTube (English) → Subscribe for next-gen tutorials
Deep-dive video content, live coding sessions, and framework comparisons in english language

🎥 YouTube (Bangla) → Subscribe for next-gen tutorials
Deep-dive video content, live coding sessions, and framework comparisons

⚡ GitHub → Explore the code universe
Open-source projects, starter templates, and collaborative experiments

💼 LinkedIn → Network in the professional sphere
Career insights, industry trends, and professional development

🌐 X (Twitter) → Real-time dev insights
Quick tips, hot takes, and lightning-fast industry updates

📱 Facebook → Community central hub
Extended discussions, community polls, and collaborative learning

☕ Buy Me a Coffee → Fuel the code machine
Support exclusive content creation and unlock premium resources

💫 What You'll Get

  • ⚡ Early access to new tutorials and frameworks

  • 🔥 Exclusive code snippets and project templates

  • 🎯 Direct Q&A on complex development challenges

  • 🚀 Beta previews of upcoming content and projects

Spotted a bug in the matrix or have innovative ideas? Ping me on any channel above - the future of web development is collaborative!

References

  1. npm left-pad incident - Wikipedia

  2. kik, left-pad, and npm - NPM Blog

  3. How one programmer broke the internet by deleting a tiny piece of code - Quartz

  4. How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript - The Register

  5. NPM & left-pad: Have We Forgotten How To Program? - David Haney

  6. changes to npm's unpublish policy - NPM Blog

  7. npm Package Security: Protect Your Dependencies Easily - DhiWise

  8. What measures have been taken to prevent something like the left-pad incident happening again? - Stack Overflow

  9. npm Shrinkwrap reloaded: Locking npm Deps with Package-Lock and Yarn.Lock - Snyk

  10. How to Set Up a Private NPM Registry - GeeksforGeeks

  11. Automating Dependabot with our GitHub app - Nearform

  12. Auditing package dependencies for security vulnerabilities - npm Docs

  13. The Tragedy of the Commons and Open Source Software - A Modern Parallel - Open Mainframe Project

  14. Roads and Bridges: The Unseen Labor Behind Our Digital Infrastructure - Ford Foundation

Подобається цей допис?

Купити для Noor Mohammad каву

Більше від Noor Mohammad

КонфіденційністьУмовиПоскаржитись