legacy-rails-CVE-2020-5267-patch 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/main.yml +17 -0
- data/.gitignore +2 -0
- data/.tool-versions +1 -0
- data/Appraisals +7 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +118 -0
- data/LICENSE.txt +21 -0
- data/README.md +19 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/gemfiles/rails_3.2.gemfile +9 -0
- data/gemfiles/rails_3.2.gemfile.lock +105 -0
- data/gemfiles/rails_4.2.gemfile +9 -0
- data/gemfiles/rails_4.2.gemfile.lock +118 -0
- data/legacy-rails-CVE-2020-5267-patch.gemspec +31 -0
- data/lib/legacy-rails-CVE-2020-5267-patch.rb +26 -0
- data/lib/legacy-rails-CVE-2020-5267-patch/version.rb +3 -0
- metadata +107 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 42798b8ca819248debb8a3d8fec3345a6a64a2bd802e47cf4fd441a4d149d567
|
4
|
+
data.tar.gz: 33e47027dfbecfa523e6b845252bd78bb6822001ad8e86c1a34f7f9dbe21a756
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d6dd8f38b3565c5e5a1466f9f2af5efd01549b01061accddceec992894bc4e297b1f426d063b441a660d72e72b90cd4f1f83402ca67caec15911b75a25084454
|
7
|
+
data.tar.gz: 00e8802fc722205f65ccfee2647c6996c000ec9dd119d267d514e74bc2229582e1654963e94cba693a3fad4e289c06af9417c889a62dd9dfc4bf02189cc1dfb2
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- uses: actions/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
ruby-version: 2.4
|
13
|
+
- name: test
|
14
|
+
run: |
|
15
|
+
gem install bundler -v "< 2"
|
16
|
+
bundle install --jobs 4 --retry 3
|
17
|
+
bundle exec rake test
|
data/.gitignore
ADDED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.4.9
|
data/Appraisals
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
legacy-rails-CVE-2020-5267-patch (1.0.0)
|
5
|
+
rails (< 5)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionmailer (4.2.11.1)
|
11
|
+
actionpack (= 4.2.11.1)
|
12
|
+
actionview (= 4.2.11.1)
|
13
|
+
activejob (= 4.2.11.1)
|
14
|
+
mail (~> 2.5, >= 2.5.4)
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
|
+
actionpack (4.2.11.1)
|
17
|
+
actionview (= 4.2.11.1)
|
18
|
+
activesupport (= 4.2.11.1)
|
19
|
+
rack (~> 1.6)
|
20
|
+
rack-test (~> 0.6.2)
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
23
|
+
actionview (4.2.11.1)
|
24
|
+
activesupport (= 4.2.11.1)
|
25
|
+
builder (~> 3.1)
|
26
|
+
erubis (~> 2.7.0)
|
27
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
29
|
+
activejob (4.2.11.1)
|
30
|
+
activesupport (= 4.2.11.1)
|
31
|
+
globalid (>= 0.3.0)
|
32
|
+
activemodel (4.2.11.1)
|
33
|
+
activesupport (= 4.2.11.1)
|
34
|
+
builder (~> 3.1)
|
35
|
+
activerecord (4.2.11.1)
|
36
|
+
activemodel (= 4.2.11.1)
|
37
|
+
activesupport (= 4.2.11.1)
|
38
|
+
arel (~> 6.0)
|
39
|
+
activesupport (4.2.11.1)
|
40
|
+
i18n (~> 0.7)
|
41
|
+
minitest (~> 5.1)
|
42
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
43
|
+
tzinfo (~> 1.1)
|
44
|
+
appraisal (2.2.0)
|
45
|
+
bundler
|
46
|
+
rake
|
47
|
+
thor (>= 0.14.0)
|
48
|
+
arel (6.0.4)
|
49
|
+
builder (3.2.4)
|
50
|
+
concurrent-ruby (1.1.6)
|
51
|
+
crass (1.0.6)
|
52
|
+
erubis (2.7.0)
|
53
|
+
globalid (0.4.2)
|
54
|
+
activesupport (>= 4.2.0)
|
55
|
+
i18n (0.9.5)
|
56
|
+
concurrent-ruby (~> 1.0)
|
57
|
+
loofah (2.4.0)
|
58
|
+
crass (~> 1.0.2)
|
59
|
+
nokogiri (>= 1.5.9)
|
60
|
+
mail (2.7.1)
|
61
|
+
mini_mime (>= 0.1.1)
|
62
|
+
mini_mime (1.0.2)
|
63
|
+
mini_portile2 (2.4.0)
|
64
|
+
minitest (5.14.0)
|
65
|
+
nokogiri (1.10.9)
|
66
|
+
mini_portile2 (~> 2.4.0)
|
67
|
+
rack (1.6.13)
|
68
|
+
rack-test (0.6.3)
|
69
|
+
rack (>= 1.0)
|
70
|
+
rails (4.2.11.1)
|
71
|
+
actionmailer (= 4.2.11.1)
|
72
|
+
actionpack (= 4.2.11.1)
|
73
|
+
actionview (= 4.2.11.1)
|
74
|
+
activejob (= 4.2.11.1)
|
75
|
+
activemodel (= 4.2.11.1)
|
76
|
+
activerecord (= 4.2.11.1)
|
77
|
+
activesupport (= 4.2.11.1)
|
78
|
+
bundler (>= 1.3.0, < 2.0)
|
79
|
+
railties (= 4.2.11.1)
|
80
|
+
sprockets-rails
|
81
|
+
rails-deprecated_sanitizer (1.0.3)
|
82
|
+
activesupport (>= 4.2.0.alpha)
|
83
|
+
rails-dom-testing (1.0.9)
|
84
|
+
activesupport (>= 4.2.0, < 5.0)
|
85
|
+
nokogiri (~> 1.6)
|
86
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
87
|
+
rails-html-sanitizer (1.3.0)
|
88
|
+
loofah (~> 2.3)
|
89
|
+
railties (4.2.11.1)
|
90
|
+
actionpack (= 4.2.11.1)
|
91
|
+
activesupport (= 4.2.11.1)
|
92
|
+
rake (>= 0.8.7)
|
93
|
+
thor (>= 0.18.1, < 2.0)
|
94
|
+
rake (12.3.3)
|
95
|
+
sprockets (3.7.2)
|
96
|
+
concurrent-ruby (~> 1.0)
|
97
|
+
rack (> 1, < 3)
|
98
|
+
sprockets-rails (3.2.1)
|
99
|
+
actionpack (>= 4.0)
|
100
|
+
activesupport (>= 4.0)
|
101
|
+
sprockets (>= 3.0.0)
|
102
|
+
thor (1.0.1)
|
103
|
+
thread_safe (0.3.6)
|
104
|
+
tzinfo (1.2.6)
|
105
|
+
thread_safe (~> 0.1)
|
106
|
+
|
107
|
+
PLATFORMS
|
108
|
+
ruby
|
109
|
+
|
110
|
+
DEPENDENCIES
|
111
|
+
appraisal (~> 2.2.0)
|
112
|
+
bundler (< 2)
|
113
|
+
legacy-rails-CVE-2020-5267-patch!
|
114
|
+
minitest (~> 5.0)
|
115
|
+
rake (~> 12.0)
|
116
|
+
|
117
|
+
BUNDLED WITH
|
118
|
+
1.17.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Nick Muerdter
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# legacy-rails-CVE-2020-5267-patch
|
2
|
+
|
3
|
+
![CI](https://github.com/GUI/legacy-rails-CVE-2020-5267-patch/workflows/CI/badge.svg)
|
4
|
+
|
5
|
+
A patch for [CVE-2020-5267](https://github.com/advisories/GHSA-65cv-r6x7-79hv) for Rails 4 and Rails 3. Upgrading Rails would definitely be better, but in the meantime if you're stuck on older versions of Rails, this provides the monkey patch noted in the security advisory packaged and tested as a gem.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'legacy-rails-CVE-2020-5267-patch'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```
|
18
|
+
$ bundle install
|
19
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "legacy/rails/CVE/2020/5267/patch"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
legacy-rails-CVE-2020-5267-patch (1.0.0)
|
5
|
+
rails (< 5)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionmailer (3.2.22.5)
|
11
|
+
actionpack (= 3.2.22.5)
|
12
|
+
mail (~> 2.5.4)
|
13
|
+
actionpack (3.2.22.5)
|
14
|
+
activemodel (= 3.2.22.5)
|
15
|
+
activesupport (= 3.2.22.5)
|
16
|
+
builder (~> 3.0.0)
|
17
|
+
erubis (~> 2.7.0)
|
18
|
+
journey (~> 1.0.4)
|
19
|
+
rack (~> 1.4.5)
|
20
|
+
rack-cache (~> 1.2)
|
21
|
+
rack-test (~> 0.6.1)
|
22
|
+
sprockets (~> 2.2.1)
|
23
|
+
activemodel (3.2.22.5)
|
24
|
+
activesupport (= 3.2.22.5)
|
25
|
+
builder (~> 3.0.0)
|
26
|
+
activerecord (3.2.22.5)
|
27
|
+
activemodel (= 3.2.22.5)
|
28
|
+
activesupport (= 3.2.22.5)
|
29
|
+
arel (~> 3.0.2)
|
30
|
+
tzinfo (~> 0.3.29)
|
31
|
+
activeresource (3.2.22.5)
|
32
|
+
activemodel (= 3.2.22.5)
|
33
|
+
activesupport (= 3.2.22.5)
|
34
|
+
activesupport (3.2.22.5)
|
35
|
+
i18n (~> 0.6, >= 0.6.4)
|
36
|
+
multi_json (~> 1.0)
|
37
|
+
appraisal (2.2.0)
|
38
|
+
bundler
|
39
|
+
rake
|
40
|
+
thor (>= 0.14.0)
|
41
|
+
arel (3.0.3)
|
42
|
+
builder (3.0.4)
|
43
|
+
concurrent-ruby (1.1.6)
|
44
|
+
erubis (2.7.0)
|
45
|
+
hike (1.2.3)
|
46
|
+
i18n (0.9.5)
|
47
|
+
concurrent-ruby (~> 1.0)
|
48
|
+
journey (1.0.4)
|
49
|
+
json (1.8.6)
|
50
|
+
mail (2.5.5)
|
51
|
+
mime-types (~> 1.16)
|
52
|
+
treetop (~> 1.4.8)
|
53
|
+
mime-types (1.25.1)
|
54
|
+
minitest (5.14.0)
|
55
|
+
multi_json (1.14.1)
|
56
|
+
polyglot (0.3.5)
|
57
|
+
rack (1.4.7)
|
58
|
+
rack-cache (1.11.0)
|
59
|
+
rack (>= 0.4)
|
60
|
+
rack-ssl (1.3.4)
|
61
|
+
rack
|
62
|
+
rack-test (0.6.3)
|
63
|
+
rack (>= 1.0)
|
64
|
+
rails (3.2.22.5)
|
65
|
+
actionmailer (= 3.2.22.5)
|
66
|
+
actionpack (= 3.2.22.5)
|
67
|
+
activerecord (= 3.2.22.5)
|
68
|
+
activeresource (= 3.2.22.5)
|
69
|
+
activesupport (= 3.2.22.5)
|
70
|
+
bundler (~> 1.0)
|
71
|
+
railties (= 3.2.22.5)
|
72
|
+
railties (3.2.22.5)
|
73
|
+
actionpack (= 3.2.22.5)
|
74
|
+
activesupport (= 3.2.22.5)
|
75
|
+
rack-ssl (~> 1.3.2)
|
76
|
+
rake (>= 0.8.7)
|
77
|
+
rdoc (~> 3.4)
|
78
|
+
thor (>= 0.14.6, < 2.0)
|
79
|
+
rake (12.3.3)
|
80
|
+
rdoc (3.12.2)
|
81
|
+
json (~> 1.4)
|
82
|
+
sprockets (2.2.3)
|
83
|
+
hike (~> 1.2)
|
84
|
+
multi_json (~> 1.0)
|
85
|
+
rack (~> 1.0)
|
86
|
+
tilt (~> 1.1, != 1.3.0)
|
87
|
+
thor (1.0.1)
|
88
|
+
tilt (1.4.1)
|
89
|
+
treetop (1.4.15)
|
90
|
+
polyglot
|
91
|
+
polyglot (>= 0.3.1)
|
92
|
+
tzinfo (0.3.56)
|
93
|
+
|
94
|
+
PLATFORMS
|
95
|
+
ruby
|
96
|
+
|
97
|
+
DEPENDENCIES
|
98
|
+
appraisal (~> 2.2.0)
|
99
|
+
legacy-rails-CVE-2020-5267-patch!
|
100
|
+
minitest (~> 5.0)
|
101
|
+
rails (~> 3.2.22)
|
102
|
+
rake (~> 12.0)
|
103
|
+
|
104
|
+
BUNDLED WITH
|
105
|
+
1.17.3
|
@@ -0,0 +1,118 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
legacy-rails-CVE-2020-5267-patch (1.0.0)
|
5
|
+
rails (< 5)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionmailer (4.2.11.1)
|
11
|
+
actionpack (= 4.2.11.1)
|
12
|
+
actionview (= 4.2.11.1)
|
13
|
+
activejob (= 4.2.11.1)
|
14
|
+
mail (~> 2.5, >= 2.5.4)
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
|
+
actionpack (4.2.11.1)
|
17
|
+
actionview (= 4.2.11.1)
|
18
|
+
activesupport (= 4.2.11.1)
|
19
|
+
rack (~> 1.6)
|
20
|
+
rack-test (~> 0.6.2)
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
23
|
+
actionview (4.2.11.1)
|
24
|
+
activesupport (= 4.2.11.1)
|
25
|
+
builder (~> 3.1)
|
26
|
+
erubis (~> 2.7.0)
|
27
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
29
|
+
activejob (4.2.11.1)
|
30
|
+
activesupport (= 4.2.11.1)
|
31
|
+
globalid (>= 0.3.0)
|
32
|
+
activemodel (4.2.11.1)
|
33
|
+
activesupport (= 4.2.11.1)
|
34
|
+
builder (~> 3.1)
|
35
|
+
activerecord (4.2.11.1)
|
36
|
+
activemodel (= 4.2.11.1)
|
37
|
+
activesupport (= 4.2.11.1)
|
38
|
+
arel (~> 6.0)
|
39
|
+
activesupport (4.2.11.1)
|
40
|
+
i18n (~> 0.7)
|
41
|
+
minitest (~> 5.1)
|
42
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
43
|
+
tzinfo (~> 1.1)
|
44
|
+
appraisal (2.2.0)
|
45
|
+
bundler
|
46
|
+
rake
|
47
|
+
thor (>= 0.14.0)
|
48
|
+
arel (6.0.4)
|
49
|
+
builder (3.2.4)
|
50
|
+
concurrent-ruby (1.1.6)
|
51
|
+
crass (1.0.6)
|
52
|
+
erubis (2.7.0)
|
53
|
+
globalid (0.4.2)
|
54
|
+
activesupport (>= 4.2.0)
|
55
|
+
i18n (0.9.5)
|
56
|
+
concurrent-ruby (~> 1.0)
|
57
|
+
loofah (2.4.0)
|
58
|
+
crass (~> 1.0.2)
|
59
|
+
nokogiri (>= 1.5.9)
|
60
|
+
mail (2.7.1)
|
61
|
+
mini_mime (>= 0.1.1)
|
62
|
+
mini_mime (1.0.2)
|
63
|
+
mini_portile2 (2.4.0)
|
64
|
+
minitest (5.14.0)
|
65
|
+
nokogiri (1.10.9)
|
66
|
+
mini_portile2 (~> 2.4.0)
|
67
|
+
rack (1.6.13)
|
68
|
+
rack-test (0.6.3)
|
69
|
+
rack (>= 1.0)
|
70
|
+
rails (4.2.11.1)
|
71
|
+
actionmailer (= 4.2.11.1)
|
72
|
+
actionpack (= 4.2.11.1)
|
73
|
+
actionview (= 4.2.11.1)
|
74
|
+
activejob (= 4.2.11.1)
|
75
|
+
activemodel (= 4.2.11.1)
|
76
|
+
activerecord (= 4.2.11.1)
|
77
|
+
activesupport (= 4.2.11.1)
|
78
|
+
bundler (>= 1.3.0, < 2.0)
|
79
|
+
railties (= 4.2.11.1)
|
80
|
+
sprockets-rails
|
81
|
+
rails-deprecated_sanitizer (1.0.3)
|
82
|
+
activesupport (>= 4.2.0.alpha)
|
83
|
+
rails-dom-testing (1.0.9)
|
84
|
+
activesupport (>= 4.2.0, < 5.0)
|
85
|
+
nokogiri (~> 1.6)
|
86
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
87
|
+
rails-html-sanitizer (1.3.0)
|
88
|
+
loofah (~> 2.3)
|
89
|
+
railties (4.2.11.1)
|
90
|
+
actionpack (= 4.2.11.1)
|
91
|
+
activesupport (= 4.2.11.1)
|
92
|
+
rake (>= 0.8.7)
|
93
|
+
thor (>= 0.18.1, < 2.0)
|
94
|
+
rake (12.3.3)
|
95
|
+
sprockets (3.7.2)
|
96
|
+
concurrent-ruby (~> 1.0)
|
97
|
+
rack (> 1, < 3)
|
98
|
+
sprockets-rails (3.2.1)
|
99
|
+
actionpack (>= 4.0)
|
100
|
+
activesupport (>= 4.0)
|
101
|
+
sprockets (>= 3.0.0)
|
102
|
+
thor (1.0.1)
|
103
|
+
thread_safe (0.3.6)
|
104
|
+
tzinfo (1.2.6)
|
105
|
+
thread_safe (~> 0.1)
|
106
|
+
|
107
|
+
PLATFORMS
|
108
|
+
ruby
|
109
|
+
|
110
|
+
DEPENDENCIES
|
111
|
+
appraisal (~> 2.2.0)
|
112
|
+
legacy-rails-CVE-2020-5267-patch!
|
113
|
+
minitest (~> 5.0)
|
114
|
+
rails (~> 4.2.11)
|
115
|
+
rake (~> 12.0)
|
116
|
+
|
117
|
+
BUNDLED WITH
|
118
|
+
1.17.3
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative "lib/legacy-rails-CVE-2020-5267-patch/version"
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "legacy-rails-CVE-2020-5267-patch"
|
5
|
+
spec.version = LegacyRailsCVE20205267Patch::VERSION
|
6
|
+
spec.authors = ["Nick Muerdter"]
|
7
|
+
spec.email = ["12112+GUI@users.noreply.github.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{Patch CVE-2020-5267 for Rails 4 and Rails 3.}
|
10
|
+
spec.homepage = "https://github.com/GUI/legacy-rails-CVE-2020-5267-patch"
|
11
|
+
spec.license = "MIT"
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
15
|
+
spec.metadata["source_code_uri"] = "https://github.com/GUI/legacy-rails-CVE-2020-5267-patch/tree/v#{LegacyRailsCVE20205267Patch::VERSION}"
|
16
|
+
spec.metadata["changelog_uri"] = "https://github.com/GUI/legacy-rails-CVE-2020-5267-patch/blob/v#{LegacyRailsCVE20205267Patch::VERSION}/CHANGELOG.md"
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
end
|
23
|
+
spec.bindir = "exe"
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.require_paths = ["lib"]
|
26
|
+
|
27
|
+
spec.add_dependency "rails", "< 5"
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "< 2"
|
30
|
+
spec.add_development_dependency "appraisal", "~> 2.2.0"
|
31
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "legacy-rails-CVE-2020-5267-patch/version"
|
2
|
+
require "action_view"
|
3
|
+
|
4
|
+
ActionView::Helpers::JavaScriptHelper::JS_ESCAPE_MAP.merge!(
|
5
|
+
{
|
6
|
+
"`" => "\\`",
|
7
|
+
"$" => "\\$"
|
8
|
+
}
|
9
|
+
)
|
10
|
+
|
11
|
+
module ActionView::Helpers::JavaScriptHelper
|
12
|
+
alias :old_ej :escape_javascript
|
13
|
+
alias :old_j :j
|
14
|
+
|
15
|
+
def escape_javascript(javascript)
|
16
|
+
javascript = javascript.to_s
|
17
|
+
if javascript.empty?
|
18
|
+
result = ""
|
19
|
+
else
|
20
|
+
result = javascript.gsub(/(\\|<\/|\r\n|\342\200\250|\342\200\251|[\n\r"']|[`]|[$])/u, JS_ESCAPE_MAP)
|
21
|
+
end
|
22
|
+
javascript.html_safe? ? result.html_safe : result
|
23
|
+
end
|
24
|
+
|
25
|
+
alias :j :escape_javascript
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: legacy-rails-CVE-2020-5267-patch
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nick Muerdter
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "<"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "<"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "<"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: appraisal
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.2.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.2.0
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- 12112+GUI@users.noreply.github.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".github/workflows/main.yml"
|
63
|
+
- ".gitignore"
|
64
|
+
- ".tool-versions"
|
65
|
+
- Appraisals
|
66
|
+
- CHANGELOG.md
|
67
|
+
- Gemfile
|
68
|
+
- Gemfile.lock
|
69
|
+
- LICENSE.txt
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- bin/console
|
73
|
+
- bin/setup
|
74
|
+
- gemfiles/rails_3.2.gemfile
|
75
|
+
- gemfiles/rails_3.2.gemfile.lock
|
76
|
+
- gemfiles/rails_4.2.gemfile
|
77
|
+
- gemfiles/rails_4.2.gemfile.lock
|
78
|
+
- legacy-rails-CVE-2020-5267-patch.gemspec
|
79
|
+
- lib/legacy-rails-CVE-2020-5267-patch.rb
|
80
|
+
- lib/legacy-rails-CVE-2020-5267-patch/version.rb
|
81
|
+
homepage: https://github.com/GUI/legacy-rails-CVE-2020-5267-patch
|
82
|
+
licenses:
|
83
|
+
- MIT
|
84
|
+
metadata:
|
85
|
+
homepage_uri: https://github.com/GUI/legacy-rails-CVE-2020-5267-patch
|
86
|
+
source_code_uri: https://github.com/GUI/legacy-rails-CVE-2020-5267-patch/tree/v1.0.0
|
87
|
+
changelog_uri: https://github.com/GUI/legacy-rails-CVE-2020-5267-patch/blob/v1.0.0/CHANGELOG.md
|
88
|
+
post_install_message:
|
89
|
+
rdoc_options: []
|
90
|
+
require_paths:
|
91
|
+
- lib
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.3.0
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
requirements: []
|
103
|
+
rubygems_version: 3.1.2
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: Patch CVE-2020-5267 for Rails 4 and Rails 3.
|
107
|
+
test_files: []
|