actionview 5.2.4 → 5.2.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionview might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e94b21d68f5daeb4f7bf8727c7f89f7e3bacb9ea29633f798400728408b3265
4
- data.tar.gz: cb460ca02808f6935cc737c75c31f126eec9c8d8cf50c14ae963c40b821d1c7f
3
+ metadata.gz: 7c9ded984056c842554fab54d47aa905a1608850275e62f42ffbdaa9f6b9678b
4
+ data.tar.gz: 7757657de6c7b78b852e154a9e4e5cb9f97e23dafc5315b92f7a7965d46bf81b
5
5
  SHA512:
6
- metadata.gz: 4a5ce41a3ade8b1097d8130ff1129e040b0a9a0a89dae5c81c6ec0b216baea8b408a99ea1e8902dde7092194e4df78f1bedc01f487a4a74b713c9494bd808e9d
7
- data.tar.gz: 3bd5a09c2ba16f20938d2d4ef0d21aebfea1ca226da1fc409c8a7df60f76b5d86027c729bc1c6b0ec92519755f98126512a7876a71397444264e231e3f82180a
6
+ metadata.gz: 9309b8503b260efa316d74e478f06310af4339e6b304cf2a8debb4dc833907f260ac2956e38dc1c01652a5739c7ddb19acf8fbfd7845247e9eb8e0fa3803ed7e
7
+ data.tar.gz: f2152a3e5897a172602b7340721c58825addba9d13d5fcf42c0aa253524e323caa50eda7d532b5a792c471872f165e3d8c049bf8255150095133beb758e7899f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ ## Rails 5.2.5 (March 26, 2021) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 5.2.4.5 (February 10, 2021) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 5.2.4.4 (September 09, 2020) ##
12
+
13
+ * [CVE-2020-15169] Fix potential XSS vulnerability in the `translate`/`t` helper
14
+
15
+ *Jonathan Hefner*
16
+
17
+
18
+ ## Rails 5.2.4.3 (May 18, 2020) ##
19
+
20
+ * [CVE-2020-8167] Check that request is same-origin prior to including CSRF token in XHRs
21
+
22
+
23
+ ## Rails 5.2.4.2 (March 19, 2020) ##
24
+
25
+ * Fix possible XSS vector in `escape_javascript` helper
26
+
27
+ CVE-2020-5267
28
+
29
+ *Aaron Patterson*
30
+
31
+
32
+ ## Rails 5.2.4.1 (December 18, 2019) ##
33
+
34
+ * No changes.
35
+
36
+
1
37
  ## Rails 5.2.4 (November 27, 2019) ##
2
38
 
3
39
  * Allow programmatic click events to trigger Rails UJS click handlers.
@@ -9,7 +9,7 @@ module ActionView
9
9
  module VERSION
10
10
  MAJOR = 5
11
11
  MINOR = 2
12
- TINY = 4
12
+ TINY = 5
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -12,7 +12,9 @@ module ActionView
12
12
  "\n" => '\n',
13
13
  "\r" => '\n',
14
14
  '"' => '\\"',
15
- "'" => "\\'"
15
+ "'" => "\\'",
16
+ "`" => "\\`",
17
+ "$" => "\\$"
16
18
  }
17
19
 
18
20
  JS_ESCAPE_MAP["\342\200\250".dup.force_encoding(Encoding::UTF_8).encode!] = "
"
@@ -26,7 +28,7 @@ module ActionView
26
28
  # $('some_element').replaceWith('<%= j render 'some/element_template' %>');
27
29
  def escape_javascript(javascript)
28
30
  if javascript
29
- result = javascript.gsub(/(\\|<\/|\r\n|\342\200\250|\342\200\251|[\n\r"'])/u) { |match| JS_ESCAPE_MAP[match] }
31
+ result = javascript.gsub(/(\\|<\/|\r\n|\342\200\250|\342\200\251|[\n\r"']|[`]|[$])/u) { |match| JS_ESCAPE_MAP[match] }
30
32
  javascript.html_safe? ? result.html_safe : result
31
33
  else
32
34
  ""
@@ -79,14 +79,22 @@ module ActionView
79
79
 
80
80
  if html_safe_translation_key?(key)
81
81
  html_safe_options = options.dup
82
+
82
83
  options.except(*I18n::RESERVED_KEYS).each do |name, value|
83
84
  unless name == :count && value.is_a?(Numeric)
84
85
  html_safe_options[name] = ERB::Util.html_escape(value.to_s)
85
86
  end
86
87
  end
88
+
89
+ html_safe_options[:default] = MISSING_TRANSLATION unless html_safe_options[:default].blank?
90
+
87
91
  translation = I18n.translate(scope_key_by_partial(key), html_safe_options.merge(raise: i18n_raise))
88
92
 
89
- translation.respond_to?(:html_safe) ? translation.html_safe : translation
93
+ if translation.equal?(MISSING_TRANSLATION)
94
+ options[:default].first
95
+ else
96
+ translation.respond_to?(:html_safe) ? translation.html_safe : translation
97
+ end
90
98
  else
91
99
  I18n.translate(scope_key_by_partial(key), options.merge(raise: i18n_raise))
92
100
  end
@@ -121,6 +129,9 @@ module ActionView
121
129
  alias :l :localize
122
130
 
123
131
  private
132
+ MISSING_TRANSLATION = Object.new
133
+ private_constant :MISSING_TRANSLATION
134
+
124
135
  def scope_key_by_partial(key)
125
136
  if key.to_s.first == "."
126
137
  if @virtual_path
@@ -247,8 +247,8 @@ Released under the MIT license
247
247
  }
248
248
  if (!options.crossDomain) {
249
249
  xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
250
+ CSRFProtection(xhr);
250
251
  }
251
- CSRFProtection(xhr);
252
252
  xhr.withCredentials = !!options.withCredentials;
253
253
  xhr.onreadystatechange = function() {
254
254
  if (xhr.readyState === XMLHttpRequest.DONE) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionview
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.4
4
+ version: 5.2.5
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: 2019-11-27 00:00:00.000000000 Z
11
+ date: 2021-03-26 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: 5.2.4
19
+ version: 5.2.5
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: 5.2.4
26
+ version: 5.2.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -92,28 +92,28 @@ dependencies:
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 5.2.4
95
+ version: 5.2.5
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 5.2.4
102
+ version: 5.2.5
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: activemodel
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 5.2.4
109
+ version: 5.2.5
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - '='
115
115
  - !ruby/object:Gem::Version
116
- version: 5.2.4
116
+ version: 5.2.5
117
117
  description: Simple, battle-tested conventions and helpers for building web pages.
118
118
  email: david@loudthinking.com
119
119
  executables: []
@@ -230,8 +230,8 @@ homepage: http://rubyonrails.org
230
230
  licenses:
231
231
  - MIT
232
232
  metadata:
233
- source_code_uri: https://github.com/rails/rails/tree/v5.2.4/actionview
234
- changelog_uri: https://github.com/rails/rails/blob/v5.2.4/actionview/CHANGELOG.md
233
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.5/actionview
234
+ changelog_uri: https://github.com/rails/rails/blob/v5.2.5/actionview/CHANGELOG.md
235
235
  post_install_message:
236
236
  rdoc_options: []
237
237
  require_paths:
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  version: '0'
249
249
  requirements:
250
250
  - none
251
- rubygems_version: 3.0.3
251
+ rubygems_version: 3.1.2
252
252
  signing_key:
253
253
  specification_version: 4
254
254
  summary: Rendering framework putting the V in MVC (part of Rails).