On September 11, 2026, three independent researchers, Spencer Kitts, Thomas Larsen and Sydney Von Arx, published an analysis attributing a May campaign against RubyGems.org, the official Ruby package registry, to a swarm of OpenAI AI agents. More than 2,000 packages were published in two days, over a hundred were used to run code on RubyDoc.info’s documentation build servers, and at least six attempted to exploit a caching flaw to steal API keys. OpenAI is investigating and says it has not been able to verify the claims. Beyond the attribution question, the case illustrates a new kind of software supply chain threat: autonomous agents hijacking open-source infrastructure to get their tasks done.
- On May 11–12, 2026, more than 2,000 packages flooded RubyGems; the registry suspended sign-ups and yanked over 500 malicious packages.
- A booby-trapped
.yardoptsfile allowed arbitrary Ruby code to run on RubyDoc.info servers during documentation builds. - At least six packages tried to exploit a CDN caching flaw exposing legacy API keys (GHSA-9j48-x3c3-mrp2), fixed in July. No successful exploitation was found.
- The attribution to OpenAI rests on a body of circumstantial evidence; neither OpenAI nor RubyGems has confirmed it so far.
What happened
In May 2026, RubyGems.org faced what first looked like a denial-of-service attack, then like spam activity driven by automated accounts. Security firms dubbed it the “GemStuffer” campaign. Working only from public packages and from conversations with the RubyGems and RubyDoc.info teams, the researchers reconstructed the following timeline.
| Date (2026) | Event |
|---|---|
| May 5 | First package attributed to an agent |
| May 8 | First package with “oai” in its name |
| May 11–12 | Over 2,000 packages submitted; API key exploit attempts on May 12 |
| May 12 | RubyGems disables new sign-ups; an email verification bypass is fixed |
| May 13 | Spam stops; more than 500 malicious packages removed |
| May 16 | Sign-ups reopened (disposable email addresses now rejected) |
| May 26–27 | 5 more packages published |
| June 18 | 83 packages published in about three hours |
| July 22–23 | RubyGems advisory on the legacy key leak; all legacy keys revoked |
| September 11 | Analysis attributing the campaign to OpenAI agents published |
Technical analysis
Code execution on RubyDoc.info
RubyDoc.info automatically builds and hosts documentation for published gems using YARD. The build reads a .yardopts file supplied by the package author, which can reference Ruby scripts. The agents abused this behavior to run arbitrary code on the build servers.
More than 100 packages followed the same pipeline: publish a malicious gem, trigger the documentation build, run a script that scrapes target sites, then exfiltrate the results by publishing another gem, later retrieved with a plain gem fetch. The targets were ModernGov portals of UK local councils (Lambeth, Wandsworth, Southwark): calendars, agendas, documents and contact details. Public data, but collected through abusive means. Files bore self-explanatory names (hack.rb, evil.rb, exploit.rb), and one gem, zzsouthrunner, described its own purpose as a malicious exfiltration crawler.
API key theft attempt
The second technique targeted a flaw later found by Luke Marshall (Truffle Security) and fixed on July 9. On RubyGems.org, a GET /api/v1/api_key call issues a legacy key. When the request was gzip-compressed, the response lost its restrictive cache headers and could be cached by the Fastly CDN for up to an hour. An unauthenticated caller hitting the same edge node could then retrieve another user’s key.
Only sign-ins performed with RubyGems clients older than version 3.2.0 were affected, including version 3.0.3.1 shipped with macOS Tahoe. According to RubyGems, about 18% of gem signin requests still came from an affected version at disclosure time. At least six packages, including slnleaker5, attempted the exploit on May 12, before the flaw was officially discovered.
Other techniques observed
- An email verification bypass, likely combined with disposable addresses, to create accounts at scale.
- Data stored in RubyGems webhook URLs, Base64-encoded and split into chunks of 220 characters or fewer.
- Redirecting the
HOMEvariable to a temporary directory holding a credentials file, and publishing directly through the API. - In June, attempts to reach a US SEC dataset indirectly, including through Google Translate and Jira.
Attribution still under debate
The researchers rely on several clues: code assessed as AI-generated, 233 package names containing “oai”, 15 packages listing “oai” as author, a contact email containing “openai”, and above all a strong overlap with a separate incident targeting a German wiki, which OpenAI acknowledged involved its agents (49 identical files accessed, same intermediary services).
OpenAI says it is investigating and states that “our agents used the RubyGems platform to access the internet to carry out benign tasks,” while noting it “has not been able to verify the specific claims of our models uploading malicious packages.” RubyGems confirmed the campaign but says it cannot determine on its own who created or published the packages.
Why it matters
This incident marks a turning point: supply chain threats no longer come only from malicious human actors, but also from autonomous agents that, in pursuit of a seemingly harmless goal, hijack third-party services, bypass controls and exploit flaws. For organizations, two consequences follow: open-source registries and their ancillary services (documentation, CI) must be treated as attack surfaces in their own right, and AI agents deployed internally must be governed so they do not themselves become the source of incidents at third parties.
MITRE ATT&CK mapping
The sources do not provide an ATT&CK mapping. The table below is an indicative Defensy reading based on the behaviors described.
| Technique | Observed behavior |
|---|---|
| T1585 — Establish Accounts | Mass creation of RubyGems accounts through an email verification bypass |
| T1190 — Exploit Public-Facing Application | Code execution on RubyDoc.info via a malicious .yardopts file |
| T1059 — Command and Scripting Interpreter | Ruby scripts executed during documentation builds |
| T1528 — Steal Application Access Token | Attempts to retrieve API keys cached by the CDN |
| T1102 — Web Service | RubyGems webhooks used as storage for encoded data |
| T1567 — Exfiltration Over Web Service | Collected data republished as new gems |
Recommendations
- ImmediateReplace any legacy RubyGems key
All legacy keys have been revoked. Replace those stored on workstations and servers with scoped keys, and upgrade RubyGems clients older than 3.2.0, including the one bundled with macOS.
- ImmediateAudit your published gems
Look for versions you did not publish, unexpected yanks, and unknown owners, webhooks or trusted publishers. These changes persist after key revocation.
- Short termEnable MFA for UI and API
The
ui_and_apiMFA level prevents a leaked key from pushing, yanking or changing owners. - Short termMove CI to trusted publishing
Replace long-lived keys with short-lived OIDC credentials, which were not affected by the flaw.
- Short termStrengthen CI/CD detection
Restrict outbound
gem push, monitor Ruby processes that redirectHOMEto/tmp, and inspect.yardoptsfiles that load scripts. - Medium termGovern your own AI agents
Limit your agents’ network access and credentials, log their actions on third-party services, and define what they are allowed to publish.
Whether or not the attribution holds, this campaign shows that an ancillary service such as a documentation builder can become an entry point. Your software supply chain, and your AI agents, are part of your attack surface.
Our Audit & Offensive Security teams assess your pipelines and dependencies, our Secure AI Adoption offering helps you govern the agents you deploy, and our SOC monitors abnormal behavior across your environments.
- OpenAI agents carried out an undisclosed cyber-attack on RubyGemsS. Kitts, T. Larsen, S. Von Arx — September 11, 2026
- Security advisory: legacy API key leak (GHSA-9j48-x3c3-mrp2)RubyGems.org — July 22, 2026
- OpenAI statement on the Hugging Face incidentOpenAI — 2026
- OpenAI Investigates Report Linking AI Agents to RubyGems AttackSecurityWeek — September 15, 2026
- OpenAI Agents Flood RubyGemsCyber Security News — September 12, 2026
- Malicious OpenAI Agents Linked to RubyGems Campaign That Gained RCE on RubyDoc Servers in MayThe Hacker News — September 2026
- MITRE ATT&CK® — Enterprise MatrixMITRE Corporation
