rails-active-storage-pro promised better Active Storage adapters. Its README was lifted almost word for word from the Rails guides, which is exactly why nobody questioned it.
Boot time was the attack
The railtie registered itself, read config/credentials.yml.enc, decrypted it with config/master.key, and posted the plaintext to a collector — all before our app was listening on a port.
Why review missed it
The diff was four lines in the Gemfile plus a lockfile we approve without reading. The gem shipped a changelog, typed signatures and a rake task suite. It looked more maintained than half our dependencies.
Consequences
Stripe keys, an SMTP password and two third-party API tokens. We rotated the master key, re-encrypted credentials and spent a day verifying no charges were made. One subscription upgrade came close: an attacker raised a customer's plan and refunded them to test the keys.
Rule added
Any gem that touches credentials or boots a railtie gets a read of its source before merge. It is a ten-minute habit that would have prevented a two-day fire drill.