Poisoned Pipeline / Incidents / AS348

AS348 · 2026-11

A gem sold as string helpers runs a 5.48 MB Miasma-family worm at install, poisons AI coding tools, and wipes the home directory once the stolen token stops working

RubyGemsPyPInpmGitHub ActionsGit / GitHubGitLabDeveloper workstationAI coding agentsMCPVS Code / IDELinux distro / packagesmacOS softwareWindows software

Socket published this on 6 November 2026. The RubyGems account
jamnajiea published strutil-core 1.0.0 at 02:19:56 UTC on 1 November and
1.0.1 at 04:05:04, one hour and 45 minutes later. The first version is
clean; Bitbison's sandbox run of it recorded no malicious behaviour.
Socket's AI scanner flagged ext/strutil-core/index.js at 04:06:14, 70
seconds after the malicious publish, and RubyGems removed both versions
between 08:52 and 09:13, so the public window was about five hours.
The public ruby-digger tracker recorded 89 total downloads, none of
them on 1.0.1, most likely from mirrors and automated scanners; Socket
does not treat that as a victim count and neither should the reader.
Samy Al Bahra opened OpenSSF malicious-packages PR 1701 at 19:16:47 UTC
the same day.

The gemspec calls the package "Lightweight string manipulation
helpers: slug, truncate, normalize" and the Ruby half implements only
slugify. It declares a native extension, and ext/strutil-core/extconf.rb
contains no build logic: on Linux and macOS, x86-64 or ARM64, it creates
/tmp/.b_<pid>, downloads Bun 1.2.18 from Bun's GitHub releases and runs
the bundled ext/strutil-core/index.js during gem install. That file is a
5,475,376-byte Bun bundle behind two obfuscation layers — a rotated
4,069-entry string table used at 15,715 call sites, and 867 sensitive
strings behind PBKDF2-HMAC-SHA256 with 200,000 iterations, a 16-byte
nonce per string and three substitution rounds — plus nineteen embedded
components (shell, Python, Node.js, YAML, JSON, C source and a Windows
DLL) gzipped and encrypted with AES-256-GCM. The library still sets
VERSION = '1.0.0' inside a gem published as 1.0.1, because the injector
changes the gemspec version and never edits the existing Ruby source.

The installer is the worm's own RubyGems injector, not hand-written for
this package. Thirty-three of the 36 non-empty lines in it appear
verbatim in 05-rubygems-compromise/00-rubygems-package-injection.js, a
deobfuscated copy of the June 2026 Miasma payload published on GitHub
for defensive research. Four things changed in this build: Bun 1.3.13
became 1.2.18; the download URL is split across a _gh_base variable so
signatures that match github.com/oven-sh/bun/releases miss it; the
publish User-Agent moved from RubyGems/3.5.0 to
RubyGems/3.5.16 ruby/3.2.2 (x86_64-linux); and the module gained [rg]
progress logging and a dry-run mode. The injector unpacks data.tar.gz
and treats the first directory it finds as the package root, repacking
only that directory's contents. Here that directory was lib, so the
unchanged lib/strutil_core.rb reappears at the root of 1.0.1 — the same
assumption npm's single package/ directory rewards, and the same logic
as the June module.

Collection covers cloud providers, package registries, Git hosts, SSH,
Docker, Kubernetes, Vault, password managers, operating system
keychains, cryptocurrency wallets and AI coding tools, reading both
credential files and environment variables. Bitbison's sandbox recorded
reads from 51 stores, including .aws/credentials, .npmrc, .pypirc,
.gem/credentials, .docker/config.json, .kube/config,
.claude/.credentials.json and .codex/auth.json. Given AWS credentials
the payload calls STS for the caller identity, enumerates Secrets
Manager secrets and SSM parameters across 17 regions and requests ECR
authorisation tokens across 11; separate providers cover Azure, Google
Cloud, Kubernetes and Vault. Before any of that it checks the locale
through Intl.DateTimeFormat and LC_ALL, LC_MESSAGES, LANGUAGE and LANG,
and exits on Russian, Belarusian, Kazakh, Uzbek, Kyrgyz, Tajik,
Armenian, Azerbaijani, Ukrainian, Georgian, Turkmen and Moldovan.

Results are encrypted with AES-256-GCM under a key wrapped with
RSA-OAEP-SHA256 and posted to https://paleasbest[.]top/v1/api after an
empty-JSON health probe. If that fails the payload creates a public
GitHub repository described "project-utils" with an
adjective-plural-noun-number name such as smart-workers-48213, or falls
back to GitLab. Commits carrying stolen tokens use the AutoSyncComplete
prefix.

Persistence is an embedded sync.py, 8,204 bytes, SHA-256
c7ef186aa59b67d9b198a14f6dc8aaee6dd86510ac7c37d28f65d310cd846411,
written to ~/.local/share/runtimes/sync.py and registered as the
systemd user service pkg-runtime on Linux or the LaunchAgent
com.user.pkg-runtime on macOS. Every hour it searches public GitHub
commits for msync-3f7a, reads a Base64-encoded URL from the commit
message and runs the Python script there — but only if the URL carries
a valid RSA-PSS signature made with the actor's private key, so nobody
else can issue commands through the same marker. Processed URLs are
recorded in /var/tmp/.fontconfig_state. The signature covers the URL,
not the script it points at.

The same build treats AI coding tools as execution triggers. Locally it
writes a copy of itself to ~/.config/index.js and searches the home
directory for writable settings.json, config.json, mcp.json and
.aider.conf.yml files; MCP configurations gain a server named
workspace-tools that runs the payload with node, and other
configurations gain SessionStart hooks. With stolen Git credentials the
logic is committed instead: .github/init.js, .claude/settings.json,
.cursor/mcp.json, Gemini settings, CLAUDE.md, AGENTS.md and a
.vscode/tasks.json task that runs on folder open. The generated
AGENTS.md tells coding agents to run a setup script before their first
command, so opening an affected repository can re-run the worm
depending on that tool's workspace trust and approval settings.

Propagation code ships in the same bundle: alongside the RubyGems
injector there are republishing routines for npm and PyPI, JFrog
Artifactory credential harvesting, a fake "CodeQL" GitHub Actions
workflow that uploads secrets as a scan-output artifact, a GitLab CI
job named cache_sync that requests OIDC tokens, short-lived chore/ci-
branches with skip-checks:true commits, and SSH code that enumerates
hosts from ~/.ssh/known_hosts. Socket confirms these routines are
present in the code and states it has not confirmed any downstream
publication from this gem.

On GitHub Actions the payload finds the runner's worker by scanning
/proc/*/cmdline for Runner.Worker and pipes an embedded Python script
to sudo python3, which reads /proc/<pid>/maps and /proc/<pid>/mem to
pull secrets out of the worker's memory — the routine Socket attributes
to the March 2025 tj-actions/changed-files compromise, and one that
works by default because hosted runners grant passwordless sudo. The
payload also disables StepSecurity Harden-Runner, killing its container
through the Docker socket, starting a privileged Alpine container to
write runner ALL=(ALL) NOPASSWD:ALL into /etc/sudoers.d, pointing the
stepsecurity.io hostnames at 127.0.0.1 and ::1 in /etc/hosts and
replacing /etc/resolv.conf with 8.8.8.8 and 1.1.1.1.

There is a wiper, and it fires on the response. When the GitHub
exfiltration path accepts a stolen personal access token, the payload
installs a monitor called net-health-checker with the handler
rm -rf ~/; rm -rf ~/Documents. The installer writes
~/.local/bin/net-health-checker.sh, stores the token in plaintext at
~/.config/net-health-checker/token and registers a systemd user service
with loginctl enable-linger, so it survives logout, or a LaunchAgent.
Every 45 seconds for 172,800 seconds it checks the token against
api.github.com/user, and a 401 or 403 runs the handler. Its own log
line says "24h TTL reached" while MAX_TTL is 48 hours. The monitor only
installs on the GitHub-token path, so not every infected host has it.

Socket reads this as a later build of the testmetest worm it covered
through SafeDep in October — AS328 in this catalogue — and therefore a
member of the Miasma family that grew out of the publicly released
Shai-Hulud toolkit. The shared parts are not behavioural resemblance:
sync.py is byte-identical, msync-3f7a and AutoSyncComplete are the same,
net-health-checker runs the same 45-second interval, 48-hour lifetime
and 401/403 deletion command, pkg-runtime sits at the same paths, and
the project-utils description and repository naming match names such as
stable-scripts-9965 from earlier reporting. Bun 1.2.18, the GitLab
cache_sync job, the fake CodeQL workflow and scan-output artifact,
.github/init.js, the Runner.Worker read, the Harden-Runner handling, the
SSH known_hosts spreading and the locale exit are all present in both.
The differences are the C2, which is paleasbest.top rather than
aiarmor.website; the delivery, an extconf.rb hook rather than npm's
binding.gyp postinstall or a load-time native addon; a 5.48 MB bundle
shipped whole as index.js rather than testmetest's 14.8 KB loader with
a separate encrypted payload; PBKDF2 and AES-256-GCM rather than XOR
and Brotli; and an embedded Windows addon, node_win.napi.node, with a
compile timestamp of 27 October 2026 at 21:41:31 UTC and a hash that
differs from the testmetest addons published so far. Socket notes that
the Shai-Hulud source has been public since May 2026, so shared code
does not establish the same operator.

A PyPI sibling uses the same collection endpoint: pystr-codec 0.1.0,
0.1.1 and 0.1.2, documented by Kamil Mańkowski as MAL-2026-18432, with
a .pth startup trigger. Socket ingested those versions on 31 October at
22:21, 22:46 and 23:32 UTC, the last less than three hours before
strutil-core 1.0.0. No file in the strutil-core bundle matches
pystr-codec, so the two carry separate builds.

Uninstalling the gem does not end an infection, because the payload
lives outside the gem directory and the credentials it took are
long-lived. Socket's response order matters: isolate the host, stop and
remove net-health-checker and pkg-runtime with their units or
LaunchAgents, and only then revoke the GitHub token at
~/.config/net-health-checker/token, because revocation is what triggers
the deletion. Credential rotation should happen from a clean device and
the host should be rebuilt.

Mapped techniques

supply-chain strutil-core on RubyGems

T0108 · Resource Development · Accounts in public registry

RubyGems account jamnajiea, which now owns no gems, and no
GitHub account uses that name. The gemspec carries the author
string "Mark Tillman" and the homepage
github.com/marktillman/strutil-core; the repository does not
exist and Socket found nothing linking the package to a real
person of that name.

T0109 · Resource Development · Publish malicious artifact

Clean 1.0.0 at 02:19:56 UTC on 1 November, malicious 1.0.1 at
04:05:04. Both versions were removed between 08:52 and 09:13
UTC, per Bitbison and consistent with the RubyGems compact
index. The gem is a standalone name, not a compromised
existing package, and Socket found no public projects that
depended on it.

T0151 · Execution · Installation scripts

The gemspec declares a native extension and
ext/strutil-core/extconf.rb does no building. It creates
/tmp/.b_<pid>, downloads Bun 1.2.18 and runs the bundled
index.js at gem install, so the execution hook is a build
script RubyGems runs by design rather than a scripts section a
reviewer would look for.

T0159 · Execution · Malicious artifact execution

Installing 1.0.1 is the entire trigger. Bitbison's sandbox
confirms the gem runs the payload during gem install and reads
credential files; Socket's analysis of 1.0.0 recorded no
malicious behaviour, which is what makes the two-publish
sequence a clean seed followed by an injected patch.

post-supply-chain The machine that installs the gem

T0184 · Credential Access · Harvesting sensitive information from files

Bitbison's sandbox recorded reads from 51 credential stores,
including .aws/credentials, .npmrc, .pypirc,
.gem/credentials, .docker/config.json and .kube/config.
.claude/.credentials.json and .codex/auth.json are in the
collector list.

T0140 · Credential Access · Harvest tokens from environment variables

Collection reads environment variables as well as files for
cloud providers, registries, Git hosts and AI tools, and the
AWS path goes further than reading — STS GetCallerIdentity,
Secrets Manager and SSM parameter enumeration across 17
regions, and ECR authorisation tokens across 11.

T0172 · Execution · Runtime backdoor

sync.py is written to ~/.local/share/runtimes/sync.py and
registered as the systemd user service pkg-runtime, or the
LaunchAgent com.user.pkg-runtime, and polls hourly for a signed
URL to run as Python. The signature is RSA-PSS over the URL,
not over the script, so the backdoor trusts the actor's channel
rather than the payload it fetches.

T0210 · Persistence · Poison AI coding-agent config or workspace

A copy of the payload at ~/.config/index.js, an MCP server
named workspace-tools that runs it with node, SessionStart
hooks in settings.json, config.json, mcp.json and
.aider.conf.yml, and with stolen Git credentials the same
entries committed as .github/init.js, .claude/settings.json,
.cursor/mcp.json, Gemini settings, CLAUDE.md, AGENTS.md and a
.vscode/tasks.json task that runs on folder open.

T0156 · Exfiltration · Exfiltration over webhooks

AES-256-GCM ciphertext with an RSA-OAEP-SHA256 wrapped key is
posted to https://paleasbest[.]top/v1/api after an empty-JSON
health probe. Socket did not test whether the endpoint is live.

T0168 · Exfiltration · Exfiltration to code repositories

Fallback is a new public GitHub repository described
"project-utils", named adjective-plural-noun-number such as
smart-workers-48213, with a GitLab fallback after that.
Stolen-token commits carry the AutoSyncComplete prefix so other
infections can find and reuse them.

T0169 · Lateral Movement · Push implants across repositories

Present in the bundle and not confirmed in use — republishing
routines for npm and PyPI, JFrog Artifactory credential
harvesting, chore/ci- branches with skip-checks:true commits,
a fake CodeQL workflow, a GitLab cache_sync job requesting OIDC
tokens, and SSH spreading from ~/.ssh/known_hosts.

T0216 · Impact · Wipe developer profile if a stolen token is revoked

net-health-checker stores the token at
~/.config/net-health-checker/token and checks it every 45
seconds for 172,800 seconds. A 401 or 403 runs
rm -rf ~/; rm -rf ~/Documents. Revoking the credential is the
trigger, so responders have to remove the monitor first.

post-supply-chain GitHub Actions runners that install it

T0176 · Defense Evasion · Disable or misconfigure security measures

Through the Docker socket the payload kills the Harden-Runner
container and starts a privileged Alpine container that writes
runner ALL=(ALL) NOPASSWD:ALL into /etc/sudoers.d. It also
points the stepsecurity.io hostnames at 127.0.0.1 and ::1 and
replaces /etc/resolv.conf with public resolvers, so the runner
loses both the agent and its name resolution.

T0228 · Credential Access · Read secrets from the CI runner worker's process memory

The payload scans /proc/*/cmdline for Runner.Worker and pipes
an embedded Python script to sudo python3, which reads
/proc/<pid>/maps and /proc/<pid>/mem. Hosted runners grant
passwordless sudo, so the read needs no further privilege
escalation. Socket attributes the same routine to the March
2025 tj-actions/changed-files compromise.

Framework gaps noted

Sources