SleeperGem Supply Chain Attack on RubyGems

'SleeperGem' Supply Chain Attack Hits RubyGems via Dormant Accounts

HIGH
July 20, 2026
5m read
Supply Chain AttackMalwareThreat Actor

Related Entities

Products & Tech

RubyGems Microsoft Git Credential Managerfastlane-plugin-run_tests_firebase_testlabDendreoForgejo

Other

SleeperGem

Full Report

Executive Summary

A coordinated software supply chain attack, dubbed SleeperGem, has compromised the RubyGems package registry. Uncovered between July 18 and July 19, 2026, the campaign involved threat actors hijacking long-dormant maintainer accounts to publish malicious versions of legitimate packages. The primary goal was to install a persistent, multi-stage backdoor onto developer workstations. The attack leveraged a malicious dependency, git_credential_manager, which was added to popular gems, including one with over 574,000 downloads, significantly amplifying its reach. This incident highlights the growing threat of account takeovers in open-source registries as a vector for widespread compromise.


Threat Overview

The SleeperGem attack centered on the hijacking of inactive developer accounts on RubyGems, a common repository for Ruby software packages. The attackers used this access to publish trojanized updates to several gems.

  • Malicious Payload: A new gem named git_credential_manager was created to impersonate the legitimate Microsoft Git Credential Manager. This package was the primary malware delivery vehicle.
  • Compromised Gems: At least two other legitimate gems were compromised to add git_credential_manager as a dependency:
    • Dendreo (versions 1.1.3, 1.1.4)
    • fastlane-plugin-run_tests_firebase_testlab (version 0.3.2), a package with over 574,000 total downloads.

This dependency confusion technique caused developers who updated or installed the compromised gems to unknowingly pull in the malicious code. The updates were pushed directly to the registry without corresponding source code commits, making the changes harder to spot.


Technical Analysis

The attack unfolded in multiple stages, demonstrating increasing sophistication.

  1. Initial Compromise: The attackers gained control of dormant RubyGems accounts, such as "LR-DEV" and "pinkroom". (T1195.001 - Compromise Software Dependencies and Development Tools).
  2. Dropper Payload: The malicious git_credential_manager gem acted as a first-stage dropper. Early versions fetched a second-stage payload from an attacker-controlled Forgejo (a Git service) host. Later versions embedded the execution logic directly, triggered by a simple require statement.
  3. Evasion: The malicious code included checks to determine if it was running in a CI/CD or automated build environment. If so, it would abort execution, indicating a clear intent to target developer machines specifically and evade automated security scanning (T1480.001 - Virtualization/Sandbox Evasion: System Checks).
  4. Persistence and Privilege Escalation: Once on a developer's machine, the second-stage payload established persistence using both systemd services and cron jobs (T1543.002 - Create or Modify System Process: Systemd Service, T1547.006 - Boot or Logon Autostart Execution: Cron). It also attempted to escalate privileges by installing a setuid root shell at /usr/local/sbin/ping6, giving the attacker persistent root access (T1548.003 - SUID and SGID).

Impact Assessment

Any developer machine that installed the malicious versions of the affected gems should be considered fully compromised. The impact is severe:

  • Credential Theft: The backdoor provides attackers with access to the developer's machine, allowing them to steal SSH keys, API tokens, passwords, and other secrets stored locally.
  • Code Poisoning: An attacker with access to a developer's machine can inject malicious code into the company's private source code repositories, leading to a much larger supply chain compromise.
  • Lateral Movement: The compromised developer machine can be used as a pivot point to move laterally within the corporate network.
  • Loss of Trust: Such attacks erode trust in the open-source ecosystem and place a significant burden on developers to vet every dependency.

IOCs — Directly from Articles

Type
file_name
Value
git_credential_manager
Description
Malicious gem impersonating Microsoft's tool. Versions 2.8.0 - 2.8.3 are malicious.
Type
file_name
Value
Dendreo
Description
Legitimate gem with malicious versions 1.1.3 and 1.1.4.
Type
file_name
Value
fastlane-plugin-run_tests_firebase_testlab
Description
Legitimate gem with malicious version 0.3.2.

Cyber Observables — Hunting Hints

Security teams and developers should hunt for the following activity:

Type
File Path
Value
/usr/local/sbin/ping6
Description
Check for the existence of this file and if it has the setuid bit enabled.
Type
Service Name
Value
systemd user services
Description
Look for newly created or suspicious systemd services in user directories (~/.config/systemd/user/).
Type
Log Source
Value
cron logs
Description
Review cron logs for the creation of new, unexpected cron jobs.
Type
Network Traffic
Value
Outbound to Forgejo hosts
Description
Monitor for network connections from developer machines to unknown or untrusted Forgejo or Gitea instances.
Type
Command Line Pattern
Value
gem install git_credential_manager
Description
Search shell history and build logs for the installation of the malicious gem.

Detection & Response

  1. Dependency Scanning: Use dependency scanning tools to check Gemfile.lock for the presence of the malicious packages and versions. Immediately remove them if found.
  2. System Investigation: If a malicious gem is found, the host must be considered compromised. Isolate the machine from the network and perform a full forensic investigation. Look for the persistence mechanisms (systemd, cron) and the setuid binary.
  3. Credential Rotation: All credentials on the compromised machine must be rotated, including SSH keys, GPG keys, API tokens, and browser-stored passwords.
  4. Code Review: Review all recent code commits made from the compromised machine to ensure no malicious code was injected into source code repositories.

Mitigation

  1. Use Lockfiles: Always use Gemfile.lock to ensure repeatable builds and prevent unexpected updates to dependencies. This is a form of D3FEND's D3-ACH: Application Configuration Hardening.
  2. Vet Dependencies: Before adding a new dependency, vet the package. Check its download history, maintainer activity, and issue tracker. Be wary of packages from new or long-inactive maintainers.
  3. Principle of Least Privilege: Developers should not run builds or package management tools with root privileges. Run development tasks as a non-privileged user to limit the impact of a compromised dependency.
  4. Enable MFA on Registries: Maintainers should secure their RubyGems accounts with multi-factor authentication to prevent takeovers. This aligns with D3FEND's D3-MFA: Multi-factor Authentication.

Timeline of Events

1
July 18, 2026
The SleeperGem supply chain attack was first uncovered.
2
July 20, 2026
This article was published

MITRE ATT&CK Mitigations

Using dependency lockfiles (e.g., Gemfile.lock) to pin package versions prevents the automatic installation of newly published malicious versions.

Mapped D3FEND Techniques:

Package maintainers should enable MFA on their registry accounts to prevent takeovers, which was the root cause of this attack.

Mapped D3FEND Techniques:

Audit

M1047enterprise

Auditing developer endpoints for signs of compromise, such as unexpected cron jobs or systemd services, is crucial for detection.

Mapped D3FEND Techniques:

Enforcing the principle of least privilege on developer machines limits the ability of malware to gain persistence or escalate privileges.

Mapped D3FEND Techniques:

D3FEND Defensive Countermeasures

Enforce the use of dependency lockfiles (Gemfile.lock in the Ruby ecosystem) across all development projects. This is a critical configuration hardening step that pins the exact versions of all dependencies. By doing so, running a package installation command like bundle install will only install the specific, vetted versions listed in the lockfile. This prevents the build system from automatically fetching a newer, potentially malicious version of a dependency like fastlane-plugin-run_tests_firebase_testlab:0.3.2. CI/CD pipelines should be configured to use the --frozen or --deployment flag, which causes the build to fail if the Gemfile.lock is out of sync, ensuring that only explicitly approved package versions are ever used in automated builds.

Integrate dynamic analysis or sandboxing into the CI/CD pipeline for testing new or updated dependencies before they are approved for developer use. When a developer proposes adding or updating a gem, the pipeline should automatically pull the package into an isolated sandbox environment. In this environment, the tool would install the gem and monitor its behavior during execution. For the SleeperGem attack, this sandbox would detect suspicious activities like network callouts to an unknown Forgejo host, attempts to write to system directories like /usr/local/sbin/, or attempts to create systemd or cron persistence mechanisms. This provides a behavioral safety net to catch malicious packages that pass static analysis, especially those with evasive logic.

Organizations that maintain open-source packages must enforce a mandatory policy for all maintainers to enable multi-factor authentication (MFA) on their RubyGems, GitHub, and other registry accounts. The root cause of the SleeperGem attack was the takeover of dormant accounts that were likely protected only by a password. By requiring a second factor (e.g., TOTP app, security key), the risk of account hijacking is dramatically reduced. Organizations can use tools to audit their developers' account security settings on public platforms and enforce this policy through internal guidelines and regular checks. This shifts the defense 'left' to prevent the initial compromise of the supply chain itself.

Timeline of Events

1
July 18, 2026

The SleeperGem supply chain attack was first uncovered.

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Editorial Standards & Analyst Review

CyberNetSec.io uses automation to assist source monitoring, deduplication, observable extraction, and structured intelligence generation. Published analysis follows human-defined editorial standards and adds defensive context including MITRE ATT&CK, D3FEND, STIX, and Sigma where applicable. Read our editorial policy.

Tags

Supply ChainRubyGemsBackdoorDeveloper SecuritySleeperGemTyposquatting

📢 Share This Article

Help others stay informed about cybersecurity threats

🎯 MITRE ATT&CK Mapped

Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.

🧠 Enriched & Analyzed

Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.

🛡️ Actionable Guidance

Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.

🔗 STIX Visualizer

Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.

Sigma Generator

Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.