The next AI coding agent trust surface: a 13 MB file your editor runs on open
Three days ago the public attack surface on AI coding agents gained one new primitive. Forever Security's Gal Weizman disclosed to BleepingComputer on October 25 that if an attacker drops an AGENTS.md or CLAUDE.md file into your Downloads folder, the next AI coding agent you launch there reads it and runs the commands inside.
Today JFrog Security Research added a second primitive. This one does not even need a file in your working directory. It just needs a repository you cloned.
The pattern
JFrog Security Research disclosed on October 28 that attackers hijacked 42 real GitHub repositories across 11 legitimate accounts — individual developers, students, and one company — and planted a hidden file at .github/init.js in each. The file is between 12.9 and 13.7 megabytes. Settings files for Claude, Gemini, Cursor, and VS Code call this script when a session starts or a folder opens.
JFrog is explicit about the technique: "The case needs no clever prompt. It simply abuses the startup hooks that the tools trust."
That is the sentence to read twice. Prompt injection is not required. The agent reads a settings file, the settings file whitelists an init.js path, the script is on disk because you cloned the repo, so it runs. Nothing in the chain is a bug. AGENTS.md was a read-on-launch config primitive; this is an execute-on-launch script primitive. Same shape, different mechanism, same end state.
What the payload does
The 13 MB init.js rebuilds a hidden CI publisher — ci.js — that pushes malicious packages to npm from GitHub Actions, using maintainer tokens stolen from the hijacked GitHub accounts. The operator uses that stolen GitHub and npm access to publish new malicious releases, which feeds more stolen access back into the loop.
Three npm packages in the campaign carry a compiled native addon plus an encrypted .napi_cache file. The addon stays dormant on CI systems, containers, small VMs, and debuggers; the Windows build checks for Wireshark and x64dbg before unpacking.
Evasion worth noting
JFrog's first sweep for the pattern found 26 repositories. Checking the Git trees directly raised the count to 42. The reason the first sweep missed sixteen of them: the files are large enough that GitHub code search and the Contents API do not return them. Oversize-as-concealment is now a working primitive against GitHub's own public code-search surface.
On September 28, scripted batches on the attacker's side copied old commit messages and dates and added skip-checks:true to backdate activity, so the hostile commits look older and less interesting than the real history around them. One hijacked account, leamasuero, has a legitimate commit history running from 2014 to 2022. The company account Crayon-Biz-LLP shows commits from at least two members, which JFrog reads as several stolen sets of credentials.
Related hijacked accounts also ran scanners against cPanel and WHM systems for CVE-2026-41940, an auth-bypass issue. JFrog found no evidence any server was breached that way.
How the discovery happened
JFrog did not start on the GitHub side. On October 22, SafeDep disclosed an npm worm it tracks as the testmetest campaign and reported no confirmed victims. JFrog began investigating the npm side and traced it to GitHub, where it found real repositories already compromised. The two disclosures are the same operator seen from two directions: npm supply chain on SafeDep's side, and .github/init.js startup hooks on real repositories on JFrog's.
The ordering trap in response
If you find this on a developer machine, JFrog's incident guidance is specific about the sequence:
- First, remove the two persistence components the worm installs:
net-health-checkerandpkg-runtime. - Then, revoke the stolen GitHub token.
- Then, rotate the rest of the credentials.
- Check repository trees directly for
.github/init.js— do not rely ongit logor GitHub code search for this one.
Revoking the GitHub token first trips the worm's token-revocation wiper. The order matters.
What the agent is actually doing
Your editor is reading a settings file — .vscode/settings.json, .cursor/, Gemini's or Claude's startup hooks — that whitelists a script path. The path is .github/init.js. The file is in the repo because you cloned the repo. The editor runs it on open, exactly as its own documentation says it will.
That is not a vendor bug. There is no CVE on Claude, Cursor, Gemini, or VS Code for this; there will not be one. The same was true of the AGENTS.md story — Forever Security's Gal Weizman put it bluntly that "there is nothing here for OpenAI or Anthropic to patch."
The agent, the settings file, and the repo are each doing exactly what their vendors designed them to do. The attacker's only move was to put the file where the agent would open it.
What to do today
- Treat a freshly cloned repo as untrusted until you have inspected
.github/,.vscode/,.cursor/, and any Gemini/Claude settings files in it. Open those paths before you open the project. - Do not rely on GitHub code search for this pattern. The payload sizes are chosen to evade it.
git ls-tree -r --long HEAD | sort -nk4 | tailon a fresh clone shows the big objects. - Disable auto-run startup hooks on your editor by default, and enable them per project only when you have a reason to.
- If you suspect an agent has run one: remove
net-health-checkerandpkg-runtimepersistence before revoking the stolen token.
Two trust surfaces in a 72-hour window — AGENTS.md read, init.js executed — point at the same thing. The AI coding agent's trust interior (startup instruction files, startup hook scripts, settings-whitelisted auto-run paths) is the new npm install script. The industry spent fifteen years learning to be careful about postinstall on untrusted dependencies. The clock has restarted.
SPR{K3 is a security research operation that pairs offensive vulnerability research with runtime behavioral defense. Defend is our runtime agent. To talk about a deployment, reach us at support@sprk3.com.