Skip to content

Ruby gems support - #9

Merged
adamtty merged 2 commits into
mainfrom
ruby-gems
Oct 20, 2026
Merged

adamtty merged 2 commits into
mainfrom
ruby-gems

Conversation

@adamtty

@adamtty adamtty commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Adds Ruby gems in all three places pkgdash looks at packages.

gem manager (new card and page)

  • Homebrew Ruby's gems, including Ruby's own default and bundled gems (marked as such). macOS's /usr/bin/ruby is left alone, like its Python.
  • Scan: gem outdated; release dates for the cooldown from rubygems.org.
  • Audit and malware check: OSV, against every installed version (old versions stay installed after an update, so they're checked too).
  • Update: gem install <gem> --version <scanned version> --conservative --no-document, behind the usual malware and cooldown gate. Names and versions are validated before they reach the command.

Projects: Gemfile.lock is read (GEM sections only; GIT/PATH sources and the project's own gems are skipped). Fixing it is refused on purpose: bundle lock evaluates the project's Gemfile, which is Ruby code, and pkgdash's fixes never run project code.

Docker: gems inside images (specifications/*.gemspec), also checked against OSV's malware list. The per-image cache is versioned so images already read get read again once.

Tested against a real Homebrew Ruby (84 gems, 44 outdated; the audit found a real advisory in json 2.18.0). New unit tests cover the manager, Gemfile.lock parsing including hostile input, and Docker gemspecs. The Atheris fuzzer picks up the new parser from LOCKFILES automatically, with a new seed.

Ruby's own gems (default and bundled) only count as outdated when OSV knows a vulnerability in the installed version, since brew upgrade ruby updates them too. The rest show their newer version with an update button, stay out of the counts and update-all, and are still held by the cooldown and malware check. On a real Homebrew Ruby: 1 outdated (json, vulnerable) instead of 44.

…ages

- gem manager: Homebrew Ruby's gems, including the ones that ship with
  Ruby (marked as default or bundled). Outdated from gem outdated,
  release dates from rubygems.org, CVEs and malware from OSV for every
  installed version. Updates install the exact version the scan saw,
  with --conservative so dependencies that already fit stay put. macOS's
  own Ruby is left alone.
- Projects: Gemfile.lock (registry gems only; GIT and PATH sources are
  skipped, platform builds fold into one version). It isn't fixable:
  Bundler would run the project's Gemfile, which is Ruby code.
- Docker: gems found from specifications/*.gemspec, with the image cache
  versioned so already-read images are read again once.
Default and bundled gems also get newer with brew upgrade ruby, so 43
of the 44 outdated gems on a fresh Homebrew Ruby were noise. A newer
release of one now only counts when OSV knows a vulnerability in the
installed version (one querybatch per scan; if OSV can't be reached
they all count, as before). The rest are marked newer: shown with
their new version and an update button, kept out of the outdated
counts and update-all, and still held by the cooldown and the
malware check.
@adamtty
adamtty merged commit 9d56bbf into main Oct 20, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant