actionpack 7.1.5 → 7.1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/action_dispatch/http/content_security_policy.rb +21 -4
- data/lib/action_pack/gem_version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2aff0dde19af40e507e288105ed67055af0847d0c37ad34de7cc6b3a630df02
|
4
|
+
data.tar.gz: 6718ca936b16397966ca7fbf39d6f9586313074d4255804532615d04f9c86a6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a7c6df6a5e8d50ea2d2d18aea80e255c270ffb51163a6291ca72e05740cbbaae83621b6c054939cfaf3042f281a7760dcc7bb717c2da525557a87c05205f6ed
|
7
|
+
data.tar.gz: 830503286b4ec58e7b1dc45e7d51c7cfa81c5b92d6d13f7021320991870abeb353888084c2d4140019c07c3c40060a4ce3cee82548ac9f3e08abe7faaaeb20e4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## Rails 7.1.5.1 (December 10, 2024) ##
|
2
|
+
|
3
|
+
* Add validation to content security policies to disallow spaces and semicolons.
|
4
|
+
Developers should use multiple arguments, and different directive methods instead.
|
5
|
+
|
6
|
+
[CVE-2024-54133]
|
7
|
+
|
8
|
+
*Gannon McGibbon*
|
9
|
+
|
10
|
+
|
1
11
|
## Rails 7.1.5 (October 30, 2024) ##
|
2
12
|
|
3
13
|
* No changes.
|
@@ -24,6 +24,9 @@ module ActionDispatch # :nodoc:
|
|
24
24
|
# policy.report_uri "/csp-violation-report-endpoint"
|
25
25
|
# end
|
26
26
|
class ContentSecurityPolicy
|
27
|
+
class InvalidDirectiveError < StandardError
|
28
|
+
end
|
29
|
+
|
27
30
|
class Middleware
|
28
31
|
def initialize(app)
|
29
32
|
@app = app
|
@@ -317,9 +320,9 @@ module ActionDispatch # :nodoc:
|
|
317
320
|
@directives.map do |directive, sources|
|
318
321
|
if sources.is_a?(Array)
|
319
322
|
if nonce && nonce_directive?(directive, nonce_directives)
|
320
|
-
"#{directive} #{build_directive(sources, context).join(' ')} 'nonce-#{nonce}'"
|
323
|
+
"#{directive} #{build_directive(directive, sources, context).join(' ')} 'nonce-#{nonce}'"
|
321
324
|
else
|
322
|
-
"#{directive} #{build_directive(sources, context).join(' ')}"
|
325
|
+
"#{directive} #{build_directive(directive, sources, context).join(' ')}"
|
323
326
|
end
|
324
327
|
elsif sources
|
325
328
|
directive
|
@@ -329,8 +332,22 @@ module ActionDispatch # :nodoc:
|
|
329
332
|
end
|
330
333
|
end
|
331
334
|
|
332
|
-
def
|
333
|
-
sources.
|
335
|
+
def validate(directive, sources)
|
336
|
+
sources.flatten.each do |source|
|
337
|
+
if source.include?(";") || source != source.gsub(/[[:space:]]/, "")
|
338
|
+
raise InvalidDirectiveError, <<~MSG.squish
|
339
|
+
Invalid Content Security Policy #{directive}: "#{source}".
|
340
|
+
Directive values must not contain whitespace or semicolons.
|
341
|
+
Please use multiple arguments or other directive methods instead.
|
342
|
+
MSG
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
def build_directive(directive, sources, context)
|
348
|
+
resolved_sources = sources.map { |source| resolve_source(source, context) }
|
349
|
+
|
350
|
+
validate(directive, resolved_sources)
|
334
351
|
end
|
335
352
|
|
336
353
|
def resolve_source(source, context)
|
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: 7.1.5
|
4
|
+
version: 7.1.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: 2024-10
|
11
|
+
date: 2024-12-10 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: 7.1.5
|
19
|
+
version: 7.1.5.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: 7.1.5
|
26
|
+
version: 7.1.5.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 7.1.5
|
131
|
+
version: 7.1.5.1
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 7.1.5
|
138
|
+
version: 7.1.5.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: activemodel
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 7.1.5
|
145
|
+
version: 7.1.5.1
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 7.1.5
|
152
|
+
version: 7.1.5.1
|
153
153
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
154
154
|
testing MVC web applications. Works with any Rack-compatible server.
|
155
155
|
email: david@loudthinking.com
|
@@ -346,10 +346,10 @@ licenses:
|
|
346
346
|
- MIT
|
347
347
|
metadata:
|
348
348
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
349
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.1.5/actionpack/CHANGELOG.md
|
350
|
-
documentation_uri: https://api.rubyonrails.org/v7.1.5/
|
349
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.5.1/actionpack/CHANGELOG.md
|
350
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.5.1/
|
351
351
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
352
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.1.5/actionpack
|
352
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.5.1/actionpack
|
353
353
|
rubygems_mfa_required: 'true'
|
354
354
|
post_install_message:
|
355
355
|
rdoc_options: []
|
@@ -367,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
367
367
|
version: '0'
|
368
368
|
requirements:
|
369
369
|
- none
|
370
|
-
rubygems_version: 3.5.
|
370
|
+
rubygems_version: 3.5.22
|
371
371
|
signing_key:
|
372
372
|
specification_version: 4
|
373
373
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|