Cybersecurity researchers have identified a peculiar campaign named GemStuffer that misuses the RubyGems package registry in a novel fashion. Unlike typical supply chain attacks that aim to distribute malware to developers, this campaign uses the registry itself as a data exfiltration and storage layer. The threat actors have published over 150 malicious packages containing scripts that scrape data from various U.K. local government websites. This scraped data is then packaged into new, valid .gem files and uploaded back to the RubyGems repository. This technique effectively turns the public registry into a free, distributed database for the attackers' scraped content. The discovery highlights the creative ways threat actors can abuse legitimate public infrastructure for their own purposes.
.gem archive.The GemStuffer campaign demonstrates a unique abuse of a trusted ecosystem's features. The core technique is a form of Exfiltration Over Web Service.
.gem archive (T1074 - Data Staged).gem push command is used to upload the data-laden package to the RubyGems repository. The registry's own content delivery network (CDN) then serves this data, effectively providing free, reliable, and distributed storage for the attacker (T1567.002 - Exfiltration to Cloud Storage).While this specific campaign did not directly harm developers, it has several negative consequences:
No specific Indicators of Compromise (IPs, domains, package names) were mentioned in the source articles.
For package registry maintainers and security researchers:
Package registry maintainers should implement auditing and anomaly detection to identify abuse patterns like high-volume uploads from new accounts.
Implement stricter policies for new accounts, such as rate limiting or manual review for initial publications, to deter automated abuse.
For package registries like RubyGems, implementing automated file analysis on all new package submissions is crucial for detecting abuse like the GemStuffer campaign. This analysis should go beyond simple malware scanning. It should analyze the package structure and content, looking for anomalies. For example, a rule could flag any package where over 90% of the file size is non-code data. Another rule could scan for and flag the presence of hardcoded strings that look like API keys or authentication tokens. By analyzing the characteristics of the files being uploaded, the registry can build a profile of normal vs. abusive behavior and automatically flag or block suspicious submissions, reducing the pollution of the ecosystem.
To combat the automated creation of accounts and packages, RubyGems and other registries should implement authentication and activity event thresholding. This involves setting limits and triggering alerts based on the rate of certain activities. For example, a rule could be 'Alert if a single IP address creates more than 5 new accounts in an hour' or 'Temporarily block a new account if it attempts to publish more than 10 packages within its first 24 hours.' This forces automated abuse campaigns to slow down, making them less effective and easier to detect. It also provides a strong signal to security teams that a particular account or IP block is likely engaged in malicious activity and warrants investigation.
This campaign highlights a new form of resource abuse. Registries can defend against this by analyzing resource access patterns. A legitimate package is expected to be published once and then downloaded many times. The GemStuffer packages exhibit the opposite pattern: they are published and then rarely, if ever, downloaded. By analyzing the ratio of downloads to publications for a given user or package series, the registry can identify outliers that are not being used as intended. A user who publishes 150 packages that collectively receive only a handful of downloads is almost certainly not a legitimate contributor. This pattern analysis can be used to automatically flag accounts for review or suspension.

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.
Help others stay informed about cybersecurity threats
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.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
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 detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.