activesupport 6.0.4.7 → 6.0.5.1

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

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c2ac48c4fc14731e5de656bd8d6e95f0e05bbf3e327070658ed4ffe5f4220d1
4
- data.tar.gz: f2c96dbb25d284303c5b8d6c642951085a7ae33dcf19e5423f3143b3e4a11801
3
+ metadata.gz: 499f7a93a25a744627ef2814b4b3c5e8b1e27958ed6e52579a8cad23a7297a04
4
+ data.tar.gz: 80c380dcb61d2e03e0f7f1a8f084b7bc59e2d6d1a4c8f43772cdbecac16a53a8
5
5
  SHA512:
6
- metadata.gz: f5894888b523c8523b1664a00e1daf9d6cd679f78fd0f4ef0dfb5860058d99869960d4241e94d4802e19607e3e42abb6a141b37b85ea596b7e49510cf4f2162b
7
- data.tar.gz: ac6c166043958ea77707d2f4973225568bee0b2d8bf1c3a9518e83f2b3f36f8e4761437cec0cd9de7389a017ea38f91fe89cd7f3b2d8bd03a99900f743bb0f53
6
+ metadata.gz: 757bc75b32d0f52e4b9b9db63f9233674fd5c13d0a6bc965763deb79b024f0215ac05669b1a7118bd49632ab6a8e141f4bed22ee8699cae43fccfc6f4f0d6c45
7
+ data.tar.gz: a29530e3e620fa7ec5ab3b8ec7e6bf40cb5477710c0f336f6ef3fe62e07ce8b7e75bce2bb6b70103c9a9fb66d6df47c830df72bfa8fedb2c45ae434b9adca659
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## Rails 6.0.5.1 (July 12, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.0.5 (May 09, 2022) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 6.0.4.8 (April 26, 2022) ##
12
+
13
+ * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
14
+
15
+ Add the method `ERB::Util.xml_name_escape` to escape dangerous characters
16
+ in names of tags and names of attributes, following the specification of XML.
17
+
18
+ *Álvaro Martín Fraguas*
19
+
20
+
1
21
  ## Rails 6.0.4.7 (March 08, 2022) ##
2
22
 
3
23
  * No changes.
@@ -12,6 +12,14 @@ class ERB
12
12
  HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+)|(#[xX][\dA-Fa-f]+));)/
13
13
  JSON_ESCAPE_REGEXP = /[\u2028\u2029&><]/u
14
14
 
15
+ # Following XML requirements: https://www.w3.org/TR/REC-xml/#NT-Name
16
+ TAG_NAME_START_REGEXP_SET = "@:A-Z_a-z\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}" \
17
+ "\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}" \
18
+ "\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}"
19
+ TAG_NAME_START_REGEXP = /[^#{TAG_NAME_START_REGEXP_SET}]/
20
+ TAG_NAME_FOLLOWING_REGEXP = /[^#{TAG_NAME_START_REGEXP_SET}\-.0-9\u{B7}\u{0300}-\u{036F}\u{203F}-\u{2040}]/
21
+ TAG_NAME_REPLACEMENT_CHAR = "_"
22
+
15
23
  # A utility method for escaping HTML tag characters.
16
24
  # This method is also aliased as <tt>h</tt>.
17
25
  #
@@ -116,6 +124,26 @@ class ERB
116
124
  end
117
125
 
118
126
  module_function :json_escape
127
+
128
+ # A utility method for escaping XML names of tags and names of attributes.
129
+ #
130
+ # xml_name_escape('1 < 2 & 3')
131
+ # # => "1___2___3"
132
+ #
133
+ # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name
134
+ def xml_name_escape(name)
135
+ name = name.to_s
136
+ return "" if name.blank?
137
+
138
+ starting_char = name[0].gsub(TAG_NAME_START_REGEXP, TAG_NAME_REPLACEMENT_CHAR)
139
+
140
+ return starting_char if name.size == 1
141
+
142
+ following_chars = name[1..-1].gsub(TAG_NAME_FOLLOWING_REGEXP, TAG_NAME_REPLACEMENT_CHAR)
143
+
144
+ starting_char + following_chars
145
+ end
146
+ module_function :xml_name_escape
119
147
  end
120
148
  end
121
149
 
@@ -9,8 +9,8 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 0
12
- TINY = 4
13
- PRE = "7"
12
+ TINY = 5
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: activesupport
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.4.7
4
+ version: 6.0.5.1
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: 2022-03-08 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -359,10 +359,11 @@ licenses:
359
359
  - MIT
360
360
  metadata:
361
361
  bug_tracker_uri: https://github.com/rails/rails/issues
362
- changelog_uri: https://github.com/rails/rails/blob/v6.0.4.7/activesupport/CHANGELOG.md
363
- documentation_uri: https://api.rubyonrails.org/v6.0.4.7/
362
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.5.1/activesupport/CHANGELOG.md
363
+ documentation_uri: https://api.rubyonrails.org/v6.0.5.1/
364
364
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
365
- source_code_uri: https://github.com/rails/rails/tree/v6.0.4.7/activesupport
365
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.5.1/activesupport
366
+ rubygems_mfa_required: 'true'
366
367
  post_install_message:
367
368
  rdoc_options:
368
369
  - "--encoding"
@@ -380,7 +381,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
380
381
  - !ruby/object:Gem::Version
381
382
  version: '0'
382
383
  requirements: []
383
- rubygems_version: 3.1.6
384
+ rubygems_version: 3.3.3
384
385
  signing_key:
385
386
  specification_version: 4
386
387
  summary: A toolkit of support libraries and Ruby core extensions extracted from the