activestorage 7.2.3.1 → 7.2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07e918ed2ad2733425a8c83bcd4a17b0de42f1b4e4692f0ac60f37886a2b1982
4
- data.tar.gz: 8ec0faa694ef8191678280d2f5ed44b8a3d623788e2239013a43a33c25e0f754
3
+ metadata.gz: 8d9ba18be252a1779cf9e9bb80dfdea0a23601c5e396c559285f0dac62a93d68
4
+ data.tar.gz: f2d0022eb4a41e9e22b94dee0acbfe65d8983b6c74408d3cd4480949064136d4
5
5
  SHA512:
6
- metadata.gz: 71e330a9f27d46bdd58c56f7bf4ead818b549c899e5aca043f895b4377b0478b25499c05ec39392e4fcbf5c3eaa8e85f5ada5000d3f2c01ae84badeed4591326
7
- data.tar.gz: bb8ce35c75e8a43bdc135ddac20b94928bdbc1365b3351e7570f72c566001906506ecd32a98cde9fd3e47a1b8726058d235ce413afeac31a6d874ff9687d8096
6
+ metadata.gz: 6a75369b13ef789b1b68cf8f6ec54b91b94f09208fae23c2df39d5bdf9c2f0f8f078fcea74013235d737ac4bfb618517618694f18f473bb2807612c623b44411
7
+ data.tar.gz: 2b9bdd8c74524d0669a42330326253a0d21f00a3a6ab560db46f68d3ef7824cb8e858a6ac225de29932ad3755af238708a7ddbbda8562e07764b4208d204e7d8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ ## Rails 7.2.3.2 (July 29, 2026) ##
2
+
3
+ * Disable libvips's unfuzzed image loaders and savers.
4
+
5
+ libvips flags some of its loaders and savers as "unfuzzed" or "untrusted", meaning they are only
6
+ safe for trusted content. Active Storage will call `Vips.block_untrusted(true)` to disable them
7
+ while booting. An application that needs a specific loader or saver may re-enable it in an
8
+ initializer.
9
+
10
+ This is a breaking change for applications that process image types with an unfuzzed loader or
11
+ saver. Variant transformation of BMP, ICO, and PSD attachments will raise `Vips::Error`, and
12
+ analysis of these and other types such as SVG, JPEG XL, JPEG 2000, and Netpbm will no longer
13
+ record `width` and `height`. Requesting an unfuzzed output format, typically FITS, JXL, or
14
+ anything delegated to ImageMagick, will also raise `Vips::Error`. Attaching, storing, and
15
+ downloading are unchanged.
16
+
17
+ An application seeing `Vips::Error` raised during image transformation may wish to remove the
18
+ affected content types from `config.active_storage.variable_content_types` in an initializer.
19
+ Active Storage will then treat those attachments as not variable and will not generate variants
20
+ for them. This most often matters to an application that transforms images during a request
21
+ rather than in a background job, where the failure surfaces as an error response instead of a
22
+ failed job.
23
+
24
+ ```ruby
25
+ Rails.application.config.active_storage.variable_content_types -=
26
+ %w[ image/bmp image/vnd.microsoft.icon image/vnd.adobe.photoshop ]
27
+ ```
28
+
29
+ Applications using the `:mini_magick` variant processor will see no change in how their
30
+ attachments are processed, but the loaders and savers will be disabled process-wide whenever
31
+ ruby-vips is installed, and the version requirements below will still apply. Such an application
32
+ may remove ruby-vips from its Gemfile to avoid both.
33
+
34
+ The minimum supported version of libvips is now 8.13, and the minimum supported version of
35
+ ruby-vips is now 2.2.1. These are the earliest versions that are capable of disabling untrusted
36
+ operations. When ruby-vips is installed and either minimum is not met, Active Storage will raise
37
+ a `RuntimeError` while booting rather than run in an unsecurable environment.
38
+
39
+ [GHSA-xr9x-r78c-5hrm]
40
+ [CVE-2026-66066]
41
+
42
+ *Mike Dalessio*
43
+
1
44
  ## Rails 7.2.3.1 (March 23, 2026) ##
2
45
 
3
46
  * Filter user supplied metadata in DirectUploadController
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_storage/vips"
4
+
3
5
  module ActiveStorage
4
6
  # This analyzer relies on the third-party {ruby-vips}[https://github.com/libvips/ruby-vips] gem. Ruby-vips requires
5
7
  # the {libvips}[https://libvips.github.io/libvips/] system library.
@@ -10,7 +10,7 @@ module ActiveStorage
10
10
  MAJOR = 7
11
11
  MINOR = 2
12
12
  TINY = 3
13
- PRE = "1"
13
+ PRE = "2"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_storage"
4
+ require "active_support/core_ext/string/filters"
5
+
6
+ begin
7
+ require "nokogiri"
8
+ rescue LoadError
9
+ # Ensure nokogiri is loaded before vips, which also depends on libxml2.
10
+ # See Nokogiri RFC: Stop exporting symbols:
11
+ # https://github.com/sparklemotion/nokogiri/discussions/2746
12
+ end
13
+
14
+ begin
15
+ gem "ruby-vips"
16
+ require "ruby-vips"
17
+ ActiveStorage::VIPS_AVAILABLE = true # :nodoc:
18
+ rescue LoadError => error
19
+ ActiveStorage::VIPS_AVAILABLE = false # :nodoc:
20
+ raise error unless error.message.match?(/libvips|ruby-vips/)
21
+ end
22
+
23
+ if ActiveStorage::VIPS_AVAILABLE
24
+ begin
25
+ # image_processing 2.0 calls Vips.block_untrusted(true) itself when it loads, so it has to load
26
+ # before the lines below. Leaving it to load later, when the transformer first asks for it,
27
+ # would disable the loaders again after an application's initializers had re-enabled them.
28
+ require "image_processing/vips"
29
+ rescue LoadError
30
+ # image_processing is only needed to generate variants, not to analyze blobs.
31
+ end
32
+
33
+ unless Vips.respond_to?(:block_untrusted)
34
+ raise <<~ERROR.squish
35
+ libvips's unfuzzed operations are not safe to use with untrusted content, and Active Storage
36
+ cannot disable them. Disabling them requires libvips 8.13 or later and ruby-vips 2.2.1 or
37
+ later. Please upgrade libvips and ruby-vips, or remove the ruby-vips gem from your Gemfile.
38
+ ERROR
39
+ end
40
+
41
+ Vips.block_untrusted(true)
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.3.1
4
+ version: 7.2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -15,56 +15,56 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 7.2.3.1
18
+ version: 7.2.3.2
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 7.2.3.1
25
+ version: 7.2.3.2
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: actionpack
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 7.2.3.1
32
+ version: 7.2.3.2
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 7.2.3.1
39
+ version: 7.2.3.2
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: activejob
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - '='
45
45
  - !ruby/object:Gem::Version
46
- version: 7.2.3.1
46
+ version: 7.2.3.2
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 7.2.3.1
53
+ version: 7.2.3.2
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: activerecord
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '='
59
59
  - !ruby/object:Gem::Version
60
- version: 7.2.3.1
60
+ version: 7.2.3.2
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - '='
66
66
  - !ruby/object:Gem::Version
67
- version: 7.2.3.1
67
+ version: 7.2.3.2
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: marcel
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -183,16 +183,17 @@ files:
183
183
  - lib/active_storage/transformers/image_processing_transformer.rb
184
184
  - lib/active_storage/transformers/transformer.rb
185
185
  - lib/active_storage/version.rb
186
+ - lib/active_storage/vips.rb
186
187
  - lib/tasks/activestorage.rake
187
188
  homepage: https://rubyonrails.org
188
189
  licenses:
189
190
  - MIT
190
191
  metadata:
191
192
  bug_tracker_uri: https://github.com/rails/rails/issues
192
- changelog_uri: https://github.com/rails/rails/blob/v7.2.3.1/activestorage/CHANGELOG.md
193
- documentation_uri: https://api.rubyonrails.org/v7.2.3.1/
193
+ changelog_uri: https://github.com/rails/rails/blob/v7.2.3.2/activestorage/CHANGELOG.md
194
+ documentation_uri: https://api.rubyonrails.org/v7.2.3.2/
194
195
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
195
- source_code_uri: https://github.com/rails/rails/tree/v7.2.3.1/activestorage
196
+ source_code_uri: https://github.com/rails/rails/tree/v7.2.3.2/activestorage
196
197
  rubygems_mfa_required: 'true'
197
198
  rdoc_options: []
198
199
  require_paths:
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
209
  - !ruby/object:Gem::Version
209
210
  version: '0'
210
211
  requirements: []
211
- rubygems_version: 4.0.6
212
+ rubygems_version: 4.0.16
212
213
  specification_version: 4
213
214
  summary: Local and cloud file storage framework.
214
215
  test_files: []