Module: Parse::Stack::ActiveSupportAdvisory

Defined in:
lib/parse/stack/active_support_advisory.rb

Overview

Load-time check for ActiveSupport releases affected by the 2026 ActiveSupport security advisories (GHSA-8474-xrp6-wh69 and GHSA-2w9f-fxwj-w2qf). The fixes are 8.0.5.2 and 8.1.4.1; the 6.1 and 7.x lines have no fixed release. The gemspec keeps those lines installable, so a vulnerable release is reported here instead of being refused at install time. ActiveModel is versioned in lockstep with ActiveSupport, so checking ActiveSupport covers both.

Constant Summary collapse

FIXED =

Lowest fixed release per affected minor line. Every release below the 8.0 fix is affected, including the unfixed 6.1 and 7.x lines.

{ "8.0" => "8.0.5.2", "8.1" => "8.1.4.1" }.freeze

Class Method Summary collapse

Class Method Details

.check!(version = nil) ⇒ Boolean

Warn once when the loaded ActiveSupport release is vulnerable.

Parameters:

  • version (String, Gem::Version, nil) (defaults to: nil) —

    defaults to the activated activesupport gem's version.

Returns:

  • (Boolean) —

    true when a warning was printed



35
36
37
38
39
40
41
42
43
44
# File 'lib/parse/stack/active_support_advisory.rb', line 35

def check!(version = nil)
  version ||= Gem.loaded_specs["activesupport"]&.version
  return false if version.nil? || @warned
  return false unless vulnerable?(version)
  @warned = true
  warn "[parse-stack-next] ActiveSupport #{version} is affected by the 2026 " \
       "ActiveSupport security advisories. Upgrade to ActiveSupport 8.1.4.1 or " \
       "later (or 8.0.5.2 or later on the 8.0 line; 6.1 and 7.x have no fixed release)."
  true
end

.vulnerable?(version) ⇒ Boolean

Whether an ActiveSupport version is a known-vulnerable release.

Parameters:

  • version (String, Gem::Version)

Returns:

  • (Boolean)


23
24
25
26
27
28
29
# File 'lib/parse/stack/active_support_advisory.rb', line 23

def vulnerable?(version)
  v = Gem::Version.new(version.to_s)
  line = v.segments.first(2).join(".")
  fixed = FIXED[line]
  return v < Gem::Version.new(fixed) if fixed
  v < Gem::Version.new(FIXED["8.0"])
end