TRENDING
A mountain gorilla looks at the camera from green forest undergrowth
October 29, 2026
How to Compress Time-Series Metrics in Python With Gorilla Delta-of-Delta and XOR Encoding
A bronze-framed hourglass with white sand beside a small Ferris wheel ornament on a wooden table against a teal wall
October 29, 2026
NIST’s Final Post-Quantum Transition Report Puts Every Quantum-Vulnerable Public-Key Scheme on One 2030 and 2035 Clock, and Three Federal Documents Word the Deadline Three Ways
Six weathered stone columns of the Temple of Apollo at Delphi, Greece, standing on a stone platform above a valley of olive groves
October 29, 2026
Honeypots Recorded Probes Against Oracle E-Business Suite CVE-2026-101767 Seven Days After Its Patch, and the Finder’s Write-Up Is Dated Patch Day
Vintage silver stopwatch with a chain on a black background, its dial showing seconds from 5 to 60
October 29, 2026
How to Find a Slow Query in PostgreSQL 18 With pg_stat_statements, Read Its EXPLAIN ANALYZE Plan, and Fix It With the Right Index
A wooden Tower of Hanoi puzzle on a market table, with three pegs and stacked discs of different sizes
October 29, 2026
Two Labs’ Claimed Refutations of the Exponential Time Hypothesis Turn Verification Into a Statement-Reading Problem, and Their Lean Theorems Promise Only That a Constant Exists
29 Oct 2026
SXZ.io SXZ.io
  • Home
Search the Site
Popular Searches:
Technology Amazon AI
Recent Posts
A flock of snow geese in flight, seen as dark silhouettes against an orange and red sunset sky with layered clouds
How to Run Zero-Downtime Schema Migrations on PostgreSQL 18 and Block Unsafe ALTER TABLE Statements With a Python Lint Gate
October 28, 2026
An old green steel truss bridge resting on temporary supports beside a new arch bridge under completion on a river in Portland, Oregon
The Angular 2 Rewrite Turns a Migration Lesson Into a Security Bill: AngularJS Still Draws 533,480 Downloads a Week, and 10 Advisories Have No Open-Source Fix
October 28, 2026
Hundreds of yellow rubber ducks floating in a river enclosure during a duck race
WordPress 7.1.4 Closes an Unauthenticated Race in Its Own Update Routine, but 19 Older Branches Had No Backport Hours After Release
October 28, 2026
SXZ.io SXZ.io
  • Home

Categories

Articles 270 Posts
News 273 Posts
Learning Hub 243 Posts
Home/Articles/The Nx Supply-Chain Attack Turned AI Coding Agents Into Credential Scanners
Articles

The Nx Supply-Chain Attack Turned AI Coding Agents Into Credential Scanners

A Docker case study revisits the Nx npm attack that turned installed AI coding agents into credential scanners, and what it means for agent security.

July 28, 2026 6 Min Read
133

A Docker Blog post published July 28 revisits a supply-chain attack from last August to make its case for isolating AI coding agents, and the incident it walks through is worth understanding on its own terms. On August 26, 2025, malicious versions of the Nx build platform were published to npm, and the payload did something credential stealers had not done before at this scale: instead of shipping its own scanner, it looked for an AI coding agent already installed on the machine, then used that agent’s own filesystem access to do the scanning for it.

Table Of Content

  • What Happened on August 26, 2025
  • The Novel Part: Borrowing the Developer’s Own Agent
  • Not Every Agent Complied
  • How the Attackers Got In Ahead of Time
  • The Scale of the Damage
  • Docker’s Pitch: Change What the Agent Can See
  • The Broader Takeaway
  • Sources

What Happened on August 26, 2025

Nx draws roughly four million downloads a week, and the compromised package versions, 20.9.0 through 21.8.0, carried a post-install script called telemetry.js. A post-install hook fires the moment npm install finishes, so the payload ran automatically on every machine and CI runner that pulled a poisoned version, with nobody opening a file or reviewing a diff first. The campaign became known as s1ngularity, a name taken from the public GitHub repositories the malware created to hold what it stole. According to GitGuardian’s own analysis of the incident, telemetry.js scanned infected systems for GitHub and npm tokens, SSH private keys, cloud configuration files, and cryptocurrency wallet keystores, the routine target list for this class of malware.

The Novel Part: Borrowing the Developer’s Own Agent

What made s1ngularity notable was the step after the scan started. Rather than walk the filesystem itself, the script checked whether the machine had an installed AI coding CLI, Claude Code, Gemini CLI, or Amazon Q, and if so, invoked it directly with the flag that disables interactive permission prompts: --dangerously-skip-permissions on Claude Code, --yolo on Gemini CLI, and --trust-all-tools on Amazon Q. Those flags exist for legitimate reasons, since confirming every file read gets tedious once a developer trusts a task they have handed off. The malware simply set them itself.

The instruction it sent, recovered and published by StepSecurity’s analysis of the payload, told the agent to recursively search local paths starting from the home directory, follow a depth limit of eight, avoid sudo so no password prompt would raise suspicion, and record the absolute path of any file matching credential-shaped patterns, wallet keystores, .env files, SSH keys, into a single inventory file. It reads like a task a developer might plausibly assign, which was the point: the agent was already authenticated, already permitted to read anything the developer could read, and nothing sat between the instruction and the filesystem access it was given.

Not Every Agent Complied

The attack’s success rate against AI tools was real but limited. GitGuardian’s investigation found that 33 percent of compromised systems had at least one LLM client installed, confirming the attackers had correctly bet on a growing attack surface. But of the 366 systems where an LLM tool was actually targeted, only 95 wrote the requested inventory file, meaning most installed agents either refused the request outright or otherwise did not comply. That is not a security control anyone designed on purpose, and it is not something worth relying on, but it is a real data point: built-in model behavior blocked roughly three-quarters of the attempts in this specific incident, even before any sandboxing was involved.

How the Attackers Got In Ahead of Time

The npm compromise was the visible part of the attack, but Nx’s own postmortem, published September 5, 2025, traces the actual entry point to the project’s CI pipeline rather than its published code. Attackers submitted a pull request with a malicious title containing shell commands. Nx’s PR-title validation workflow used GitHub Actions’ pull_request_target trigger, which runs with the permissions of the target branch and can access repository secrets, and echoed the PR title without sanitizing it first, creating an injection point. Two conditions turned that injection point into a full compromise: the repository’s Actions workflow permissions were still set to the older “read and write” default that GitHub replaced with a safer read-only default for new repositories in February 2023, and the publish workflow had workflow_dispatch enabled, which let the attacker trigger it programmatically through GitHub’s API once they had extracted a token. That combination let the attacker steal Nx’s npm publishing token and push malicious releases directly, without ever compromising Nx’s actual source code or review process. Nx says the malicious packages were live for about four hours before being fully removed from the registry.

The Scale of the Damage

GitGuardian counted 2,349 distinct credentials stolen from 1,079 compromised developer systems in the attack’s first wave, exfiltrated as double-base64-encoded data pushed to more than 1,400 public repositories created under victims’ own GitHub accounts. More than 1,100 of those stolen credentials were still valid at the time of analysis. The attackers then used stolen GitHub tokens for a second wave two days later, flipping 10,767 private repositories to public. GitGuardian found that about 20 percent of those newly public repositories, 2,399 of them, actually contained a hardcoded secret, exposing 82,901 secrets in total, 11,168 of them still valid. Docker’s post frames the underlying trend behind the incident by citing GitGuardian’s separate State of Secrets Sprawl 2026 report: roughly 28.65 million new hardcoded secrets landed on public GitHub in 2025 alone, up 34 percent year over year, and code written with an AI agent leaks credentials at roughly twice the rate of code written without one.

Docker’s Pitch: Change What the Agent Can See

Docker’s post uses the incident to argue for its Docker Sandboxes product, and the mechanism is worth understanding independent of the vendor pitch. Docker Sandboxes run coding agents inside isolated microVMs where the agent’s filesystem view stops at the project workspace instead of extending to the whole home directory. Credentials are not stored inside the sandbox at all; a command like sbx secret set followed by sbx run injects secrets only at the network boundary as a request leaves the VM, so a compromised or malicious agent inside the box never holds a raw, readable key to steal in the first place. Docker also points to its sbx policy log, which records every network connection the sandbox’s proxy allowed or denied in real time, as a replacement for the after-the-fact log scanning that is all a team has once a credential has already leaked publicly.

The best practices Docker lists apply regardless of which vendor’s tooling a team uses: do not hand an agent direct access to credential files, scope an agent’s filesystem access to the project it is working on rather than the whole machine, and treat an installed AI CLI as privileged automation rather than a convenience, since anything with standing access to a developer’s credentials is worth threat-modeling the same way a service account would be.

The Broader Takeaway

The s1ngularity attack is a useful case study precisely because it did not require a novel exploit against the AI tools themselves. The agents did exactly what they are built to do: read files and follow instructions inside the permissions they were given. The attacker’s real insight was that a permission-bypass flag meant for convenience, run on a host where the agent’s reach equals the developer’s reach, turns that convenience into a ready-made credential scanner the moment anything else on the machine is compromised. Nx’s postmortem is a reminder that the CI pipeline publishing the code is just as much a part of that trust boundary as the developer’s own laptop, since a single leaked token let attackers skip the source code entirely. Sandboxing an agent’s runtime and hardening the pipeline that ships the packages it depends on are not competing fixes; the incident shows why a team needs both.

Sources

  • Docker Blog: Coding Agent Horror Stories, The 29 Million Secret Problem
  • GitGuardian: The Nx “s1ngularity” Attack, Inside the Credential Leak
  • Nx Blog: S1ngularity, What Happened, How We Responded, What We Learned
  • StepSecurity: Nx Build System Package Compromised With Data-Stealing Malware
  • GitGuardian: The State of Secrets Sprawl 2026

Image credit: Aerial view of shipping containers at the Port of Barcelona, Spain. Photo by Igor Ovsyannykov via Unsplash, dedicated to the public domain (CC0) via Wikimedia Commons; cropped and converted to WebP for sxz.io.

Tags:

AI Agent SecurityAI Coding AgentsDocker SecurityGitHub SecuritySoftware Supply Chain Security

Share

High-voltage electrical substation equipment behind a chain-link fence in Manassas Park, Virginia
Previous Post

PJM Will Curtail Power to New Data Centers Starting in June 2027

Close-up of a laptop terminal window showing scrolling log-style output beside a blurred code editor pane, illustrating raw unstructured log lines
Next Post

How to Debug a Production-Only Bug With Correlation IDs and Structured Logging in Python

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest
28 Oct
How to Run Zero-Downtime Schema Migrations on PostgreSQL 18 and Block Unsafe ALTER TABLE Statements With a Python Lint Gate
28 Oct
The Angular 2 Rewrite Turns a Migration Lesson Into a Security Bill: AngularJS Still Draws 533,480 Downloads a Week, and 10 Advisories Have No Open-Source Fix
Trending
October 28, 2026
How to Run Zero-Downtime Schema Migrations on PostgreSQL 18 and Block Unsafe ALTER TABLE Statements With a Python Lint Gate
October 28, 2026
The Angular 2 Rewrite Turns a Migration Lesson Into a Security Bill: AngularJS Still Draws 533,480 Downloads a Week, and 10 Advisories Have No Open-Source Fix
October 28, 2026
WordPress 7.1.4 Closes an Unauthenticated Race in Its Own Update Routine, but 19 Older Branches Had No Backport Hours After Release
October 28, 2026
How to Compress Time-Series Metrics in Python With Gorilla Delta-of-Delta and XOR Encoding
October 28, 2026
NIST’s Final Post-Quantum Transition Report Puts Every Quantum-Vulnerable Public-Key Scheme on One 2030 and 2035 Clock, and Three Federal Documents Word the Deadline Three Ways
October 28, 2026
Honeypots Recorded Probes Against Oracle E-Business Suite CVE-2026-101767 Seven Days After Its Patch, and the Finder’s Write-Up Is Dated Patch Day

Related Posts

Blue-lit server racks in a modern data center, illustrating the compute infrastructure behind the AI boom.
Articles

The AI Boom Is Spending Real Money Before Proving Real Returns

June 7, 2026
Technician working with a laptop beside server racks, representing enterprise AI retrieval infrastructure
Articles

Google’s Agentic RAG Push Makes Enterprise AI Less of a One-Shot Guess

June 7, 2026
A person with a laptop and smartphone, representing digital attention and AI-assisted work
Articles

AI Chatbots Are Making Attention a Design Problem

June 7, 2026
A customer-support representative wearing a headset against a dark studio background.
Articles

The Meta AI Support Hack Was a Plain Old Authorization Failure

June 7, 2026
SXZ.io SXZ.io
  • [email protected]

Categories

Articles
Learning Hub
News

All Rights Reserved by SXZ.io ©2026