Protestware has emerged as a serious supply chain threat in open source ecosystems, where maintainers intentionally embed destructive or politically motivated code into libraries and packages.
Unlike conventional malware aimed at financial profit, protestware is driven by ideological, social, or political motives. It can delete or corrupt data, sabotage business processes, restrict users from specific regions, or spread unauthorized messages.
The risk is comparable to traditional vulnerabilities, repository compromises, and Dependency Confusion attacks because the malicious code often arrives through normal dependency updates.
Known Incidents
One prominent case involved the packages node-ipc and peacenotwar. The node-ipc library added peacenotwar as a dependency; the module checked the user’s IP via geolocation services and, if located in Russia or Belarus, replaced files on disk with heart symbols while creating a WITH-LOVE-FROM-AMERICA.txt file on the desktop.
Another incident affected the popular colors.js library. An infinite loop printing non-ASCII characters was introduced, causing denial of service for any CLI or server application that required the package.
The es5-ext package, used by webpack, contained logic that triggered 100% CPU usage in an infinite loop if the system time was between 22:00 and 06:00 or the locale was set to ru_RU.
Placement and Triggers
Malicious logic can reside in runtime code, npm lifecycle hooks, build scripts, test scripts, or package metadata that fetches instructions from remote servers. Activation conditions include IP geolocation, system locale, environment variables such as NODE_ENV, hostname, username, and specific dates or times.
Detection and Mitigation
Organizations can detect suspicious components through static analysis for geo-IP or file-deletion patterns, dynamic analysis in isolated sandboxes, and continuous monitoring of repository changes. Recommended controls include pinning dependency versions, maintaining an internal artifact repository with approval gates, signing artifacts, and following the NIST Secure Software Development Framework, SLSA levels, and OpenSSF Scorecard assessments.
