Security / Supply chain
Shai-Hulud 2.0: when an attack enters the application through a package
The attack on PostHog npm packages in November 2025 showed the risk of CI permissions and tokens. How do you protect the supply chain of your own software?
Your own code is only part of the application. A project uses libraries, tools, a build process and access to a package registry. An attack can enter through any of these links and affect even a well-written website.
What PostHog described
According to PostHog's postmortem, compromised JavaScript packages containing Shai-Hulud 2.0 were published on npm on 24 November 2025. The malware searched for credentials and used the permissions it obtained to spread. The company linked the initial intrusion to a CI workflow that ran untrusted code with access to a privileged token. The scope did not automatically affect all forms of PostHog integration. First-party postmortem.
The development environment is no less important than production
A developer's computer or the CI may hold access to repositories, the package registry or cloud services. If an untrusted process gets hold of them, the impact can extend beyond a single application.
When checking, therefore, look not only at the deployed website but also at how the code is built and published. What matters is which jobs receive secrets and under what conditions an outside contribution is run in them.
What a company should check
- The scope and lifetime of CI/CD, npm and cloud tokens.
- Separation of untrusted contributions from privileged publishing jobs.
- The origin of dependencies, change review and how updates are approved.
- Rules for install scripts and handling of security alerts.
- A procedure for revoking and rotating access in case of compromise.
Why removing a package may not close the incident
If credentials may already have leaked, their use and scope need to be assessed. Simply returning to a clean version of the application may not revoke a permission the attacker still has.
The response therefore includes an inventory of affected environments, available event logs, revocation of risky tokens and verification of subsequent changes. The scope is determined by the specific investigation.
Where AI comes in
This postmortem in itself does not prove that the attack was driven by AI. When introducing AI development tools, however, it is important to keep the same rules for dependencies, secrets and publishing. Faster code creation does not reduce responsibility for its origin and deployment.
We can help review repositories, integration access and publishing processes within the agreed scope.
Sources and further reading
The links lead to the original announcements, reports and documentation the article is based on.