actionpack 6.1.4 → 6.1.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: 9ecbd6190263018a55d9baa5737fbb8cadbcfe576eab8a37abe85f243bf7280f
4
- data.tar.gz: 3eb5afac5cae0df74480ded35e48956a41b4017e43f9dfb7e895557ebf2efd02
3
+ metadata.gz: 65eaf0a7cdcac42378d27ebca8973bfb4cdf41b0dd79425c2b276c83460bd39b
4
+ data.tar.gz: d76e6cfc52492a8e7a1c0fc21e59e1cd60ec3c464feb2f304dbbb037418a9739
5
5
  SHA512:
6
- metadata.gz: d25fc0df75affc20fce6891e4da46226a851b48f4379b491fa887b194866a0d2f25f619f0401ffa524bd14369a0f5705f3ae8d12ea513976c48a3101f1327925
7
- data.tar.gz: e7bc0083bb78130cbb4d2b0d421fdc69c146b7040e64da4d2ed0c18715f0a94b1c5d9dc2447439c31c7e63682dab1b03e5d0db0c6a14bb020e99a5da44ae9728
6
+ metadata.gz: a6033213d92c1734124bf7e3b75c61c3f304cf507052f52f85ac96a6ae7079c3c7e526a76ddfdb3024afb0de8fe8e5f6a6fda1d68a8f4ba69c8f048b0902d782
7
+ data.tar.gz: 4de05a81d6de0efb723dbeb96cb28e403fbe8bfb96963ee64f69dbb22d67ce320393f71b5afaab5dbc65b493e238e176642cc898671019b592c9fa43b9082234
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## Rails 6.1.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.1.4 (June 24, 2021) ##
2
10
 
3
11
  * Ignore file fixtures on `db:fixtures:load`
@@ -102,21 +102,15 @@ module ActionDispatch
102
102
  end
103
103
 
104
104
  private
105
+ HOSTNAME = /[a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9.:]+\]/i
106
+ VALID_ORIGIN_HOST = /\A(#{HOSTNAME})(?::\d+)?\z/
107
+ VALID_FORWARDED_HOST = /(?:\A|,[ ]?)(#{HOSTNAME})(?::\d+)?\z/
108
+
105
109
  def authorized?(request)
106
- valid_host = /
107
- \A
108
- (?<host>[a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9.:]+\])
109
- (:\d+)?
110
- \z
111
- /x
112
-
113
- origin_host = valid_host.match(
114
- request.get_header("HTTP_HOST").to_s.downcase)
115
- forwarded_host = valid_host.match(
116
- request.x_forwarded_host.to_s.split(/,\s?/).last)
117
-
118
- origin_host && @permissions.allows?(origin_host[:host]) && (
119
- forwarded_host.nil? || @permissions.allows?(forwarded_host[:host]))
110
+ origin_host = request.get_header("HTTP_HOST")&.slice(VALID_ORIGIN_HOST, 1) || ""
111
+ forwarded_host = request.x_forwarded_host&.slice(VALID_FORWARDED_HOST, 1) || ""
112
+
113
+ @permissions.allows?(origin_host) && (forwarded_host.blank? || @permissions.allows?(forwarded_host))
120
114
  end
121
115
 
122
116
  def excluded?(request)
@@ -10,7 +10,7 @@ module ActionPack
10
10
  MAJOR = 6
11
11
  MINOR = 1
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.1.4
4
+ version: 6.1.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-24 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.1.4
19
+ version: 6.1.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.1.4
26
+ version: 6.1.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.1.4
101
+ version: 6.1.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.1.4
108
+ version: 6.1.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.1.4
115
+ version: 6.1.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.1.4
122
+ version: 6.1.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
@@ -309,11 +309,11 @@ 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/actionpack/CHANGELOG.md
313
- documentation_uri: https://api.rubyonrails.org/v6.1.4/
312
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.4.1/actionpack/CHANGELOG.md
313
+ documentation_uri: https://api.rubyonrails.org/v6.1.4.1/
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/actionpack
316
- post_install_message:
315
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.4.1/actionpack
316
+ post_install_message:
317
317
  rdoc_options: []
318
318
  require_paths:
319
319
  - lib
@@ -329,8 +329,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
329
  version: '0'
330
330
  requirements:
331
331
  - none
332
- rubygems_version: 3.1.2
333
- signing_key:
332
+ rubygems_version: 3.2.15
333
+ signing_key:
334
334
  specification_version: 4
335
335
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
336
336
  test_files: []