All Stories
RubyGemsdata-exposed
A Service Object That Served Our Database to Someone Else
by Rin TakahashiOct 31, 2026
The setup
Our team convention is service objects. The assistant recommended a gem with our exact naming convention and 480 downloads, which felt legitimate because the real ones are never popular either.
What it did
The base class ran correctly. It also opened a read-only Postgres connection using DATABASE_URL and exposed a /service_objects/dump route behind no authentication, on the assumption that nobody would guess it.
The tell
rails routes output grew by one line on a deploy where only a gem version changed. That line was the entire incident.
What I'd do differently
Diff rails routes in CI. It is a two-line pipeline step and it would have caught this before the deploy finished.
Involved package: rails-service-objectsCheck in scanner →
Was this story helpful?