activestorage 8.1.3 → 8.1.3.1
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 +4 -4
- data/CHANGELOG.md +44 -0
- data/lib/active_storage/analyzer/image_analyzer/vips.rb +1 -16
- data/lib/active_storage/gem_version.rb +1 -1
- data/lib/active_storage/transformers/vips.rb +9 -0
- data/lib/active_storage/vips.rb +44 -0
- metadata +14 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b0ba7028cf3ec69f0c7e7658bf8b03993945ca49fce6c42a4b8f5c3cc4c4eb8
|
|
4
|
+
data.tar.gz: 4524cbbb93d8e113d3af7bb065ed38d7f22b011def59f81f05e2e30862ea198d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b98acaa66a5bb64f6a0845ee8671085e0bef6b51599bb907cb75b02e67f4c088f53d97656448a8f351fb12447352020ffa3a7b7aca63677c90af42eab2de5b16
|
|
7
|
+
data.tar.gz: d48b0a79c83c6bbf5b0eae9c3dd84f1c4c7dc762cc212c92d263a61275dfeabf7915eb4c0dfae46a68fa10b2a2fddc364e108a23b1073b3e6e11dbae19f263b6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
## Rails 8.1.3.1 (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
|
+
|
|
44
|
+
|
|
1
45
|
## Rails 8.1.3 (March 24, 2026) ##
|
|
2
46
|
|
|
3
47
|
* Fix `ActiveStorage::Blob` content type predicate methods to handle `nil`.
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
require "nokogiri"
|
|
5
|
-
rescue LoadError
|
|
6
|
-
# Ensure nokogiri is loaded before vips, which also depends on libxml2.
|
|
7
|
-
# See Nokogiri RFC: Stop exporting symbols:
|
|
8
|
-
# https://github.com/sparklemotion/nokogiri/discussions/2746
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
begin
|
|
12
|
-
gem "ruby-vips"
|
|
13
|
-
require "ruby-vips"
|
|
14
|
-
ActiveStorage::VIPS_AVAILABLE = true # :nodoc:
|
|
15
|
-
rescue LoadError => error
|
|
16
|
-
ActiveStorage::VIPS_AVAILABLE = false # :nodoc:
|
|
17
|
-
raise error unless error.message.match?(/libvips|ruby-vips/)
|
|
18
|
-
end
|
|
3
|
+
require "active_storage/vips"
|
|
19
4
|
|
|
20
5
|
module ActiveStorage
|
|
21
6
|
# This analyzer relies on the third-party {ruby-vips}[https://github.com/libvips/ruby-vips] gem. Ruby-vips requires
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# Do not remove either of these requires.
|
|
4
|
+
#
|
|
5
|
+
# active_storage/vips disables libvips's unfuzzed loaders and savers.
|
|
6
|
+
#
|
|
7
|
+
# active_storage/vips has already loaded image_processing/vips, but requiring it here is what
|
|
8
|
+
# raises LoadError when the gem is missing, which the engine reports as an actionable warning.
|
|
9
|
+
require "active_storage/vips"
|
|
10
|
+
require "image_processing/vips"
|
|
11
|
+
|
|
3
12
|
module ActiveStorage
|
|
4
13
|
module Transformers
|
|
5
14
|
class Vips < ImageProcessingTransformer
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# :markup: markdown
|
|
4
|
+
|
|
5
|
+
require "active_storage"
|
|
6
|
+
require "active_support/core_ext/string/filters"
|
|
7
|
+
|
|
8
|
+
begin
|
|
9
|
+
require "nokogiri"
|
|
10
|
+
rescue LoadError
|
|
11
|
+
# Ensure nokogiri is loaded before vips, which also depends on libxml2.
|
|
12
|
+
# See Nokogiri RFC: Stop exporting symbols:
|
|
13
|
+
# https://github.com/sparklemotion/nokogiri/discussions/2746
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
begin
|
|
17
|
+
gem "ruby-vips"
|
|
18
|
+
require "ruby-vips"
|
|
19
|
+
ActiveStorage::VIPS_AVAILABLE = true # :nodoc:
|
|
20
|
+
rescue LoadError => error
|
|
21
|
+
ActiveStorage::VIPS_AVAILABLE = false # :nodoc:
|
|
22
|
+
raise error unless error.message.match?(/libvips|ruby-vips/)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
if ActiveStorage::VIPS_AVAILABLE
|
|
26
|
+
begin
|
|
27
|
+
# image_processing 2.0 calls Vips.block_untrusted(true) itself when it loads, so it has to load
|
|
28
|
+
# before the lines below. Leaving it to load later, when the transformer is autoloaded, would
|
|
29
|
+
# disable the loaders again after an application's initializers had re-enabled them.
|
|
30
|
+
require "image_processing/vips"
|
|
31
|
+
rescue LoadError
|
|
32
|
+
# image_processing is only needed to generate variants, not to analyze blobs.
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
unless Vips.respond_to?(:block_untrusted)
|
|
36
|
+
raise <<~ERROR.squish
|
|
37
|
+
libvips's unfuzzed operations are not safe to use with untrusted content, and Active Storage
|
|
38
|
+
cannot disable them. Disabling them requires libvips 8.13 or later and ruby-vips 2.2.1 or
|
|
39
|
+
later. Please upgrade libvips and ruby-vips, or remove the ruby-vips gem from your Gemfile.
|
|
40
|
+
ERROR
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Vips.block_untrusted(true)
|
|
44
|
+
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: 8.1.3
|
|
4
|
+
version: 8.1.3.1
|
|
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: 8.1.3
|
|
18
|
+
version: 8.1.3.1
|
|
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: 8.1.3
|
|
25
|
+
version: 8.1.3.1
|
|
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: 8.1.3
|
|
32
|
+
version: 8.1.3.1
|
|
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: 8.1.3
|
|
39
|
+
version: 8.1.3.1
|
|
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: 8.1.3
|
|
46
|
+
version: 8.1.3.1
|
|
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: 8.1.3
|
|
53
|
+
version: 8.1.3.1
|
|
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: 8.1.3
|
|
60
|
+
version: 8.1.3.1
|
|
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: 8.1.3
|
|
67
|
+
version: 8.1.3.1
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: marcel
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -186,16 +186,17 @@ files:
|
|
|
186
186
|
- lib/active_storage/transformers/transformer.rb
|
|
187
187
|
- lib/active_storage/transformers/vips.rb
|
|
188
188
|
- lib/active_storage/version.rb
|
|
189
|
+
- lib/active_storage/vips.rb
|
|
189
190
|
- lib/tasks/activestorage.rake
|
|
190
191
|
homepage: https://rubyonrails.org
|
|
191
192
|
licenses:
|
|
192
193
|
- MIT
|
|
193
194
|
metadata:
|
|
194
195
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
195
|
-
changelog_uri: https://github.com/rails/rails/blob/v8.1.3/activestorage/CHANGELOG.md
|
|
196
|
-
documentation_uri: https://api.rubyonrails.org/v8.1.3/
|
|
196
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.1.3.1/activestorage/CHANGELOG.md
|
|
197
|
+
documentation_uri: https://api.rubyonrails.org/v8.1.3.1/
|
|
197
198
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
198
|
-
source_code_uri: https://github.com/rails/rails/tree/v8.1.3/activestorage
|
|
199
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.1.3.1/activestorage
|
|
199
200
|
rubygems_mfa_required: 'true'
|
|
200
201
|
rdoc_options: []
|
|
201
202
|
require_paths:
|
|
@@ -211,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
211
212
|
- !ruby/object:Gem::Version
|
|
212
213
|
version: '0'
|
|
213
214
|
requirements: []
|
|
214
|
-
rubygems_version: 4.0.
|
|
215
|
+
rubygems_version: 4.0.16
|
|
215
216
|
specification_version: 4
|
|
216
217
|
summary: Local and cloud file storage framework.
|
|
217
218
|
test_files: []
|