Blog
A poisoned Ruby gem went after AI coding tools' sign-ins and settings
The story: Shai-Hulud Descendant Surfaces in Malicious Ruby Gem That Steals Credentials and Poisons AI Tools · Socket ·
Topics: AI tools Breaches and leaks
On 6 November 2026 Socket described strutil-core 1.0.1, a Ruby gem public for about five hours on 1 November that collects credentials, AI coding tools' among them, and adds itself to those tools' settings. What it does, what to check, and why the token is revoked only after the malware is removed.
For about five hours on 1 November 2026, RubyGems, the registry Ruby developers install packages from, offered a gem called strutil-core whose version 1.0.1 ran code the moment it was installed. On 6 November the software supply-chain security company Socket published its analysis: the code collects credentials from a developer's machine, AI coding tools' sign-ins among them, adds itself to those tools' settings, and, where it uses a stolen GitHub token, can delete the home folder once that token is revoked. Socket doesn't know how many machines installed it, but the way it behaves changes what a team has to check, and in which order.
What happened
Socket's timeline, in UTC: version 1.0.0, which was clean, was published at 02:19 on 1 November, and 1.0.1 at 04:05. RubyGems removed both between 08:52 and 09:13 the same morning, according to Bitbison, which Socket cites. Socket says it doesn't know how many systems installed 1.0.1, and that download counters are not victim counts.
A gem with a native extension builds it at install time (RubyGems). Here the build script built nothing. On Linux and macOS it downloaded the Bun JavaScript runtime from GitHub, ran a bundled program with it, and left a Makefile that does nothing, so the install finished without an error.
In Bitbison's sandbox that program read from 51 credential stores, among them .aws/credentials, .npmrc, .gem/credentials, .kube/config, .claude/.credentials.json and .codex/auth.json. Socket lists what it goes after: cloud providers, CI, package registries, Git hosts, SSH, Docker, Kubernetes, Vault, password managers, OS keychains, cryptocurrency wallets and AI coding tools. It encrypts what it finds and posts it to a remote server, with a public GitHub repository or GitLab as fallbacks.
Two more things matter for anyone cleaning up. In the home folder it looks for writable settings files of AI coding tools: to MCP configurations it adds a server called workspace-tools that runs its code, and to other settings files it adds SessionStart hooks. With stolen Git credentials it writes files such as CLAUDE.md, AGENTS.md, .claude/settings.json, .cursor/mcp.json, .github/init.js and a .vscode/tasks.json task into repositories. Socket says opening such a repository in an AI tool or VS Code can run the code again, depending on workspace trust and approval settings.
And when it sends data with a stolen GitHub token, it installs a checker, net-health-checker, that asks GitHub every 45 seconds, for 48 hours, whether the token still works. When GitHub refuses it, the checker deletes the home folder. In Socket's words: "Revoking the token is exactly what a responder would do first, and it is what triggers the deletion."
The code can also republish packages and spread over SSH, but Socket says it has not confirmed any downstream publication from this gem. A Python package, pystr-codec, sends data to the same address; the open-source database OSV lists it as malicious. What isn't known: how many machines ran 1.0.1, and so whose credentials, if anyone's, left.
What it means
The list of 51 stores is a record of what the program opened in a sandbox built to watch it. On a real laptop, what it read depends on what was there: a developer with cloud keys, a Kubernetes configuration and a signed-in coding agent had more to lose than one with none of them. Unless something was recording file opens at the time, a laptop's own logs rarely say which of those files the program opened. What it sends is encrypted, so a network log can show a connection, not what was in it. Socket's advice is to treat every credential the machine could reach as compromised.
On a Mac, Claude Code normally keeps its sign-in in the Keychain rather than in that file; on Linux it is ~/.claude/.credentials.json (Anthropic). Socket lists OS keychains among what the collectors go after, so the difference settles nothing.
The settings changes matter as much as the theft. A SessionStart hook runs "when a session begins or resumes", and Claude Code reads hooks from ~/.claude/settings.json for every project and from .claude/settings.json inside a project (Anthropic). Rotating credentials without cleaning those files leaves the code a way to run again whenever a developer starts the tool, and a repository it wrote to can carry it to colleagues' machines.
The checker turns the usual first step into the worst one. Revoking the token while it runs deletes the home folder, and with it the settings files and traces a responder would want to look at.
What you can do
Check for it. Search Gemfile.lock files, CI caches and container images for strutil-core. On a developer machine, these are traces Socket names:
ls -l ~/.config/index.js ~/.local/share/runtimes/sync.py ~/.config/net-health-checker/token /var/tmp/.fontconfig_state
systemctl --user status pkg-runtime # Linux
launchctl list | grep pkg-runtime # macOS
If it was installed, keep Socket's order. Isolate the machine. Stop and remove net-health-checker and pkg-runtime, with their systemd units or LaunchAgents, and only then revoke the GitHub token. Rotate every credential the machine could reach, from a clean device, and rebuild the machine.
Clean the settings, not only the secrets. In home folders, and in every repository the machine could push to, look for an MCP server named workspace-tools, SessionStart hooks nobody added, and new or changed .github/init.js, AGENTS.md, CLAUDE.md and .vscode/tasks.json files.
Decide where the record of reads will come from next time. On Linux, the audit system can log every read of a credentials folder from the moment a rule is added. The auditctl manual asks for this syscall form rather than the older watch form; change the path, and ausearch finds the events by their key:
sudo auditctl -a always,exit -F arch=b64 -F dir=/home/dev/.aws/ -F perm=r -F key=cred-read
sudo ausearch -k cred-read -i
It covers one machine, from now on, and every read by every program, the expected ones included, lands in the same log.
Where ProofStream fits
ProofStream records which program opened which folder on each Mac, Windows and Linux computer, and keeps that history searchable for months. On a machine that installed this gem, it would show which program opened folders such as ~/.aws, ~/.ssh, ~/.claude and ~/.codex, and when, and whether the same happened on other machines; file names only in folders a customer chooses, on the Business Plus plan. It records that a file was opened, not what was written or sent, so it wouldn't show the changed settings or the upload, and it couldn't have stopped the install or the deletion. How it works.
Sources
- Shai-Hulud Descendant Surfaces in Malicious Ruby Gem That Steals Credentials and Poisons AI Tools
- OSV: MAL-2026-18432, malicious code in pystr-codec (PyPI)
- RubyGems Guides: Gems with extensions
- Claude Code documentation: Authentication
- Claude Code documentation: Hooks reference
- man7.org: auditctl(8), Linux manual page
- man7.org: ausearch(8), Linux manual page
Spotted a mistake? Tell us and we'll correct it.
Comments
No comments yet.