# RubyGems Malicious Gem Surge 2026: Credential-Stealing Worms, Cryptojacking, Typosquats and Dormant-Package Hijacks

> Throughout 2026 RubyGems saw multiple distinct malicious-package campaigns: the strutil-core 1.0.1 worm (Shai-Hulud/Miasma descendant), the knot-theory 'Secret Snatchers' credential stealers, the GemStuffer mass-publishing wave, XMRig cryptojacking typosquats, SleeperGem dormant-package hijacks, and bundler typosquats delivering a Rust stealer. Install-time execution via extconf.rb, Bun-delivered encrypted payloads, theft of cloud/CI/registry/AI-tool credentials and a revocation-triggered home-directory wiper make this a high-impact software supply-chain threat.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-02T17:41:44Z
- **Last updated:** 2026-12-02T17:41:44Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7300
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7300.png
- **ID:** TL-2026-7300
- **Severity:** HIGH
- **Category:** SUPPLY_CHAIN
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 26 (3 shown free below)

## Description

ReversingLabs' 2026 almanac (Lucija Valentić, 2026-12-02) consolidates several independent malicious-gem campaigns on RubyGems. They are not attributed to one operator; the only actor-level attribution in the sources is Socket's tie of the knot-theory gems to the GitHub account BufferZoneCorp.

strutil-core (RubyGems account jamnajiea): version 1.0.0 was published clean on 2026-11-01 02:19 UTC; malicious 1.0.1 followed at 04:05 UTC and was flagged by Socket's AI Scanner 70 seconds later. RubyGems removed both versions roughly five hours after the malicious release. A fake native-extension build script (ext/strutil-core/extconf.rb) downloads the Bun runtime (oven-sh/bun v1.2.18 from GitHub releases) and runs a multi-layer encrypted ~5.5 MB payload (index.js) at gem install / bundle install time, writing a no-op Makefile so installation appears to succeed. The payload exits on CIS-related locales, reads 51 credential stores (cloud, registry, Git, SSH, Docker, Kubernetes, Vault, password managers, wallets, AI-tool credentials such as .claude/.credentials.json and .codex/auth.json), enumerates AWS Secrets Manager/SSM, scrapes Runner.Worker memory on GitHub Actions via sudo-run Python, and tries (unsuccessfully per Socket) to interfere with StepSecurity Harden-Runner. Loot is encrypted with AES-256-GCM (key wrapped with RSA-OAEP-SHA256) and sent to https://paleasbest.top/v1/api, with GitHub/GitLab repositories as fallback. Persistence is a hourly Python backdoor (sync.py) under a systemd user service or LaunchAgent 'pkg-runtime' that reads a signed (RSA-PSS) URL from public GitHub commits containing the marker msync-3f7a. If a stolen GitHub token is found revoked, the net-health-checker monitor (polling api.github.com/user every 45 seconds) runs rm -rf ~/ and ~/Documents. The worm also modifies AI coding-tool and editor configuration (Claude, Cursor, Gemini, Aider, VS Code, MCP server 'workspace-tools', SessionStart hooks, CLAUDE.md/AGENTS.md) and contains RubyGems/npm/PyPI republishing, GitHub/GitLab and SSH spreading routines. Socket ties the code to the testmetest worm / Miasma family descended from the public Shai-Hulud toolkit; shared code does not identify a single operator. A related PyPI package, pystr-codec 0.1.0-0.1.2, uses the same C2 endpoint.

knot-theory 'Secret Snatchers' (Socket, 2026-05-01): 7 RubyGems and 9-10 Go modules under the knot-theory RubyGems and BufferZoneCorp GitHub accounts. Five gems were weaponized (knot-activesupport-logger, knot-devise-jwt-helper, knot-rack-session-store, knot-rails-assets-pipeline, knot-rspec-formatter-json); knot-date-utils-rb and knot-simple-formatter were dormant sleepers. Payloads in ext/extconf.rb harvest environment variables and credential files (~/.ssh keys, ~/.aws/credentials, ~/.npmrc, ~/.gem/credentials, ~/.netrc, gh hosts.yml) and post JSON to a webhook.site URL. The Go modules poison GitHub Actions by writing GOPROXY/GOSUMDB/GOFLAGS/GOMODCACHE to GITHUB_ENV, prepending a fake go wrapper via GITHUB_PATH, and appending an ed25519 key (deploy@buildserver) to authorized_keys.

GemStuffer (May 2026): Mend.io flagged 120+ malicious packages on 2026-05-11; RubyGems suspended new registrations 2026-05-12 to 2026-05-16. Packages were empty placeholders or scrapers of UK council websites; some probed RubyGems for XSS and similar flaws; RubyGems reported no evidence API-key theft succeeded. A September claim linking the activity to OpenAI agents is circumstantial.

Cryptojacking (mid-July, Unit 42 and Mend.io): trojanized copies of popular libraries with an advanced payload that delays execution by hours, persists, spreads over SSH, infects package.json, setup.py, Dockerfiles, git hooks and VS Code extensions and downloads XMRig; a simpler group of 23 mostly-typosquat gems fetches only the latest XMRig.

SleeperGem (July, Aikido/StepSecurity): git_credential_manager 2.8.0-2.8.3 (new malicious package) is a loader fetching payloads from the attacker-registered Forgejo namespace git.disroot.org/git-ecosystem with TLS verification disabled, executed via powershell -ExecutionPolicy bypass or /bin/sh; it skips CI environments (~30 CI env vars). From 2.8.2 it also runs on require. The hijacked Dendreo gem (dormant since 2020; two malicious versions published 2026-07-18, 1.1.4 per ReversingLabs) adds git_credential_manager as a dependency, and fastlane-plugin-run_tests_firebase_testlab (0.3.2, 574,661 downloads) was published by a different maintainer.

Bundle of Malware (mid-August, OpenSourceMalware): typosquats of bundler, i18n, activesupport and rake use extconf.rb to launch a runner that writes a dummy Makefile, downloads a Windows executable from GitHub, then a large Rust loader with an embedded stealer takes browser data, cookies, cards, wallets/seed phrases, Telegram data and system info, exfiltrating via a file-sharing service.

Registry abuse: Shai-Hulud's compromise of the GitHub Action @7nohe/openapi-react-query-codegen stole RubyGems credentials usable to republish poisoned gems; in June Mend.io found RubyGems packages used as a dead drop for a stolen 1Password vault (63 items).

## MITRE ATT&CK

- T1195.002 Compromise Software Supply Chain
- T1195.001 Compromise Software Dependencies and Development Tools
- T1059.007 JavaScript
- T1059.006 Python
- T1059.004 Unix Shell
- T1204.002 Malicious File
- T1543.002 Systemd Service
- T1543.001 Launch Agent
- T1098.004 SSH Authorized Keys
- T1548.003 Sudo and Sudo Caching
- T1027 Obfuscated Files or Information
- T1140 Deobfuscate/Decode Files or Information
- T1685 Disable or Modify Tools
- T1036.005 Match Legitimate Resource Name or Location
- T1552.001 Credentials In Files
- T1555 Credentials from Password Stores
- T1528 Steal Application Access Token
- T1003.007 Proc Filesystem
- T1614.001 System Language Discovery
- T1102.001 Dead Drop Resolver
- T1567.001 Exfiltration to Code Repository
- T1485 Data Destruction
- T1496.001 Compute Hijacking

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**RubyGems Malicious Gem Install-Time Execution — extconf.rb Spawning Downloader/Bun (TL-2026-7300, SPL)** (`TL-2026-7300-SPL-001`)

Behaviour-first detection of the install-time execution used across the 2026 RubyGems campaigns (strutil-core 1.0.1, knot-theory Secret Snatchers, SleeperGem git_credential_manager, bundler typosquats): a gem/bundle install or extconf.rb build script spawning curl/wget/PowerShell/the Bun runtime, or touching campaign IOCs (paleasbest.top, git.disroot.org/git-ecosystem, the knot-theory webhook.site path), plus direct installs of the named malicious gems.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1195.002, T1195.001, T1059.004, T1059.007, T1204.002
- **Data sources:** sysmon_linux (index=sysmon, sourcetype=sysmon:linux), sysmon_windows (index=sysmon, sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational), defender_for_endpoint (DeviceProcessEvents)
- **Severity:** high
- **Confidence:** high

### Splunk SPL

```spl
index=sysmon (sourcetype="sysmon:linux" OR sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational") EventCode=1 (((ParentCommandLine="*extconf.rb*" OR ParentCommandLine="*bundle install*" OR ParentCommandLine="*gem install*") (Image="*/bun" OR Image="*bun.exe" OR Image="*/curl" OR Image="*/wget" OR Image="*powershell.exe" OR CommandLine="*oven-sh/bun*" OR CommandLine="*paleasbest.top*" OR CommandLine="*git.disroot.org/git-ecosystem*" OR CommandLine="*webhook.site/49c21843-c27c-4a1b-b1f6-037c3998055f*")) OR (CommandLine="*gem*install*" (CommandLine="*strutil-core*" OR CommandLine="*knot-activesupport-logger*" OR CommandLine="*knot-devise-jwt-helper*" OR CommandLine="*knot-rack-session-store*" OR CommandLine="*knot-rails-assets-pipeline*" OR CommandLine="*knot-rspec-formatter-json*" OR CommandLine="*git_credential_manager*"))) | stats count min(_time) as first_seen max(_time) as last_seen values(CommandLine) as child_cmd values(ParentCommandLine) as parent_cmd by host, User, Image | convert ctime(first_seen) ctime(last_seen)
```

### Microsoft KQL

```kql
let malGems = dynamic(["strutil-core","knot-activesupport-logger","knot-devise-jwt-helper","knot-rack-session-store","knot-rails-assets-pipeline","knot-rspec-formatter-json","git_credential_manager"]);
let iocs = dynamic(["paleasbest.top","git.disroot.org/git-ecosystem","webhook.site/49c21843-c27c-4a1b-b1f6-037c3998055f","oven-sh/bun"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where (InitiatingProcessCommandLine has_any ("extconf.rb","bundle install","gem install") and (FileName in~ ("bun","bun.exe","curl","curl.exe","wget","powershell.exe") or ProcessCommandLine has_any (iocs)))
   or (ProcessCommandLine has "gem" and ProcessCommandLine has "install" and ProcessCommandLine has_any (malGems))
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine
| order by Timestamp desc
```

### Sigma

```yaml
title: RubyGems extconf.rb Install-Time Downloader or Known Malicious Gem Install
id: 7c1e4b52-3a8d-4f0e-9b6a-2d5f8e1c7a93
status: experimental
description: Detects gem/bundle install-time execution of extconf.rb spawning a downloader or the Bun runtime, or installation of gems named in the 2026 RubyGems malicious-gem campaigns (strutil-core, knot-theory, git_credential_manager).
references:
  - https://socket.dev/blog/shai-hulud-descendant-malicious-ruby-gem
  - https://www.reversinglabs.com/blog/rubygems-is-no-longer-sitting-out-the-2026-almanac-of-malicious-gems
author: Threadlinqs Team
date: 2026-12-02
tags:
  - attack.initial-access
  - attack.t1195.001
  - attack.t1195.002
  - attack.execution
  - attack.t1059.004
  - attack.t1059.007
  - attack.t1204.002
  - attack.command-and-control
  - attack.t1105
logsource:
  category: process_creation
  product: linux
detection:
  selection_parent:
    ParentCommandLine|contains:
      - 'extconf.rb'
      - 'bundle install'
      - 'gem install'
  selection_child_img:
    Image|endswith:
      - '/bun'
      - '/curl'
      - '/wget'
  selection_child_cmd:
    CommandLine|contains:
      - 'oven-sh/bun'
      - 'paleasbest.top'
      - 'git.disroot.org/git-ecosystem'
      - 'webhook.site/49c21843-c27c-4a1b-b1f6-037c3998055f'
  selection_gem_verb:
    CommandLine|contains|all:
      - 'gem'
      - 'install'
  selection_gem_name:
    CommandLine|contains:
      - 'strutil-core'
      - 'knot-activesupport-logger'
      - 'knot-devise-jwt-helper'
      - 'knot-rack-session-store'
      - 'knot-rails-assets-pipeline'
      - 'knot-rspec-formatter-json'
      - 'git_credential_manager'
  condition: (selection_parent and 1 of selection_child_*) or (selection_gem_verb and selection_gem_name)
falsepositives:
  - Legitimate native-extension gems whose extconf.rb downloads vendored sources with curl or wget
  - Security teams deliberately installing the named gems in a sandbox for analysis
level: high
```

**Known false positives:**

- Legitimate native-extension gems whose extconf.rb downloads vendored sources with curl or wget
- Security or research teams intentionally installing the named gems in a sandbox for analysis

**Tuning notes:** Scope to build hosts and CI runners first. Allowlist known-good gems that legitimately download sources in extconf.rb (by parent gem path). Rename the index/sourcetype to your Sysmon-for-Linux ingestion. Retain the IOC string matches even if you tune the generic curl/wget branch.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- RubyGems Malicious Gem Install-Time Execution — extconf.rb Spawning Downloader/Bun (TL-2026-7300, KQL) (locked: unlock with TL Creds)
- RubyGems Malicious Gem Post-Exploitation — pkg-runtime Persistence, authorized_keys Tampering, Wiper and Runner Memory Scrape (KQL) (locked: unlock with TL Creds)
- RubyGems Malicious Gem C2 and Exfiltration — [indicator], [indicator]/git-ecosystem, webhook.site Path and GitHub Token Polling (KQL) (locked: unlock with TL Creds)
- RubyGems Malicious Gem Install-Time Execution — extconf.rb Spawning Downloader/Bun (TL-2026-7300, Sigma) (locked: unlock with TL Creds)
- RubyGems Malicious Gem Post-Exploitation — pkg-runtime Persistence, authorized_keys Tampering, Wiper and Runner Memory Scrape (Sigma) (locked: unlock with TL Creds)
- RubyGems Malicious Gem C2 and Exfiltration — [indicator], [indicator]/git-ecosystem and knot-theory webhook.site Path (Sigma) (locked: unlock with TL Creds)
- RubyGems Malicious Gem Post-Exploitation — pkg-runtime Persistence, authorized_keys Tampering, Wiper and Runner Memory Scrape (SPL) (locked: unlock with TL Creds)
- RubyGems Malicious Gem C2 and Exfiltration — [indicator], [indicator]/git-ecosystem and knot-theory webhook.site Path (SPL) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 26)

Defanged, TLP:CLEAR.

- Domain: `paleasbest[.]top`
- URL: `hxxps://webhook[.]site/49c21843-c27c-4a1b-b1f6-037c3998055f`
- File hash: `3b3f6e1bde0b28b015030a81a6d805b5b5306dc3f021e1102123971cfd83acc0`

Full set of 26 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [RubyGems Is No Longer Sitting Out: The 2026 Almanac of Malicious Gems (ReversingLabs)](https://www.reversinglabs.com/blog/rubygems-is-no-longer-sitting-out-the-2026-almanac-of-malicious-gems)
- [Shai-Hulud Descendant Surfaces in Malicious Ruby Gem That Steals Credentials and Poisons AI Tools (Socket)](https://socket.dev/blog/shai-hulud-descendant-malicious-ruby-gem)
- [MAL-2026-19054 strutil-core (OSV)](https://osv.dev/vulnerability/MAL-2026-19054)
- [Malicious Ruby Gems and Go Modules Steal Secrets, Poison CI (Socket)](https://socket.dev/blog/malicious-ruby-gems-and-go-modules-steal-secrets-poison-ci)
- [SleeperGem: RubyGems supply chain attack (Aikido)](https://www.aikido.dev/blog/sleepergem-rubygems-supply-chain-attack)
- [SleeperGem: Compromised RubyGems Drop Persistent Backdoor (StepSecurity)](https://www.stepsecurity.io/blog/sleepergem-compromised-rubygems-drop-persistent-backdoor)
- [GemStuffer (Socket)](https://socket.dev/blog/gemstuffer)
- [Inside the RubyGems Supply Chain Attack (Mend.io)](https://www.mend.io/blog/inside-the-rubygems-supply-chain-attack/)
- [RubyGems status incident (GemStuffer registration suspension)](https://status.rubygems.org/incidents/cytf062tkwtt)
- [RubyGems Cryptomining Campaign (Mend.io)](https://www.mend.io/blog/rubygems-cryptomining-campaign/)
- [Unit 42 Timely Threat Intel (RubyGems cryptomining entry)](https://github.com/PaloAltoNetworks/Unit42-timely-threat-intel)
- [RubyGems as a dead drop for stolen data (Mend.io)](https://www.mend.io/blog/rubygems-supply-chain-attack-dead-drop/)
- [strutil-core package analysis (ReversingLabs Spectra Assure)](https://secure.software/rubygems/packages/strutil-core/malware)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7300
