actionpack 6.0.4 → 6.0.4.1

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: 678219232b512e4e26f212b806cdf7b43bd5659acea529b2b28e2c302abbfced
4
- data.tar.gz: c2069babda9aba85e6fd8d2f922803909877c06b8a0c3a3597dc51b1de411924
3
+ metadata.gz: a1ce7e505c443ac3626576f8ee7d9f877df0f805a2f200993f67d377ffb39637
4
+ data.tar.gz: 63c9a462a845c3775f90d60d4a7554c3ec67c9090d67199210cf9978f8117469
5
5
  SHA512:
6
- metadata.gz: 43e407ce89353f04be46d92411267bc9eb3dc52a95578f5f7d9b5800a06f89b729fd9be33939792b1e9b56e702a13be4117d9303f4ce62e6d740da89c6d51137
7
- data.tar.gz: a0f47e4c5f9a88be9566030b9b69566d8ba11f796adf9b4684e4fbee0617ebfb0e60c1f700b5b52c311959dfe192ba1bca21db64398f6988faf0eca48538a232
6
+ metadata.gz: b38a9f6e715de35d394eae37a599abf39e277b3f87916b648ede6489d499c9c638408f6d874eb47a22ce1b1fcf6eeac682125bbec92881b90002baf838df0e7e
7
+ data.tar.gz: 28abb4b6e0e463cba47474ea4e2c7d6c5fded3f4bace5853a32acdfd36bc0ebcaa699ea5c7444c5ca9a98210d23f7d63660c9237ba0389ffe2647e22d95d52e3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## Rails 6.0.4.1 (August 19, 2021) ##
2
+
3
+ * [CVE-2021-22942] Fix possible open redirect in Host Authorization middleware.
4
+
5
+ Specially crafted "X-Forwarded-Host" headers in combination with certain
6
+ "allowed host" formats can cause the Host Authorization middleware in Action
7
+ Pack to redirect users to a malicious website.
8
+
1
9
  ## Rails 6.0.4 (June 15, 2021) ##
2
10
 
3
11
  * Accept base64_urlsafe CSRF tokens to make forward compatible.
@@ -86,21 +86,15 @@ module ActionDispatch
86
86
  end
87
87
 
88
88
  private
89
+ HOSTNAME = /[a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9.:]+\]/i
90
+ VALID_ORIGIN_HOST = /\A(#{HOSTNAME})(?::\d+)?\z/
91
+ VALID_FORWARDED_HOST = /(?:\A|,[ ]?)(#{HOSTNAME})(?::\d+)?\z/
92
+
89
93
  def authorized?(request)
90
- valid_host = /
91
- \A
92
- (?<host>[a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9.:]+\])
93
- (:\d+)?
94
- \z
95
- /x
96
-
97
- origin_host = valid_host.match(
98
- request.get_header("HTTP_HOST").to_s.downcase)
99
- forwarded_host = valid_host.match(
100
- request.x_forwarded_host.to_s.split(/,\s?/).last)
101
-
102
- origin_host && @permissions.allows?(origin_host[:host]) && (
103
- forwarded_host.nil? || @permissions.allows?(forwarded_host[:host]))
94
+ origin_host = request.get_header("HTTP_HOST")&.slice(VALID_ORIGIN_HOST, 1) || ""
95
+ forwarded_host = request.x_forwarded_host&.slice(VALID_FORWARDED_HOST, 1) || ""
96
+
97
+ @permissions.allows?(origin_host) && (forwarded_host.blank? || @permissions.allows?(forwarded_host))
104
98
  end
105
99
 
106
100
  def mark_as_authorized(request)
@@ -10,7 +10,7 @@ module ActionPack
10
10
  MAJOR = 6
11
11
  MINOR = 0
12
12
  TINY = 4
13
- PRE = nil
13
+ PRE = "1"
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.0.4
4
+ version: 6.0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-15 00:00:00.000000000 Z
11
+ date: 2021-08-19 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.0.4
19
+ version: 6.0.4.1
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.0.4
26
+ version: 6.0.4.1
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.0.4
101
+ version: 6.0.4.1
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.0.4
108
+ version: 6.0.4.1
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.0.4
115
+ version: 6.0.4.1
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.0.4
122
+ version: 6.0.4.1
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
@@ -310,11 +310,11 @@ licenses:
310
310
  - MIT
311
311
  metadata:
312
312
  bug_tracker_uri: https://github.com/rails/rails/issues
313
- changelog_uri: https://github.com/rails/rails/blob/v6.0.4/actionpack/CHANGELOG.md
314
- documentation_uri: https://api.rubyonrails.org/v6.0.4/
313
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.4.1/actionpack/CHANGELOG.md
314
+ documentation_uri: https://api.rubyonrails.org/v6.0.4.1/
315
315
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
316
- source_code_uri: https://github.com/rails/rails/tree/v6.0.4/actionpack
317
- post_install_message:
316
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.4.1/actionpack
317
+ post_install_message:
318
318
  rdoc_options: []
319
319
  require_paths:
320
320
  - lib
@@ -330,8 +330,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
330
  version: '0'
331
331
  requirements:
332
332
  - none
333
- rubygems_version: 3.1.2
334
- signing_key:
333
+ rubygems_version: 3.2.15
334
+ signing_key:
335
335
  specification_version: 4
336
336
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
337
337
  test_files: []