actionpack 6.1.6.1 → 6.1.7.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/lib/action_controller/metal/rendering.rb +2 -2
- data/lib/action_dispatch/http/cache.rb +1 -1
- data/lib/action_dispatch/middleware/cookies.rb +28 -20
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4107f5fba7b90edb4afcece0aa0385b389fb23da225efc2aba13a86ead23341c
|
4
|
+
data.tar.gz: 323e775ec5de154afdf6de51a389e638b71915f48fcf7a1208b69d8516e62afc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 340f3105ef24c07076a07e88b87fff47eea21e0ab069cfbb5cf7b901a66300a2a5268a107adbf967a7b16b7ef355bb020d104474a3ae11c30b296537c6eb4c96
|
7
|
+
data.tar.gz: feb2ea4345ccc52cc46da724bd10d0390fb3ca87588212f15911bd0f28678600dcb4cd7d9bd4910d604e3457fe0f85add3dc83ef0e13d1326a0da4aa6c0616ef
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,38 @@
|
|
1
|
+
## Rails 6.1.7.2 (January 24, 2023) ##
|
2
|
+
|
3
|
+
* Fix `domain: :all` for two letter TLD
|
4
|
+
|
5
|
+
This fixes a compatibility issue introduced in our previous security
|
6
|
+
release when using `domain: :all` with a two letter but single level top
|
7
|
+
level domain domain (like `.ca`, rather than `.co.uk`).
|
8
|
+
|
9
|
+
|
10
|
+
## Rails 6.1.7.1 (January 17, 2023) ##
|
11
|
+
|
12
|
+
* Avoid regex backtracking on If-None-Match header
|
13
|
+
|
14
|
+
[CVE-2023-22795]
|
15
|
+
|
16
|
+
* Use string#split instead of regex for domain parts
|
17
|
+
|
18
|
+
[CVE-2023-22792]
|
19
|
+
|
20
|
+
|
21
|
+
## Rails 6.1.7 (September 09, 2022) ##
|
22
|
+
|
23
|
+
* No changes.
|
24
|
+
|
25
|
+
|
1
26
|
## Rails 6.1.6.1 (July 12, 2022) ##
|
2
27
|
|
3
28
|
* No changes.
|
4
29
|
|
5
30
|
|
31
|
+
## Rails 6.1.6 (May 09, 2022) ##
|
32
|
+
|
33
|
+
* No changes.
|
34
|
+
|
35
|
+
|
6
36
|
## Rails 6.1.5.1 (April 26, 2022) ##
|
7
37
|
|
8
38
|
* Allow Content Security Policy DSL to generate for API responses.
|
@@ -78,8 +78,8 @@ module ActionController
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def _set_vary_header
|
81
|
-
if
|
82
|
-
|
81
|
+
if response.headers["Vary"].blank? && request.should_apply_vary_header?
|
82
|
+
response.headers["Vary"] = "Accept"
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
@@ -283,20 +283,6 @@ module ActionDispatch
|
|
283
283
|
class CookieJar #:nodoc:
|
284
284
|
include Enumerable, ChainedCookieJars
|
285
285
|
|
286
|
-
# This regular expression is used to split the levels of a domain.
|
287
|
-
# The top level domain can be any string without a period or
|
288
|
-
# **.**, ***.** style TLDs like co.uk or com.au
|
289
|
-
#
|
290
|
-
# www.example.co.uk gives:
|
291
|
-
# $& => example.co.uk
|
292
|
-
#
|
293
|
-
# example.com gives:
|
294
|
-
# $& => example.com
|
295
|
-
#
|
296
|
-
# lots.of.subdomains.example.local gives:
|
297
|
-
# $& => example.local
|
298
|
-
DOMAIN_REGEXP = /[^.]*\.([^.]*|..\...|...\...)$/
|
299
|
-
|
300
286
|
def self.build(req, cookies)
|
301
287
|
jar = new(req)
|
302
288
|
jar.update(cookies)
|
@@ -449,13 +435,35 @@ module ActionDispatch
|
|
449
435
|
options[:same_site] ||= cookies_same_site_protection.call(request)
|
450
436
|
|
451
437
|
if options[:domain] == :all || options[:domain] == "all"
|
452
|
-
|
453
|
-
|
438
|
+
cookie_domain = ""
|
439
|
+
dot_splitted_host = request.host.split('.', -1)
|
440
|
+
|
441
|
+
# Case where request.host is not an IP address or it's an invalid domain
|
442
|
+
# (ip confirms to the domain structure we expect so we explicitly check for ip)
|
443
|
+
if request.host.match?(/^[\d.]+$/) || dot_splitted_host.include?("") || dot_splitted_host.length == 1
|
444
|
+
options[:domain] = nil
|
445
|
+
return
|
446
|
+
end
|
447
|
+
|
448
|
+
# If there is a provided tld length then we use it otherwise default domain.
|
449
|
+
if options[:tld_length].present?
|
450
|
+
# Case where the tld_length provided is valid
|
451
|
+
if dot_splitted_host.length >= options[:tld_length]
|
452
|
+
cookie_domain = dot_splitted_host.last(options[:tld_length]).join('.')
|
453
|
+
end
|
454
|
+
# Case where tld_length is not provided
|
455
|
+
else
|
456
|
+
# Regular TLDs
|
457
|
+
if !(/\.[^.]{2,3}\.[^.]{2}\z/.match?(request.host))
|
458
|
+
cookie_domain = dot_splitted_host.last(2).join(".")
|
459
|
+
# **.**, ***.** style TLDs like co.uk and com.au
|
460
|
+
else
|
461
|
+
cookie_domain = dot_splitted_host.last(3).join('.')
|
462
|
+
end
|
463
|
+
end
|
454
464
|
|
455
|
-
|
456
|
-
|
457
|
-
options[:domain] = if !request.host.match?(/^[\d.]+$/) && (request.host =~ domain_regexp)
|
458
|
-
".#{$&}"
|
465
|
+
options[:domain] = if cookie_domain.present?
|
466
|
+
".#{cookie_domain}"
|
459
467
|
end
|
460
468
|
elsif options[:domain].is_a? Array
|
461
469
|
# If host matches one of the supplied domains.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.1.
|
19
|
+
version: 6.1.7.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.1.
|
26
|
+
version: 6.1.7.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,28 +98,28 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - '='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 6.1.
|
101
|
+
version: 6.1.7.2
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - '='
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: 6.1.
|
108
|
+
version: 6.1.7.2
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: activemodel
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
113
|
- - '='
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: 6.1.
|
115
|
+
version: 6.1.7.2
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - '='
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 6.1.
|
122
|
+
version: 6.1.7.2
|
123
123
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
124
124
|
testing MVC web applications. Works with any Rack-compatible server.
|
125
125
|
email: david@loudthinking.com
|
@@ -309,10 +309,10 @@ licenses:
|
|
309
309
|
- MIT
|
310
310
|
metadata:
|
311
311
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
312
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.1.
|
313
|
-
documentation_uri: https://api.rubyonrails.org/v6.1.
|
312
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.1.7.2/actionpack/CHANGELOG.md
|
313
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.7.2/
|
314
314
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
315
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.1.
|
315
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.1.7.2/actionpack
|
316
316
|
rubygems_mfa_required: 'true'
|
317
317
|
post_install_message:
|
318
318
|
rdoc_options: []
|
@@ -330,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
330
330
|
version: '0'
|
331
331
|
requirements:
|
332
332
|
- none
|
333
|
-
rubygems_version: 3.
|
333
|
+
rubygems_version: 3.4.3
|
334
334
|
signing_key:
|
335
335
|
specification_version: 4
|
336
336
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|