actionpack 6.1.4.2 → 6.1.4.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5825f14a026c24d4ddea1860c90e32db978e31f6bec3fe2e986abb3fce8e946a
4
- data.tar.gz: 2e02124fc9c555eac945ba0abd0db217281fdb5581adae592d656b43c65c7c48
3
+ metadata.gz: 5261f7aaf69a3985bcd9b6a7a749f3388ec3b8c70e3d74a6db4353becef31d1d
4
+ data.tar.gz: 559a355c56011d7f6b687b9b69b224d37e0c3c33a9628934ac8baf887ced2ef7
5
5
  SHA512:
6
- metadata.gz: d0af835716768a29451414527cf754158c113216f76c22de30c30afeedf2efbfe3b2621af1a1ac9b2ddeff94c81682a85ad67e78538beb4ca576be5178791d01
7
- data.tar.gz: f8e6917a5fd4dd3962ef44b538c321029094de33333942ba0b5dbca517ce637b31b27cee76c1281af69fd32c4449383834314e9e56e0021d43d51c2cf67524aa
6
+ metadata.gz: c9d2bbf96d36e715b9f210b1b5be2e2c4baab2ad1f281b35e0039ae20ae8d00996c221581facb3dc25c1c439a8256a9d087bf7bf48dc18cdd9921a50944848d3
7
+ data.tar.gz: d39f6ceb654ef4e944640a8752d19098c4544fd0ee0d89497f8a6a79086d838a756cd0a951c4ce0da2328d17163f63aebe1c80e144d13860516ce2991c1613d9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## Rails 6.1.4.6 (February 11, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.1.4.5 (February 11, 2022) ##
7
+
8
+ * Under certain circumstances, the middleware isn't informed that the
9
+ response body has been fully closed which result in request state not
10
+ being fully reset before the next request
11
+
12
+ [CVE-2022-23633]
13
+
14
+
15
+ ## Rails 6.1.4.4 (December 15, 2021) ##
16
+
17
+ * Fix issue with host protection not allowing host with port in development.
18
+
19
+
20
+ ## Rails 6.1.4.3 (December 14, 2021) ##
21
+
22
+ * Fix issue with host protection not allowing localhost in development.
23
+
24
+
1
25
  ## Rails 6.1.4.2 (December 14, 2021) ##
2
26
 
3
27
  * Fix X_FORWARDED_HOST protection. [CVE-2021-44528]
@@ -9,7 +9,7 @@ module ActionDispatch
9
9
  end
10
10
 
11
11
  def call(env)
12
- state = @executor.run!
12
+ state = @executor.run!(reset: true)
13
13
  begin
14
14
  response = @app.call(env)
15
15
  returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
@@ -15,6 +15,17 @@ module ActionDispatch
15
15
  # application will be executed and rendered. If no +response_app+ is given, a
16
16
  # default one will run, which responds with <tt>403 Forbidden</tt>.
17
17
  class HostAuthorization
18
+ ALLOWED_HOSTS_IN_DEVELOPMENT = [".localhost", IPAddr.new("0.0.0.0/0"), IPAddr.new("::/0")]
19
+ PORT_REGEX = /(?::\d+)/ # :nodoc:
20
+ IPV4_HOSTNAME = /(?<host>\d+\.\d+\.\d+\.\d+)#{PORT_REGEX}?/ # :nodoc:
21
+ IPV6_HOSTNAME = /(?<host>[a-f0-9]*:[a-f0-9.:]+)/i # :nodoc:
22
+ IPV6_HOSTNAME_WITH_PORT = /\[#{IPV6_HOSTNAME}\]#{PORT_REGEX}/i # :nodoc:
23
+ VALID_IP_HOSTNAME = Regexp.union( # :nodoc:
24
+ /\A#{IPV4_HOSTNAME}\z/,
25
+ /\A#{IPV6_HOSTNAME}\z/,
26
+ /\A#{IPV6_HOSTNAME_WITH_PORT}\z/,
27
+ )
28
+
18
29
  class Permissions # :nodoc:
19
30
  def initialize(hosts)
20
31
  @hosts = sanitize_hosts(hosts)
@@ -26,11 +37,17 @@ module ActionDispatch
26
37
 
27
38
  def allows?(host)
28
39
  @hosts.any? do |allowed|
29
- allowed === host
30
- rescue
31
- # IPAddr#=== raises an error if you give it a hostname instead of
32
- # IP. Treat similar errors as blocked access.
33
- false
40
+ if allowed.is_a?(IPAddr)
41
+ begin
42
+ allowed === extract_hostname(host)
43
+ rescue
44
+ # IPAddr#=== raises an error if you give it a hostname instead of
45
+ # IP. Treat similar errors as blocked access.
46
+ false
47
+ end
48
+ else
49
+ allowed === host
50
+ end
34
51
  end
35
52
  end
36
53
 
@@ -46,16 +63,20 @@ module ActionDispatch
46
63
  end
47
64
 
48
65
  def sanitize_regexp(host)
49
- /\A#{host}\z/
66
+ /\A#{host}#{PORT_REGEX}?\z/
50
67
  end
51
68
 
52
69
  def sanitize_string(host)
53
70
  if host.start_with?(".")
54
- /\A([a-z0-9-]+\.)?#{Regexp.escape(host[1..-1])}\z/i
71
+ /\A([a-z0-9-]+\.)?#{Regexp.escape(host[1..-1])}#{PORT_REGEX}?\z/i
55
72
  else
56
- /\A#{Regexp.escape host}\z/i
73
+ /\A#{Regexp.escape host}#{PORT_REGEX}?\z/i
57
74
  end
58
75
  end
76
+
77
+ def extract_hostname(host)
78
+ host.slice(VALID_IP_HOSTNAME, "host") || host
79
+ end
59
80
  end
60
81
 
61
82
  DEFAULT_RESPONSE_APP = -> env do
@@ -10,7 +10,7 @@ module ActionPack
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
12
  TINY = 4
13
- PRE = "2"
13
+ PRE = "6"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
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.2
4
+ version: 6.1.4.6
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: 2021-12-14 00:00:00.000000000 Z
11
+ date: 2022-02-11 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.4.2
19
+ version: 6.1.4.6
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.4.2
26
+ version: 6.1.4.6
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.4.2
101
+ version: 6.1.4.6
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.4.2
108
+ version: 6.1.4.6
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.4.2
115
+ version: 6.1.4.6
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.4.2
122
+ version: 6.1.4.6
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.4.2/actionpack/CHANGELOG.md
313
- documentation_uri: https://api.rubyonrails.org/v6.1.4.2/
312
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.4.6/actionpack/CHANGELOG.md
313
+ documentation_uri: https://api.rubyonrails.org/v6.1.4.6/
314
314
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
315
- source_code_uri: https://github.com/rails/rails/tree/v6.1.4.2/actionpack
315
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.4.6/actionpack
316
316
  post_install_message:
317
317
  rdoc_options: []
318
318
  require_paths:
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
329
  version: '0'
330
330
  requirements:
331
331
  - none
332
- rubygems_version: 3.2.15
332
+ rubygems_version: 3.2.22
333
333
  signing_key:
334
334
  specification_version: 4
335
335
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).