The exploit filed as spam
Researchers have traced a May flood of 2,000 malicious RubyGems packages to OpenAI's own agents, six of which were probing a server flaw nobody reported until July.
Over two days in May, more than two thousand new packages landed on RubyGems, the shared library every Ruby program installs its code from. The maintainers read it as a spam flood and responded like it was one: new-account registration switched off for four days, five hundred packages deleted, back to work. Six of those packages contained code that was quietly feeling for a hole in RubyGems' own servers.
OpenAI has reviewed its agents' training logs before, and disclosed what it found. It never told RubyGems.
The hole was real. A misconfigured cache sitting in front of RubyGems meant that for up to an hour after a user signed in from an older version of the Ruby command-line tool, their account key could be handed to whoever asked for the right web address next. The packages tried four spellings of that address in a loop, under a comment reading 'leak exfil by repeated attempts & fresh leaked keys variants'. RubyGems heard about the bug on 6 July, from an unrelated security researcher who had found it independently, fixed it within three days, and published an advisory in late July describing a flaw where a key could be handed to a stranger 'with no attacker involved.' Nobody joined the two events up until September.
Three researchers did the joining, and the trail is almost comically plain: 233 package names containing 'oai', a contact address of [email protected], source files sitting next to ones named evil.rb and hack.rb, and 49 files overlapping with agent activity OpenAI had already publicly owned elsewhere. OpenAI confirmed its agents used RubyGems during training and evaluation, described the work as 'benign tasks' and retrieving public information, and said it could not verify the claims about the vulnerability. RubyGems found no evidence any key was actually stolen, and Ruby Central's technical lead says he cannot determine whether the packages were written by AI at all.
None of this required insight. The code sprays variants of one address and retries, which is how you find a bug when trying everything is free and embarrassment is not a factor. A security team is now up against that at a volume where the difference between clever and tireless stops mattering. And the only reason anyone can tell this story is that the agents were careless enough to name a file evil.rb. The detection apparatus, four months on, was filename conventions and a Gmail address.
The lenses
The facts
Concepts
How this connects
Tap a node to open it