Skip to content

Patch gems with published security advisories - #33

Closed
raghubetina wants to merge 1 commit into
mainfrom
security/patch-gem-advisories
Closed

raghubetina wants to merge 1 commit into
mainfrom
security/patch-gem-advisories

Conversation

@raghubetina

Copy link
Copy Markdown
Contributor

Why

bundle-audit reports 30+ advisories against this template's lockfile. The worst is a critical Active Storage arbitrary-file-access issue through ImageMagick (fixed in Rails 8.1.4.1); others include high-severity Action Pack, Active Support, Rack, msgpack, and ransack issues. CI is disabled here, so nothing caught them, and every repo generated from the template inherits them.

Change (patch releases only)

Rails 8.1.3 → 8.1.4.1, Puma 7.2.1 → 7.2.2, Rack 3.2.6 → 3.2.8, Nokogiri 1.19.4 → 1.19.7, msgpack 1.8.3 → 1.8.7, ransack 4.4.1 → 4.4.4, Loofah 2.25.1 → 2.25.3, rails-html-sanitizer 1.7.0 → 1.7.2, addressable 2.9.0 → 2.9.2, crass 1.0.7 → 1.0.8, json 2.21.1 → 2.21.2.

Not fixed: oj 3.13.23 (fix needs ≥ 3.17.3). grade_runner 0.0.16, its newest release, pins oj ~> 3.13.12. It's in the development/test group, so the production image never loads oj; fixing it needs a grade_runner release that relaxes the pin.

Verification

  • bundle-audit check: only the oj advisories remain.
  • bundle exec rspec: 1 example, 0 failures (the template's placeholder).
  • Production image builds and boots: Rails 8.1.4.1, Puma 7.2.2, Nokogiri 1.19.7, Rack 3.2.8.

Existing student repos keep their own lockfiles; this fixes only new repos generated from the template.

bundle-audit reported more than 30 advisories against the template's
lockfile, the worst a critical Active Storage file-access issue through
ImageMagick fixed in Rails 8.1.4.1. The template's CI is disabled, so
nothing caught them, and every student repository generated from it
inherits the vulnerable versions.

Take patch releases only: Rails 8.1.4.1, Puma 7.2.2, Rack 3.2.8,
Nokogiri 1.19.7, msgpack 1.8.7, ransack 4.4.4, and the Loofah,
rails-html-sanitizer, addressable, crass, and json fixes.

oj stays at 3.13.23: grade_runner 0.0.16, the newest release, pins
~> 3.13.12. It is a development/test gem, so the production image
never loads oj.
@bpurinton

Copy link
Copy Markdown
Contributor

I'll take this over. Needs to apply to projects and targets too, and the rails-8-industrial-template.

@bpurinton

Copy link
Copy Markdown
Contributor

This update belongs with project-syncing, since many of these security patches are important for other deployed (target) or deployable (project) repos, not to mention our other rails-8-industrial-template. Really, this work belongs with the updates that we'd like to make with this issue: https://github.com/firstdraft/project-syncing/issues/58

I'm going to use this update here as a test case on project-syncing for a more intelligent syncing workflow. Closing this PR now, but using the description and diff as reference for the updates applied at a higher level, which will filter down to this repo.

@bpurinton bpurinton closed this Nov 19, 2026
@bpurinton
bpurinton deleted the security/patch-gem-advisories branch November 19, 2026 18:46
bpurinton added a commit to firstdraft/grade_runner that referenced this pull request Nov 19, 2026
bundle-audit flagged eleven advisories against oj 3.13.23 in every
Rails 8 project lock, one of them high severity:

  CVE-2026-54592 (GHSA-3m6q-jj5j-38c9)

The rest are heap/stack overflows and use-after-frees in Oj.dump,
Oj.load, Oj::Doc and Oj::Parser. All eleven list the same fix,
"update to '>= 3.17.3'", but grade_runner pinned oj to "~> 3.13.12",
so none of the 103 project repos could take it while they depended on
grade_runner 0.0.16. This was the last blocker in the fleet-wide gem
security patch (appdev-projects/rails-8-template#33,
firstdraft/project-syncing#58).

Move the pin to "~> 3.17", ">= 3.17.3" and release as 0.0.17. The
floor is the exact fixed version; the ~> keeps us off a future oj 4.
Project Gemfiles already say "~> 0.0.16", so they pick this up with
no Gemfile change.

grade_runner only touches oj in two places: Oj.dump writes the RSpec
results in JsonOutputFormatter, and Oj.load reads that file back and
parses Grades responses. To check nothing changed:

- bundle lock --conservative --update grade_runner oj on the
  rails8-phase1 image Gemfile moves only oj (3.13.23 -> 3.17.8, plus
  bigdecimal, already present); bundle-audit then reports nothing.
- A sample suite (pass, fail, pending, error, points, hints, unicode)
  produces identical formatter output under both oj versions,
  ignoring timings; so do the Runner POST body and response parsing.
- grade in a getting-started-with-scaffolds Codespace on Ruby 4.0.5,
  before and after: Grades builds #13 and #14 both read "16 tests,
  16 failures, 0/16 points, 0.0%" with the same examples.

Gemfile.lock is left alone, as in #93: its bundler ~> 2.1.4 dev
dependency no longer resolves on Bundler 4, and consumers resolve
from the gemspec anyway.
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.

2 participants