actionpack 5.2.8.1 → 6.0.6
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.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +270 -347
- data/MIT-LICENSE +1 -1
- data/README.rdoc +4 -3
- data/lib/abstract_controller/base.rb +4 -3
- data/lib/abstract_controller/caching/fragments.rb +6 -22
- data/lib/abstract_controller/caching.rb +1 -1
- data/lib/abstract_controller/callbacks.rb +12 -0
- data/lib/abstract_controller/collector.rb +1 -2
- data/lib/abstract_controller/helpers.rb +7 -6
- data/lib/abstract_controller/railties/routes_helpers.rb +1 -1
- data/lib/abstract_controller/translation.rb +4 -4
- data/lib/action_controller/api.rb +2 -1
- data/lib/action_controller/base.rb +2 -7
- data/lib/action_controller/caching.rb +1 -2
- data/lib/action_controller/log_subscriber.rb +8 -5
- data/lib/action_controller/metal/basic_implicit_render.rb +1 -1
- data/lib/action_controller/metal/conditional_get.rb +9 -3
- data/lib/action_controller/metal/content_security_policy.rb +0 -1
- data/lib/action_controller/metal/data_streaming.rb +5 -6
- data/lib/action_controller/metal/default_headers.rb +17 -0
- data/lib/action_controller/metal/etag_with_template_digest.rb +1 -1
- data/lib/action_controller/metal/exceptions.rb +23 -2
- data/lib/action_controller/metal/flash.rb +5 -5
- data/lib/action_controller/metal/force_ssl.rb +15 -56
- data/lib/action_controller/metal/head.rb +1 -1
- data/lib/action_controller/metal/helpers.rb +3 -4
- data/lib/action_controller/metal/http_authentication.rb +20 -21
- data/lib/action_controller/metal/implicit_render.rb +4 -14
- data/lib/action_controller/metal/instrumentation.rb +3 -6
- data/lib/action_controller/metal/live.rb +29 -31
- data/lib/action_controller/metal/mime_responds.rb +13 -2
- data/lib/action_controller/metal/params_wrapper.rb +18 -14
- data/lib/action_controller/metal/redirecting.rb +5 -5
- data/lib/action_controller/metal/renderers.rb +4 -4
- data/lib/action_controller/metal/rendering.rb +2 -3
- data/lib/action_controller/metal/request_forgery_protection.rb +25 -48
- data/lib/action_controller/metal/streaming.rb +0 -1
- data/lib/action_controller/metal/strong_parameters.rb +65 -44
- data/lib/action_controller/metal/url_for.rb +1 -1
- data/lib/action_controller/metal.rb +8 -6
- data/lib/action_controller/railties/helpers.rb +1 -1
- data/lib/action_controller/renderer.rb +17 -3
- data/lib/action_controller/template_assertions.rb +1 -1
- data/lib/action_controller/test_case.rb +7 -8
- data/lib/action_controller.rb +5 -1
- data/lib/action_dispatch/http/cache.rb +14 -11
- data/lib/action_dispatch/http/content_disposition.rb +45 -0
- data/lib/action_dispatch/http/content_security_policy.rb +28 -17
- data/lib/action_dispatch/http/filter_parameters.rb +8 -7
- data/lib/action_dispatch/http/filter_redirect.rb +1 -2
- data/lib/action_dispatch/http/headers.rb +1 -2
- data/lib/action_dispatch/http/mime_negotiation.rb +13 -6
- data/lib/action_dispatch/http/mime_type.rb +14 -8
- data/lib/action_dispatch/http/parameter_filter.rb +5 -79
- data/lib/action_dispatch/http/parameters.rb +15 -6
- data/lib/action_dispatch/http/request.rb +21 -14
- data/lib/action_dispatch/http/response.rb +40 -21
- data/lib/action_dispatch/http/upload.rb +9 -1
- data/lib/action_dispatch/http/url.rb +81 -82
- data/lib/action_dispatch/journey/formatter.rb +2 -3
- data/lib/action_dispatch/journey/gtg/builder.rb +0 -1
- data/lib/action_dispatch/journey/gtg/transition_table.rb +0 -1
- data/lib/action_dispatch/journey/nfa/simulator.rb +0 -2
- data/lib/action_dispatch/journey/nfa/transition_table.rb +0 -1
- data/lib/action_dispatch/journey/nodes/node.rb +9 -8
- data/lib/action_dispatch/journey/path/pattern.rb +6 -3
- data/lib/action_dispatch/journey/route.rb +5 -4
- data/lib/action_dispatch/journey/router/utils.rb +10 -10
- data/lib/action_dispatch/journey/router.rb +0 -4
- data/lib/action_dispatch/journey/routes.rb +0 -2
- data/lib/action_dispatch/journey/scanner.rb +10 -4
- data/lib/action_dispatch/journey/visitors.rb +1 -4
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +46 -0
- data/lib/action_dispatch/middleware/callbacks.rb +2 -4
- data/lib/action_dispatch/middleware/cookies.rb +62 -78
- data/lib/action_dispatch/middleware/debug_exceptions.rb +45 -61
- data/lib/action_dispatch/middleware/debug_locks.rb +5 -5
- data/lib/action_dispatch/middleware/debug_view.rb +66 -0
- data/lib/action_dispatch/middleware/exception_wrapper.rb +49 -16
- data/lib/action_dispatch/middleware/flash.rb +1 -1
- data/lib/action_dispatch/middleware/host_authorization.rb +121 -0
- data/lib/action_dispatch/middleware/public_exceptions.rb +6 -3
- data/lib/action_dispatch/middleware/remote_ip.rb +9 -12
- data/lib/action_dispatch/middleware/request_id.rb +2 -2
- data/lib/action_dispatch/middleware/session/abstract_store.rb +0 -1
- data/lib/action_dispatch/middleware/session/cookie_store.rb +1 -7
- data/lib/action_dispatch/middleware/show_exceptions.rb +1 -2
- data/lib/action_dispatch/middleware/ssl.rb +8 -8
- data/lib/action_dispatch/middleware/stack.rb +38 -2
- data/lib/action_dispatch/middleware/static.rb +6 -7
- data/lib/action_dispatch/middleware/templates/rescues/_actions.html.erb +13 -0
- data/lib/action_dispatch/middleware/templates/rescues/_actions.text.erb +0 -0
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +3 -1
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +4 -2
- data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +45 -35
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +7 -0
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +5 -0
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +26 -4
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +7 -4
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +5 -2
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +4 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +19 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb +3 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +3 -0
- data/lib/action_dispatch/railtie.rb +7 -2
- data/lib/action_dispatch/request/session.rb +9 -2
- data/lib/action_dispatch/routing/inspector.rb +97 -50
- data/lib/action_dispatch/routing/mapper.rb +63 -42
- data/lib/action_dispatch/routing/polymorphic_routes.rb +3 -6
- data/lib/action_dispatch/routing/route_set.rb +25 -31
- data/lib/action_dispatch/routing/url_for.rb +2 -2
- data/lib/action_dispatch/routing.rb +21 -20
- data/lib/action_dispatch/system_test_case.rb +44 -6
- data/lib/action_dispatch/system_testing/browser.rb +38 -7
- data/lib/action_dispatch/system_testing/driver.rb +11 -2
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +6 -5
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +7 -6
- data/lib/action_dispatch/testing/assertion_response.rb +0 -1
- data/lib/action_dispatch/testing/assertions/response.rb +2 -3
- data/lib/action_dispatch/testing/assertions/routing.rb +15 -3
- data/lib/action_dispatch/testing/assertions.rb +1 -1
- data/lib/action_dispatch/testing/integration.rb +33 -12
- data/lib/action_dispatch/testing/request_encoder.rb +2 -2
- data/lib/action_dispatch/testing/test_process.rb +2 -2
- data/lib/action_dispatch/testing/test_response.rb +4 -32
- data/lib/action_dispatch.rb +7 -2
- data/lib/action_pack/gem_version.rb +4 -4
- data/lib/action_pack.rb +1 -1
- metadata +29 -15
- data/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +0 -26
data/CHANGELOG.md
CHANGED
@@ -1,34 +1,35 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 6.0.6 (September 09, 2022) ##
|
2
2
|
|
3
3
|
* No changes.
|
4
4
|
|
5
5
|
|
6
|
-
## Rails 5.
|
6
|
+
## Rails 6.0.5.1 (July 12, 2022) ##
|
7
7
|
|
8
8
|
* No changes.
|
9
9
|
|
10
10
|
|
11
|
-
## Rails
|
11
|
+
## Rails 6.0.5 (May 09, 2022) ##
|
12
12
|
|
13
|
-
*
|
13
|
+
* No changes.
|
14
14
|
|
15
|
-
*Tim Wade*
|
16
15
|
|
17
|
-
## Rails
|
16
|
+
## Rails 6.0.4.8 (April 26, 2022) ##
|
18
17
|
|
19
|
-
*
|
18
|
+
* Allow Content Security Policy DSL to generate for API responses.
|
20
19
|
|
21
|
-
|
20
|
+
*Tim Wade*
|
21
|
+
|
22
|
+
## Rails 6.0.4.7 (March 08, 2022) ##
|
22
23
|
|
23
24
|
* No changes.
|
24
25
|
|
25
26
|
|
26
|
-
## Rails
|
27
|
+
## Rails 6.0.4.6 (February 11, 2022) ##
|
27
28
|
|
28
29
|
* No changes.
|
29
30
|
|
30
31
|
|
31
|
-
## Rails
|
32
|
+
## Rails 6.0.4.5 (February 11, 2022) ##
|
32
33
|
|
33
34
|
* Under certain circumstances, the middleware isn't informed that the
|
34
35
|
response body has been fully closed which result in request state not
|
@@ -37,7 +38,29 @@
|
|
37
38
|
[CVE-2022-23633]
|
38
39
|
|
39
40
|
|
40
|
-
## Rails
|
41
|
+
## Rails 6.0.4.4 (December 15, 2021) ##
|
42
|
+
|
43
|
+
* Fix issue with host protection not allowing host with port in development.
|
44
|
+
|
45
|
+
|
46
|
+
## Rails 6.0.4.3 (December 14, 2021) ##
|
47
|
+
|
48
|
+
* Fix issue with host protection not allowing localhost in development.
|
49
|
+
|
50
|
+
|
51
|
+
## Rails 6.0.4.2 (December 14, 2021) ##
|
52
|
+
|
53
|
+
* Fix X_FORWARDED_HOST protection. [CVE-2021-44528]
|
54
|
+
|
55
|
+
## Rails 6.1.4.1 (August 19, 2021) ##
|
56
|
+
|
57
|
+
* [CVE-2021-22942] Fix possible open redirect in Host Authorization middleware.
|
58
|
+
|
59
|
+
Specially crafted "X-Forwarded-Host" headers in combination with certain
|
60
|
+
"allowed host" formats can cause the Host Authorization middleware in Action
|
61
|
+
Pack to redirect users to a malicious website.
|
62
|
+
|
63
|
+
## Rails 6.0.4 (June 15, 2021) ##
|
41
64
|
|
42
65
|
* Accept base64_urlsafe CSRF tokens to make forward compatible.
|
43
66
|
|
@@ -46,34 +69,29 @@
|
|
46
69
|
the CSRF token to a browser in a client-readable cookie does not work properly
|
47
70
|
out of the box: the value has to be url-encoded and decoded to survive transport.
|
48
71
|
|
49
|
-
In
|
72
|
+
In Rails 6.1, we generate Base64 urlsafe-encoded CSRF tokens, which are inherently
|
50
73
|
safe to transport. Validation accepts both urlsafe tokens, and strict-encoded
|
51
74
|
tokens for backwards compatibility.
|
52
75
|
|
53
|
-
|
54
|
-
config
|
55
|
-
|
56
|
-
In Rails 5.2.5, the CSRF token format was accidentally changed to urlsafe-encoded.
|
57
|
-
|
58
|
-
**Atention**: If you already upgraded your application to 5.2.5, set the config
|
59
|
-
`urlsafe_csrf_tokens` to `true`, otherwise your form submission will start to fail
|
60
|
-
during the deploy of this new version.
|
76
|
+
In Rails 5.2.5, the CSRF token format is accidentally changed to urlsafe-encoded.
|
77
|
+
If you upgrade apps from 5.2.5, set the config `urlsafe_csrf_tokens = true`.
|
61
78
|
|
62
79
|
```ruby
|
63
80
|
Rails.application.config.action_controller.urlsafe_csrf_tokens = true
|
64
81
|
```
|
65
82
|
|
66
|
-
If you are upgrading from 5.2.4.x, you don't need to change this configuration.
|
67
|
-
|
68
83
|
*Scott Blum*, *Étienne Barrié*
|
69
84
|
|
85
|
+
* Signed and encrypted cookies can now store `false` as their value when
|
86
|
+
`action_dispatch.use_cookies_with_metadata` is enabled.
|
70
87
|
|
71
|
-
|
88
|
+
*Rolandas Barysas*
|
72
89
|
|
73
|
-
* No changes.
|
74
90
|
|
91
|
+
## Rails 6.0.3.7 (May 05, 2021) ##
|
75
92
|
|
76
|
-
|
93
|
+
* Prevent catastrophic backtracking during mime parsing
|
94
|
+
CVE-2021-22902
|
77
95
|
|
78
96
|
* Prevent regex DoS in HTTP token authentication
|
79
97
|
CVE-2021-22904
|
@@ -88,502 +106,407 @@
|
|
88
106
|
|
89
107
|
*Gannon McGibbon*
|
90
108
|
|
91
|
-
## Rails
|
109
|
+
## Rails 6.0.3.6 (March 26, 2021) ##
|
92
110
|
|
93
111
|
* No changes.
|
94
112
|
|
95
113
|
|
96
|
-
## Rails
|
97
|
-
|
98
|
-
* No changes.
|
99
|
-
|
114
|
+
## Rails 6.0.3.5 (February 10, 2021) ##
|
100
115
|
|
101
|
-
|
116
|
+
* Prevent open redirect when allowed host starts with a dot
|
102
117
|
|
103
|
-
|
118
|
+
[CVE-2021-22881]
|
104
119
|
|
105
|
-
|
120
|
+
Thanks to @tktech (https://hackerone.com/tktech) for reporting this
|
121
|
+
issue and the patch!
|
106
122
|
|
123
|
+
*Aaron Patterson*
|
107
124
|
|
108
|
-
## Rails 5.2.4.2 (March 19, 2020) ##
|
109
125
|
|
110
|
-
|
126
|
+
## Rails 6.0.3.4 (October 07, 2020) ##
|
111
127
|
|
128
|
+
* [CVE-2020-8264] Prevent XSS in Actionable Exceptions
|
112
129
|
|
113
|
-
## Rails 5.2.4.1 (December 18, 2019) ##
|
114
130
|
|
115
|
-
|
116
|
-
|
117
|
-
The `ActionDispatch::Session::MemcacheStore` is still vulnerable given it requires the
|
118
|
-
gem dalli to be updated as well.
|
119
|
-
|
120
|
-
_Breaking changes:_
|
121
|
-
* `session.id` now returns an instance of `Rack::Session::SessionId` and not a String (use `session.id.public_id` to restore the old behaviour, see #38063)
|
122
|
-
* Accessing the session id using `session[:session_id]`/`session['session_id']` no longer works with
|
123
|
-
ruby 2.2 (see https://github.com/rails/rails/commit/2a52a38cb51b65d71cf91fc960777213cf96f962#commitcomment-37929811)
|
124
|
-
|
125
|
-
CVE-2019-16782.
|
126
|
-
|
127
|
-
|
128
|
-
## Rails 5.2.4 (November 27, 2019) ##
|
131
|
+
## Rails 6.0.3.3 (September 09, 2020) ##
|
129
132
|
|
130
133
|
* No changes.
|
131
134
|
|
132
135
|
|
133
|
-
## Rails
|
136
|
+
## Rails 6.0.3.2 (June 17, 2020) ##
|
134
137
|
|
135
|
-
*
|
138
|
+
* [CVE-2020-8185] Only allow ActionableErrors if show_detailed_exceptions is enabled
|
136
139
|
|
137
|
-
|
138
|
-
it was excluded when `no-cache` was included. This change preserves the
|
139
|
-
`public` value as is.
|
140
|
+
## Rails 6.0.3.1 (May 18, 2020) ##
|
140
141
|
|
141
|
-
|
142
|
+
* [CVE-2020-8166] HMAC raw CSRF token before masking it, so it cannot be used to reconstruct a per-form token
|
142
143
|
|
143
|
-
|
144
|
+
* [CVE-2020-8164] Return self when calling #each, #each_pair, and #each_value instead of the raw @parameters hash
|
144
145
|
|
145
|
-
* Allow `nil` params for `ActionController::TestCase`.
|
146
146
|
|
147
|
-
|
147
|
+
## Rails 6.0.3 (May 06, 2020) ##
|
148
148
|
|
149
|
+
* Include child session assertion count in ActionDispatch::IntegrationTest
|
149
150
|
|
150
|
-
|
151
|
+
`IntegrationTest#open_session` uses `dup` to create the new session, which
|
152
|
+
meant it had its own copy of `@assertions`. This prevented the assertions
|
153
|
+
from being correctly counted and reported.
|
151
154
|
|
152
|
-
|
155
|
+
Child sessions now have their `attr_accessor` overriden to delegate to the
|
156
|
+
root session.
|
153
157
|
|
158
|
+
Fixes #32142
|
154
159
|
|
155
|
-
|
160
|
+
*Sam Bostock*
|
156
161
|
|
157
|
-
* Reset Capybara sessions if failed system test screenshot raising an exception.
|
158
162
|
|
159
|
-
|
160
|
-
in system test `after_teardown`.
|
163
|
+
## Rails 6.0.2.2 (March 19, 2020) ##
|
161
164
|
|
162
|
-
|
165
|
+
* No changes.
|
163
166
|
|
164
|
-
* Use request object for context if there's no controller
|
165
167
|
|
166
|
-
|
167
|
-
mounted rack application so pass the request object as the context
|
168
|
-
when resolving dynamic CSP sources in this scenario.
|
168
|
+
## Rails 6.0.2.1 (December 18, 2019) ##
|
169
169
|
|
170
|
-
|
170
|
+
* Fix possible information leak / session hijacking vulnerability.
|
171
171
|
|
172
|
-
|
172
|
+
The `ActionDispatch::Session::MemcacheStore` is still vulnerable given it requires the
|
173
|
+
gem dalli to be updated as well.
|
173
174
|
|
174
|
-
|
175
|
+
CVE-2019-16782.
|
175
176
|
|
176
|
-
Previously if a dynamic source returned a symbol such as :self it
|
177
|
-
would be converted to a string implicity, e.g:
|
178
177
|
|
179
|
-
|
178
|
+
## Rails 6.0.2 (December 13, 2019) ##
|
180
179
|
|
181
|
-
|
180
|
+
* Allow using mountable engine route helpers in System Tests.
|
182
181
|
|
183
|
-
|
182
|
+
*Chalo Fernandez*
|
184
183
|
|
185
|
-
and now it generates:
|
186
184
|
|
187
|
-
|
185
|
+
## Rails 6.0.1 (November 5, 2019) ##
|
188
186
|
|
189
|
-
|
187
|
+
* `ActionDispatch::SystemTestCase` now inherits from `ActiveSupport::TestCase`
|
188
|
+
rather than `ActionDispatch::IntegrationTest`. This permits running jobs in
|
189
|
+
system tests.
|
190
190
|
|
191
|
-
*
|
191
|
+
*George Claghorn*, *Edouard Chin*
|
192
192
|
|
193
|
-
|
193
|
+
* Registered MIME types may contain extra flags:
|
194
194
|
|
195
|
-
|
195
|
+
```ruby
|
196
|
+
Mime::Type.register "text/html; fragment", :html_fragment
|
197
|
+
```
|
196
198
|
|
197
|
-
*
|
199
|
+
*Aaron Patterson*
|
198
200
|
|
199
201
|
|
200
|
-
## Rails
|
202
|
+
## Rails 6.0.0 (August 16, 2019) ##
|
201
203
|
|
202
204
|
* No changes.
|
203
205
|
|
204
206
|
|
205
|
-
## Rails
|
206
|
-
|
207
|
-
* Prevent `?null=` being passed on JSON encoded test requests.
|
207
|
+
## Rails 6.0.0.rc2 (July 22, 2019) ##
|
208
208
|
|
209
|
-
|
210
|
-
there are none.
|
209
|
+
* Add the ability to set the CSP nonce only to the specified directives.
|
211
210
|
|
212
|
-
|
211
|
+
Fixes #35137.
|
213
212
|
|
214
|
-
|
213
|
+
*Yuji Yaginuma*
|
215
214
|
|
216
|
-
|
215
|
+
* Keep part when scope option has value.
|
217
216
|
|
218
|
-
|
219
|
-
|
220
|
-
parameters
|
217
|
+
When a route was defined within an optional scope, if that route didn't
|
218
|
+
take parameters the scope was lost when using path helpers. This commit
|
219
|
+
ensures scope is kept both when the route takes parameters or when it
|
220
|
+
doesn't.
|
221
221
|
|
222
|
-
|
222
|
+
Fixes #33219
|
223
223
|
|
224
|
-
*
|
224
|
+
*Alberto Almagro*
|
225
225
|
|
226
|
-
|
227
|
-
```
|
228
|
-
params = ActionController::Parameters.new(nested_arrays: [[{ x: 2, y: 3 }, { x: 21, y: 42 }]])
|
229
|
-
params.permit!
|
230
|
-
```
|
226
|
+
* Change `ActionDispatch::Response#content_type` to return Content-Type header as it is.
|
231
227
|
|
232
|
-
|
228
|
+
Previously, `ActionDispatch::Response#content_type` returned value does NOT
|
229
|
+
contain charset part. This behavior changed to returned Content-Type header
|
230
|
+
containing charset part as it is.
|
233
231
|
|
234
|
-
|
232
|
+
If you want just MIME type, please use `ActionDispatch::Response#media_type`
|
233
|
+
instead.
|
235
234
|
|
236
|
-
|
237
|
-
`
|
235
|
+
Enable `action_dispatch.return_only_media_type_on_content_type` to use this change.
|
236
|
+
If not enabled, `ActionDispatch::Response#content_type` returns the same
|
237
|
+
value as before version, but its behavior is deprecate.
|
238
238
|
|
239
|
-
*
|
240
|
-
|
241
|
-
* Output only one Content-Security-Policy nonce header value per request.
|
239
|
+
*Yuji Yaginuma*
|
242
240
|
|
243
|
-
|
241
|
+
* Calling `ActionController::Parameters#transform_keys/!` without a block now returns
|
242
|
+
an enumerator for the parameters instead of the underlying hash.
|
244
243
|
|
245
|
-
*
|
244
|
+
*Eugene Kenny*
|
246
245
|
|
247
|
-
*
|
246
|
+
* Fix a bug where DebugExceptions throws an error when malformed query parameters are provided
|
248
247
|
|
249
|
-
|
248
|
+
*Yuki Nishijima*, *Stan Lo*
|
250
249
|
|
251
|
-
https://bugs.chromium.org/p/chromium/issues/detail?id=737678#c1
|
252
250
|
|
253
|
-
|
251
|
+
## Rails 6.0.0.rc1 (April 24, 2019) ##
|
254
252
|
|
255
|
-
*
|
253
|
+
* Make system tests take a failed screenshot in a `before_teardown` hook
|
254
|
+
rather than an `after_teardown` hook.
|
256
255
|
|
257
|
-
|
256
|
+
This helps minimize the time gap between when an assertion fails and when
|
257
|
+
the screenshot is taken (reducing the time in which the page could have
|
258
|
+
been dynamically updated after the assertion failed).
|
258
259
|
|
260
|
+
*Richard Macklin*
|
259
261
|
|
260
|
-
|
262
|
+
* Introduce `ActionDispatch::ActionableExceptions`.
|
261
263
|
|
262
|
-
|
264
|
+
The `ActionDispatch::ActionableExceptions` middleware dispatches actions
|
265
|
+
from `ActiveSupport::ActionableError` descendants.
|
263
266
|
|
264
|
-
|
267
|
+
Actionable errors let's you dispatch actions from Rails' error pages.
|
265
268
|
|
266
|
-
*
|
269
|
+
*Vipul A M*, *Yao Jie*, *Genadi Samokovarov*
|
267
270
|
|
268
|
-
|
269
|
-
for a controller and/or specific actions.
|
271
|
+
* Raise an `ArgumentError` if a resource custom param contains a colon (`:`).
|
270
272
|
|
271
|
-
|
273
|
+
After this change it's not possible anymore to configure routes like this:
|
272
274
|
|
273
|
-
|
275
|
+
```
|
276
|
+
routes.draw do
|
277
|
+
resources :users, param: 'name/:sneaky'
|
278
|
+
end
|
279
|
+
```
|
274
280
|
|
275
|
-
|
276
|
-
content_security_policy false, only: :index
|
277
|
-
end
|
281
|
+
Fixes #30467.
|
278
282
|
|
279
|
-
*
|
283
|
+
*Josua Schmid*
|
280
284
|
|
281
|
-
* Add alias method `to_hash` to `to_h` for `cookies`.
|
282
|
-
Add alias method `to_h` to `to_hash` for `session`.
|
283
285
|
|
284
|
-
|
286
|
+
## Rails 6.0.0.beta3 (March 11, 2019) ##
|
285
287
|
|
286
|
-
*
|
287
|
-
to meet the minimum max-age requirement for https://hstspreload.org/.
|
288
|
+
* No changes.
|
288
289
|
|
289
|
-
*Grant Bourque*
|
290
290
|
|
291
|
-
|
291
|
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
|
292
292
|
|
293
|
-
|
294
|
-
normally requires the script-src attribute of the content security
|
295
|
-
policy to include 'unsafe-inline'.
|
293
|
+
* Make debug exceptions works in an environment where ActiveStorage is not loaded.
|
296
294
|
|
297
|
-
|
298
|
-
embedded in a meta tag in a similar fashion to how CSRF protection
|
299
|
-
embeds its token in a meta tag. The UJS library can then read the
|
300
|
-
nonce value and set it on the dynamically generated script tag to
|
301
|
-
enable it to execute without needing 'unsafe-inline' enabled.
|
295
|
+
*Tomoyuki Kurosawa*
|
302
296
|
|
303
|
-
|
304
|
-
|
305
|
-
an XSS vulnerability which can take advantage of the nonce. It is
|
306
|
-
however an improvement on a blanket permission for inline scripts.
|
297
|
+
* `ActionDispatch::SystemTestCase.driven_by` can now be called with a block
|
298
|
+
to define specific browser capabilities.
|
307
299
|
|
308
|
-
|
309
|
-
using `nonce: true` to set the nonce value on the tag, e.g
|
300
|
+
*Edouard Chin*
|
310
301
|
|
311
|
-
<%= javascript_tag nonce: true do %>
|
312
|
-
alert('Hello, World!');
|
313
|
-
<% end %>
|
314
302
|
|
315
|
-
|
303
|
+
## Rails 6.0.0.beta1 (January 18, 2019) ##
|
316
304
|
|
317
|
-
|
305
|
+
* Remove deprecated `fragment_cache_key` helper in favor of `combined_fragment_cache_key`.
|
318
306
|
|
319
|
-
*
|
307
|
+
*Rafael Mendonça França*
|
320
308
|
|
321
|
-
|
309
|
+
* Remove deprecated methods in `ActionDispatch::TestResponse`.
|
322
310
|
|
323
|
-
|
324
|
-
|
325
|
-
params.each do |name|
|
326
|
-
puts name
|
327
|
-
end
|
328
|
-
end
|
311
|
+
`#success?`, `missing?` and `error?` were deprecated in Rails 5.2 in favor of
|
312
|
+
`#successful?`, `not_found?` and `server_error?`.
|
329
313
|
|
330
|
-
|
331
|
-
# param
|
332
|
-
# param_two
|
314
|
+
*Rafael Mendonça França*
|
333
315
|
|
334
|
-
|
316
|
+
* Introduce `ActionDispatch::HostAuthorization`.
|
335
317
|
|
336
|
-
|
318
|
+
This is a new middleware that guards against DNS rebinding attacks by
|
319
|
+
explicitly permitting the hosts a request can be made to.
|
337
320
|
|
338
|
-
|
339
|
-
|
340
|
-
params.each do |name, value|
|
341
|
-
puts name
|
342
|
-
end
|
343
|
-
end
|
321
|
+
Each host is checked with the case operator (`#===`) to support `Regexp`,
|
322
|
+
`Proc`, `IPAddr` and custom objects as host allowances.
|
344
323
|
|
345
|
-
|
346
|
-
# param
|
347
|
-
# param_two
|
324
|
+
*Genadi Samokovarov*
|
348
325
|
|
349
|
-
|
326
|
+
* Allow using `parsed_body` in `ActionController::TestCase`.
|
350
327
|
|
351
|
-
|
328
|
+
In addition to `ActionDispatch::IntegrationTest`, allow using
|
329
|
+
`parsed_body` in `ActionController::TestCase`:
|
352
330
|
|
353
|
-
|
331
|
+
```
|
332
|
+
class SomeControllerTest < ActionController::TestCase
|
333
|
+
def test_some_action
|
334
|
+
post :action, body: { foo: 'bar' }
|
335
|
+
assert_equal({ "foo" => "bar" }, response.parsed_body)
|
336
|
+
end
|
337
|
+
end
|
338
|
+
```
|
354
339
|
|
355
|
-
|
356
|
-
user haven't specified manually another server.
|
340
|
+
Fixes #34676.
|
357
341
|
|
358
|
-
*
|
342
|
+
*Tobias Bühlmann*
|
359
343
|
|
360
|
-
*
|
361
|
-
default headers set.
|
344
|
+
* Raise an error on root route naming conflicts.
|
362
345
|
|
363
|
-
|
346
|
+
Raises an `ArgumentError` when multiple root routes are defined in the
|
347
|
+
same context instead of assigning nil names to subsequent roots.
|
364
348
|
|
365
|
-
*
|
349
|
+
*Gannon McGibbon*
|
366
350
|
|
367
|
-
|
351
|
+
* Allow rescue from parameter parse errors:
|
368
352
|
|
369
|
-
|
353
|
+
```
|
354
|
+
rescue_from ActionDispatch::Http::Parameters::ParseError do
|
355
|
+
head :unauthorized
|
356
|
+
end
|
357
|
+
```
|
370
358
|
|
371
|
-
|
372
|
-
Terminal.app ignore the `inline` and output the path to the file since it can't
|
373
|
-
render the image. Other terminals, like those on Ubuntu, cannot handle the image
|
374
|
-
inline, but also don't handle it gracefully and instead of outputting the file
|
375
|
-
path, it dumps binary into the terminal.
|
359
|
+
*Gannon McGibbon*, *Josh Cheek*
|
376
360
|
|
377
|
-
|
361
|
+
* Reset Capybara sessions if failed system test screenshot raising an exception.
|
378
362
|
|
379
|
-
|
363
|
+
Reset Capybara sessions if `take_failed_screenshot` raise exception
|
364
|
+
in system test `after_teardown`.
|
380
365
|
|
381
|
-
*
|
366
|
+
*Maxim Perepelitsa*
|
382
367
|
|
383
|
-
|
368
|
+
* Use request object for context if there's no controller
|
384
369
|
|
385
|
-
|
370
|
+
There is no controller instance when using a redirect route or a
|
371
|
+
mounted rack application so pass the request object as the context
|
372
|
+
when resolving dynamic CSP sources in this scenario.
|
386
373
|
|
387
|
-
Fixes #
|
374
|
+
Fixes #34200.
|
388
375
|
|
389
376
|
*Andrew White*
|
390
377
|
|
391
|
-
*
|
392
|
-
|
393
|
-
The DSL allows you to configure a global Content-Security-Policy
|
394
|
-
header and then override within a controller. For more information
|
395
|
-
about the Content-Security-Policy header see MDN:
|
396
|
-
|
397
|
-
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
398
|
-
|
399
|
-
Example global policy:
|
400
|
-
|
401
|
-
# config/initializers/content_security_policy.rb
|
402
|
-
Rails.application.config.content_security_policy do |p|
|
403
|
-
p.default_src :self, :https
|
404
|
-
p.font_src :self, :https, :data
|
405
|
-
p.img_src :self, :https, :data
|
406
|
-
p.object_src :none
|
407
|
-
p.script_src :self, :https
|
408
|
-
p.style_src :self, :https, :unsafe_inline
|
409
|
-
end
|
410
|
-
|
411
|
-
Example controller overrides:
|
412
|
-
|
413
|
-
# Override policy inline
|
414
|
-
class PostsController < ApplicationController
|
415
|
-
content_security_policy do |p|
|
416
|
-
p.upgrade_insecure_requests true
|
417
|
-
end
|
418
|
-
end
|
378
|
+
* Apply mapping to symbols returned from dynamic CSP sources
|
419
379
|
|
420
|
-
|
421
|
-
|
422
|
-
content_security_policy do |p|
|
423
|
-
p.base_uri "https://www.example.com"
|
424
|
-
end
|
425
|
-
end
|
380
|
+
Previously if a dynamic source returned a symbol such as :self it
|
381
|
+
would be converted to a string implicitly, e.g:
|
426
382
|
|
427
|
-
|
428
|
-
class PostsController < ApplicationController
|
429
|
-
content_security_policy do |p|
|
430
|
-
p.base_uri :self, -> { "https://#{current_user.domain}.example.com" }
|
431
|
-
end
|
432
|
-
end
|
383
|
+
policy.default_src -> { :self }
|
433
384
|
|
434
|
-
|
435
|
-
legacy content using the `content_security_policy_report_only`
|
436
|
-
configuration attribute, e.g;
|
385
|
+
would generate the header:
|
437
386
|
|
438
|
-
|
439
|
-
Rails.application.config.content_security_policy_report_only = true
|
387
|
+
Content-Security-Policy: default-src self
|
440
388
|
|
441
|
-
|
442
|
-
class PostsController < ApplicationController
|
443
|
-
content_security_policy_report_only only: :index
|
444
|
-
end
|
389
|
+
and now it generates:
|
445
390
|
|
446
|
-
|
447
|
-
reasons since the header is calculated at runtime.
|
391
|
+
Content-Security-Policy: default-src 'self'
|
448
392
|
|
449
393
|
*Andrew White*
|
450
394
|
|
451
|
-
*
|
452
|
-
|
453
|
-
*Yuichiro Kaneko*
|
454
|
-
|
455
|
-
* Remove deprecated `ActionController::ParamsParser::ParseError`.
|
456
|
-
|
457
|
-
*Rafael Mendonça França*
|
458
|
-
|
459
|
-
* Add `:allow_other_host` option to `redirect_back` method.
|
460
|
-
|
461
|
-
When `allow_other_host` is set to `false`, the `redirect_back` will not allow redirecting from a
|
462
|
-
different host. `allow_other_host` is `true` by default.
|
395
|
+
* Add `ActionController::Parameters#each_value`.
|
463
396
|
|
464
|
-
*
|
397
|
+
*Lukáš Zapletal*
|
465
398
|
|
466
|
-
*
|
399
|
+
* Deprecate `ActionDispatch::Http::ParameterFilter` in favor of `ActiveSupport::ParameterFilter`.
|
467
400
|
|
468
|
-
*
|
469
|
-
|
470
|
-
* Add ability to enable Early Hints for HTTP/2
|
471
|
-
|
472
|
-
If supported by the server, and enabled in Puma this allows H2 Early Hints to be used.
|
473
|
-
|
474
|
-
The `javascript_include_tag` and the `stylesheet_link_tag` automatically add Early Hints if requested.
|
475
|
-
|
476
|
-
*Eileen M. Uchitelle*, *Aaron Patterson*
|
477
|
-
|
478
|
-
* Simplify cookies middleware with key rotation support
|
401
|
+
*Yoshiyuki Kinjo*
|
479
402
|
|
480
|
-
|
481
|
-
`
|
482
|
-
|
483
|
-
|
403
|
+
* Encode Content-Disposition filenames on `send_data` and `send_file`.
|
404
|
+
Previously, `send_data 'data', filename: "\u{3042}.txt"` sends
|
405
|
+
`"filename=\"\u{3042}.txt\""` as Content-Disposition and it can be
|
406
|
+
garbled.
|
407
|
+
Now it follows [RFC 2231](https://tools.ietf.org/html/rfc2231) and
|
408
|
+
[RFC 5987](https://tools.ietf.org/html/rfc5987) and sends
|
409
|
+
`"filename=\"%3F.txt\"; filename*=UTF-8''%E3%81%82.txt"`.
|
410
|
+
Most browsers can find filename correctly and old browsers fallback to ASCII
|
411
|
+
converted name.
|
484
412
|
|
485
|
-
*
|
413
|
+
*Fumiaki Matsushima*
|
486
414
|
|
487
|
-
*
|
415
|
+
* Expose `ActionController::Parameters#each_key` which allows iterating over
|
416
|
+
keys without allocating an array.
|
488
417
|
|
489
|
-
|
490
|
-
connection sharing and open request detection work correctly by default.
|
418
|
+
*Richard Schneeman*
|
491
419
|
|
492
|
-
|
420
|
+
* Purpose metadata for signed/encrypted cookies.
|
493
421
|
|
494
|
-
|
422
|
+
Rails can now thwart attacks that attempt to copy signed/encrypted value
|
423
|
+
of a cookie and use it as the value of another cookie.
|
495
424
|
|
496
|
-
|
497
|
-
|
425
|
+
It does so by stashing the cookie-name in the purpose field which is
|
426
|
+
then signed/encrypted along with the cookie value. Then, on a server-side
|
427
|
+
read, we verify the cookie-names and discard any attacked cookies.
|
498
428
|
|
499
|
-
|
429
|
+
Enable `action_dispatch.use_cookies_with_metadata` to use this feature, which
|
430
|
+
writes cookies with the new purpose and expiry metadata embedded.
|
500
431
|
|
501
432
|
*Assain Jaleel*
|
502
433
|
|
503
|
-
*
|
504
|
-
|
505
|
-
Rails can thwart attacks by malicious clients that don't honor a cookie's expiry.
|
506
|
-
|
507
|
-
It does so by stashing the expiry within the written cookie and relying on the
|
508
|
-
signing/encrypting to vouch that it hasn't been tampered with. Then on a
|
509
|
-
server-side read, the expiry is verified and any expired cookie is discarded.
|
434
|
+
* Raises `ActionController::RespondToMismatchError` with conflicting `respond_to` invocations.
|
510
435
|
|
511
|
-
|
436
|
+
`respond_to` can match multiple types and lead to undefined behavior when
|
437
|
+
multiple invocations are made and the types do not match:
|
512
438
|
|
513
|
-
|
514
|
-
|
515
|
-
|
439
|
+
respond_to do |outer_type|
|
440
|
+
outer_type.js do
|
441
|
+
respond_to do |inner_type|
|
442
|
+
inner_type.html { render body: "HTML" }
|
443
|
+
end
|
444
|
+
end
|
445
|
+
end
|
516
446
|
|
517
|
-
|
447
|
+
*Patrick Toomey*
|
518
448
|
|
519
|
-
|
449
|
+
* `ActionDispatch::Http::UploadedFile` now delegates `to_path` to its tempfile.
|
520
450
|
|
521
|
-
|
451
|
+
This allows uploaded file objects to be passed directly to `File.read`
|
452
|
+
without raising a `TypeError`:
|
522
453
|
|
523
|
-
|
524
|
-
|
525
|
-
use the response helpers provided by `Rack::Response`.
|
454
|
+
uploaded_file = ActionDispatch::Http::UploadedFile.new(tempfile: tmp_file)
|
455
|
+
File.read(uploaded_file)
|
526
456
|
|
527
|
-
*
|
457
|
+
*Aaron Kromer*
|
528
458
|
|
529
|
-
*
|
459
|
+
* Pass along arguments to underlying `get` method in `follow_redirect!`
|
530
460
|
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
defaults to false to support older versions which have removed it from their
|
535
|
-
`ApplicationController`, but is set to true for Rails 5.2.
|
461
|
+
Now all arguments passed to `follow_redirect!` are passed to the underlying
|
462
|
+
`get` method. This for example allows to set custom headers for the
|
463
|
+
redirection request to the server.
|
536
464
|
|
537
|
-
|
465
|
+
follow_redirect!(params: { foo: :bar })
|
538
466
|
|
539
|
-
*
|
467
|
+
*Remo Fritzsche*
|
540
468
|
|
541
|
-
|
469
|
+
* Introduce a new error page to when the implicit render page is accessed in the browser.
|
542
470
|
|
543
|
-
|
471
|
+
Now instead of showing an error page that with exception and backtraces we now show only
|
472
|
+
one informative page.
|
544
473
|
|
545
|
-
|
546
|
-
`driven_by` will register the driver and set additional options passed via
|
547
|
-
the `:options` parameter.
|
474
|
+
*Vinicius Stock*
|
548
475
|
|
549
|
-
|
476
|
+
* Introduce `ActionDispatch::DebugExceptions.register_interceptor`.
|
550
477
|
|
551
|
-
|
478
|
+
Exception aware plugin authors can use the newly introduced
|
479
|
+
`.register_interceptor` method to get the processed exception, instead of
|
480
|
+
monkey patching DebugExceptions.
|
552
481
|
|
553
|
-
|
482
|
+
ActionDispatch::DebugExceptions.register_interceptor do |request, exception|
|
483
|
+
HypoteticalPlugin.capture_exception(request, exception)
|
484
|
+
end
|
554
485
|
|
555
|
-
|
556
|
-
encryption in one faster step and produces shorter ciphertexts. Cookies
|
557
|
-
encrypted using AES in CBC HMAC mode will be seamlessly upgraded when
|
558
|
-
this new mode is enabled via the
|
559
|
-
`action_dispatch.use_authenticated_cookie_encryption` configuration value.
|
486
|
+
*Genadi Samokovarov*
|
560
487
|
|
561
|
-
|
488
|
+
* Output only one Content-Security-Policy nonce header value per request.
|
562
489
|
|
563
|
-
|
490
|
+
Fixes #32597.
|
564
491
|
|
565
|
-
|
566
|
-
^template path ^template tree digest ^class ^id
|
492
|
+
*Andrey Novikov*, *Andrew White*
|
567
493
|
|
568
|
-
|
494
|
+
* Move default headers configuration into their own module that can be included in controllers.
|
569
495
|
|
570
|
-
*
|
571
|
-
`ActiveSupport::Cache` stores and relies on the fact that Active Record has split `#cache_key` and `#cache_version`
|
572
|
-
to support it.
|
496
|
+
*Kevin Deisz*
|
573
497
|
|
574
|
-
|
498
|
+
* Add method `dig` to `session`.
|
575
499
|
|
576
|
-
*
|
500
|
+
*claudiob*, *Takumi Shotoku*
|
577
501
|
|
578
|
-
|
579
|
-
|
580
|
-
may not exist in a certain implementation.
|
502
|
+
* Controller level `force_ssl` has been deprecated in favor of
|
503
|
+
`config.force_ssl`.
|
581
504
|
|
582
|
-
|
505
|
+
*Derek Prior*
|
583
506
|
|
584
|
-
|
507
|
+
* Rails 6 requires Ruby 2.5.0 or newer.
|
585
508
|
|
586
|
-
*
|
509
|
+
*Jeremy Daer*, *Kasper Timm Hansen*
|
587
510
|
|
588
511
|
|
589
|
-
Please check [5-
|
512
|
+
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/actionpack/CHANGELOG.md) for previous changes.
|