A recent supply chain attack targeting the popular @ctrl/tinycolor package has sparked intense debate about the security of automated publishing workflows in the JavaScript ecosystem. The incident, which affected 20 packages including one downloaded 2 million times weekly, has exposed fundamental weaknesses in how developers manage publishing credentials across shared repositories.
The Hidden Danger of Shared Repository Tokens
The attack didn't target the main package repository directly. Instead, it exploited a forgotten NPM token stored in a shared GitHub repository called angulartics2, where multiple developers had admin access. A malicious workflow was pushed to this repository, immediately stealing the token and using it to publish compromised versions of unrelated packages. This highlights a critical oversight in how developers manage credentials across collaborative projects.
The community response has been swift but divided on solutions. Many developers are questioning whether the convenience of automated publishing is worth the security risks it introduces.
The Great Automation Debate
The incident has reignited discussions about whether automated publishing should be the default approach for package management. Some community members argue that manual publishing with two-factor authentication would have prevented this attack entirely. The reasoning is simple: most NPM packages don't update frequently enough to justify the security risks of automated workflows.
However, others point to the practical benefits of automation, including consistent builds and reduced human error. The challenge lies in finding a middle ground that maintains security without sacrificing the reliability that automated systems provide.
![]() |
|---|
| The ongoing debate around automated publishing versus manual processes for package management raises crucial security questions |
Proposed Security Improvements
Several technical solutions have emerged from community discussions. The most promising involves separating package uploading from publishing - allowing automated systems to build and upload packages while requiring human approval for final publication. This two-phase approach would maintain automation benefits while adding a crucial human checkpoint.
Publishing the uploaded packages should require a human to log into npmjs's website & manually publish the package and go through MFA.
Another suggested improvement involves implementing time delays or requiring multiple approvers for sensitive operations, similar to security practices used in critical infrastructure systems.
The Token Problem and OIDC Solutions
The attack has highlighted fundamental issues with long-lived authentication tokens. These tokens act essentially as permanent passwords that can be stolen and misused. The community is pushing for wider adoption of Trusted Publishing using OpenID Connect (OIDC), which generates short-lived tokens valid for only 15 minutes.
While OIDC support exists for NPM, integration with popular tools like semantic-release remains incomplete. This gap between security best practices and practical tooling continues to leave developers vulnerable to similar attacks.
Lessons for the Broader Ecosystem
This incident serves as a wake-up call for the entire JavaScript ecosystem. The attack succeeded not through sophisticated hacking, but by exploiting basic security oversights - forgotten tokens in shared repositories and overly permissive access controls. It demonstrates how past collaboration decisions can create unexpected attack vectors years later.
The rapid response from GitHub and NPM security teams, who quickly identified and removed malicious packages, shows that detection and response systems are improving. However, the fundamental challenge remains: preventing these attacks from succeeding in the first place.
The incident underscores the need for better security defaults in package management systems, clearer guidance on credential management, and tools that make secure practices as convenient as current insecure ones. Until these improvements are implemented, similar attacks will likely continue to plague the JavaScript ecosystem.

