Skip to content

Commit c69f367

Browse files
committed
Merge tag 'v7.0.8.7' into 7-0-stable
v7.0.8.7 release
2 parents df5ac03 + 778eab8 commit c69f367

File tree

34 files changed

+174
-37
lines changed

34 files changed

+174
-37
lines changed

RAILS_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.8.6
1+
7.0.8.7

actioncable/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Rails 7.0.8.7 (December 10, 2024) ##
2+
3+
* No changes.
4+
5+
16
## Rails 7.0.8.6 (October 23, 2024) ##
27

38
* No changes.

actioncable/lib/action_cable/gem_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module VERSION
1010
MAJOR = 7
1111
MINOR = 0
1212
TINY = 8
13-
PRE = "6"
13+
PRE = "7"
1414

1515
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
1616
end

actioncable/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rails/actioncable",
3-
"version": "7.0.806",
3+
"version": "7.0.807",
44
"description": "WebSocket framework for Ruby on Rails.",
55
"module": "app/assets/javascripts/actioncable.esm.js",
66
"main": "app/assets/javascripts/actioncable.js",

actionmailbox/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Rails 7.0.8.7 (December 10, 2024) ##
2+
3+
* No changes.
4+
5+
16
## Rails 7.0.8.6 (October 23, 2024) ##
27

38
* No changes.

actionmailbox/lib/action_mailbox/gem_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module VERSION
1010
MAJOR = 7
1111
MINOR = 0
1212
TINY = 8
13-
PRE = "6"
13+
PRE = "7"
1414

1515
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
1616
end

actionmailer/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Rails 7.0.8.7 (December 10, 2024) ##
2+
3+
* No changes.
4+
5+
16
## Rails 7.0.8.6 (October 23, 2024) ##
27

38
* Fix NoMethodError in `block_format` helper

actionmailer/lib/action_mailer/gem_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module VERSION
1010
MAJOR = 7
1111
MINOR = 0
1212
TINY = 8
13-
PRE = "6"
13+
PRE = "7"
1414

1515
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
1616
end

actionpack/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010

1111
*Hartley McGuire*
1212

13+
14+
## Rails 7.0.8.7 (December 10, 2024) ##
15+
16+
* Add validation to content security policies to disallow spaces and semicolons.
17+
Developers should use multiple arguments, and different directive methods instead.
18+
19+
[CVE-2024-54133]
20+
21+
*Gannon McGibbon*
22+
23+
1324
## Rails 7.0.8.6 (October 23, 2024) ##
1425

1526
* No changes.

actionpack/lib/action_dispatch/http/content_security_policy.rb

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ module ActionDispatch # :nodoc:
2222
# policy.report_uri "/csp-violation-report-endpoint"
2323
# end
2424
class ContentSecurityPolicy
25+
class InvalidDirectiveError < StandardError
26+
end
27+
2528
class Middleware
2629
CONTENT_TYPE = "Content-Type"
2730
POLICY = "Content-Security-Policy"
@@ -316,9 +319,9 @@ def build_directives(context, nonce, nonce_directives)
316319
@directives.map do |directive, sources|
317320
if sources.is_a?(Array)
318321
if nonce && nonce_directive?(directive, nonce_directives)
319-
"#{directive} #{build_directive(sources, context).join(' ')} 'nonce-#{nonce}'"
322+
"#{directive} #{build_directive(directive, sources, context).join(' ')} 'nonce-#{nonce}'"
320323
else
321-
"#{directive} #{build_directive(sources, context).join(' ')}"
324+
"#{directive} #{build_directive(directive, sources, context).join(' ')}"
322325
end
323326
elsif sources
324327
directive
@@ -328,8 +331,22 @@ def build_directives(context, nonce, nonce_directives)
328331
end
329332
end
330333

331-
def build_directive(sources, context)
332-
sources.map { |source| resolve_source(source, context) }
334+
def validate(directive, sources)
335+
sources.flatten.each do |source|
336+
if source.include?(";") || source != source.gsub(/[[:space:]]/, "")
337+
raise InvalidDirectiveError, <<~MSG.squish
338+
Invalid Content Security Policy #{directive}: "#{source}".
339+
Directive values must not contain whitespace or semicolons.
340+
Please use multiple arguments or other directive methods instead.
341+
MSG
342+
end
343+
end
344+
end
345+
346+
def build_directive(directive, sources, context)
347+
resolved_sources = sources.map { |source| resolve_source(source, context) }
348+
349+
validate(directive, resolved_sources)
333350
end
334351

335352
def resolve_source(source, context)

0 commit comments

Comments
 (0)