cve_schema 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.document +3 -0
  3. data/.github/workflows/ruby.yml +28 -0
  4. data/.gitignore +6 -0
  5. data/.rspec +1 -0
  6. data/.yardopts +1 -0
  7. data/ChangeLog.md +26 -0
  8. data/Gemfile +14 -0
  9. data/LICENSE.txt +20 -0
  10. data/README.md +50 -0
  11. data/Rakefile +23 -0
  12. data/benchmark.rb +47 -0
  13. data/cve_schema.gemspec +61 -0
  14. data/gemspec.yml +19 -0
  15. data/lib/cve_schema.rb +2 -0
  16. data/lib/cve_schema/cve.rb +257 -0
  17. data/lib/cve_schema/cve/affects.rb +55 -0
  18. data/lib/cve_schema/cve/configuration.rb +14 -0
  19. data/lib/cve_schema/cve/credit.rb +14 -0
  20. data/lib/cve_schema/cve/data_meta.rb +185 -0
  21. data/lib/cve_schema/cve/description.rb +24 -0
  22. data/lib/cve_schema/cve/exploit.rb +14 -0
  23. data/lib/cve_schema/cve/has_lang_value.rb +93 -0
  24. data/lib/cve_schema/cve/id.rb +79 -0
  25. data/lib/cve_schema/cve/impact.rb +75 -0
  26. data/lib/cve_schema/cve/impact/cvss_v2.rb +318 -0
  27. data/lib/cve_schema/cve/impact/cvss_v3.rb +388 -0
  28. data/lib/cve_schema/cve/na.rb +8 -0
  29. data/lib/cve_schema/cve/problem_type.rb +56 -0
  30. data/lib/cve_schema/cve/product.rb +79 -0
  31. data/lib/cve_schema/cve/reference.rb +82 -0
  32. data/lib/cve_schema/cve/solution.rb +14 -0
  33. data/lib/cve_schema/cve/source.rb +75 -0
  34. data/lib/cve_schema/cve/timeline.rb +65 -0
  35. data/lib/cve_schema/cve/timestamp.rb +25 -0
  36. data/lib/cve_schema/cve/vendor.rb +83 -0
  37. data/lib/cve_schema/cve/version.rb +126 -0
  38. data/lib/cve_schema/cve/work_around.rb +14 -0
  39. data/lib/cve_schema/exceptions.rb +20 -0
  40. data/lib/cve_schema/version.rb +6 -0
  41. data/spec/affects_spec.rb +28 -0
  42. data/spec/configuration_spec.rb +6 -0
  43. data/spec/credit_spec.rb +6 -0
  44. data/spec/cve_schema_spec.rb +8 -0
  45. data/spec/cve_spec.rb +414 -0
  46. data/spec/data_meta_spec.rb +167 -0
  47. data/spec/description.rb +24 -0
  48. data/spec/exploit_spec.rb +6 -0
  49. data/spec/fixtures/CVE-2020-1994.json +140 -0
  50. data/spec/fixtures/CVE-2020-2005.json +152 -0
  51. data/spec/fixtures/CVE-2020-2050.json +233 -0
  52. data/spec/fixtures/CVE-2020-4700.json +99 -0
  53. data/spec/has_lang_value_spec.rb +56 -0
  54. data/spec/id_spec.rb +91 -0
  55. data/spec/impact/cvss_v3_spec.rb +118 -0
  56. data/spec/impact_spec.rb +45 -0
  57. data/spec/na_spec.rb +14 -0
  58. data/spec/problem_type_spec.rb +26 -0
  59. data/spec/product_spec.rb +73 -0
  60. data/spec/reference_spec.rb +70 -0
  61. data/spec/shared_examples.rb +19 -0
  62. data/spec/solution_spec.rb +6 -0
  63. data/spec/source_spec.rb +84 -0
  64. data/spec/spec_helper.rb +4 -0
  65. data/spec/timeline_spec.rb +86 -0
  66. data/spec/timestamp_spec.rb +24 -0
  67. data/spec/vendor_spec.rb +73 -0
  68. data/spec/version_spec.rb +104 -0
  69. data/spec/work_around_spec.rb +6 -0
  70. metadata +133 -0
@@ -0,0 +1,233 @@
1
+ {
2
+ "CVE_data_meta": {
3
+ "ASSIGNER": "psirt@paloaltonetworks.com",
4
+ "DATE_PUBLIC": "2020-11-11T17:00:00.000Z",
5
+ "ID": "CVE-2020-2050",
6
+ "STATE": "PUBLIC",
7
+ "TITLE": "PAN-OS: Authentication bypass vulnerability in GlobalProtect SSL VPN client certificate verification"
8
+ },
9
+ "affects": {
10
+ "vendor": {
11
+ "vendor_data": [
12
+ {
13
+ "product": {
14
+ "product_data": [
15
+ {
16
+ "product_name": "PAN-OS",
17
+ "version": {
18
+ "version_data": [
19
+ {
20
+ "version_affected": "<",
21
+ "version_name": "8.1",
22
+ "version_value": "8.1.17"
23
+ },
24
+ {
25
+ "version_affected": "<",
26
+ "version_name": "9.0",
27
+ "version_value": "9.0.11"
28
+ },
29
+ {
30
+ "version_affected": "<",
31
+ "version_name": "9.1",
32
+ "version_value": "9.1.5"
33
+ },
34
+ {
35
+ "version_affected": "<",
36
+ "version_name": "10.0",
37
+ "version_value": "10.0.1"
38
+ },
39
+ {
40
+ "version_affected": "!>=",
41
+ "version_name": "8.1",
42
+ "version_value": "8.1.17"
43
+ },
44
+ {
45
+ "version_affected": "!>=",
46
+ "version_name": "9.0",
47
+ "version_value": "9.0.11"
48
+ },
49
+ {
50
+ "version_affected": "!>=",
51
+ "version_name": "9.1",
52
+ "version_value": "9.1.5"
53
+ },
54
+ {
55
+ "version_affected": "!>=",
56
+ "version_name": "10.0",
57
+ "version_value": "10.0.1"
58
+ }
59
+ ]
60
+ }
61
+ }
62
+ ]
63
+ },
64
+ "vendor_name": "Palo Alto Networks"
65
+ }
66
+ ]
67
+ }
68
+ },
69
+ "configuration": [
70
+ {
71
+ "lang": "eng",
72
+ "value": "This issue is only applicable to PAN-OS appliances using the GlobalProtect SSL VPN gateway or portal configured to allow users to authenticate with client certificate authentication.\n\nThis issue can not be exploited if client certificate authentication is not in use.\n\nOther forms of authentication are not impacted by this issue.\n"
73
+ }
74
+ ],
75
+ "credit": [
76
+ {
77
+ "lang": "eng",
78
+ "value": "This issue was found by Nicholas Newsom of Palo Alto Networks during internal security review."
79
+ }
80
+ ],
81
+ "data_format": "MITRE",
82
+ "data_type": "CVE",
83
+ "data_version": "4.0",
84
+ "description": {
85
+ "description_data": [
86
+ {
87
+ "lang": "eng",
88
+ "value": "An authentication bypass vulnerability exists in the GlobalProtect SSL VPN component of Palo Alto Networks PAN-OS software that allows an attacker to bypass all client certificate checks with an invalid certificate. A remote attacker can successfully authenticate as any user and gain access to restricted VPN network resources when the gateway or portal is configured to rely entirely on certificate-based authentication. Impacted features that use SSL VPN with client certificate verification are: GlobalProtect Gateway, GlobalProtect Portal, GlobalProtect Clientless VPN In configurations where client certificate verification is used in conjunction with other authentication methods, the protections added by the certificate check are ignored as a result of this issue. This issue impacts: PAN-OS 8.1 versions earlier than PAN-OS 8.1.17; PAN-OS 9.0 versions earlier than PAN-OS 9.0.11; PAN-OS 9.1 versions earlier than PAN-OS 9.1.5; PAN-OS 10.0 versions earlier than PAN-OS 10.0.1."
89
+ }
90
+ ]
91
+ },
92
+ "exploit": [
93
+ {
94
+ "lang": "eng",
95
+ "value": "Palo Alto Networks is not aware of any malicious exploitation of this issue."
96
+ }
97
+ ],
98
+ "generator": {
99
+ "engine": "Vulnogram 0.0.9"
100
+ },
101
+ "impact": {
102
+ "cvss": {
103
+ "attackComplexity": "LOW",
104
+ "attackVector": "NETWORK",
105
+ "availabilityImpact": "NONE",
106
+ "baseScore": 8.2,
107
+ "baseSeverity": "HIGH",
108
+ "confidentialityImpact": "HIGH",
109
+ "integrityImpact": "LOW",
110
+ "privilegesRequired": "NONE",
111
+ "scope": "UNCHANGED",
112
+ "userInteraction": "NONE",
113
+ "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N",
114
+ "version": "3.1"
115
+ }
116
+ },
117
+ "problemtype": {
118
+ "problemtype_data": [
119
+ {
120
+ "description": [
121
+ {
122
+ "lang": "eng",
123
+ "value": "CWE-285 Improper Authorization"
124
+ }
125
+ ]
126
+ }
127
+ ]
128
+ },
129
+ "references": {
130
+ "reference_data": [
131
+ {
132
+ "refsource": "MISC",
133
+ "url": "https://security.paloaltonetworks.com/CVE-2020-2050",
134
+ "name": "https://security.paloaltonetworks.com/CVE-2020-2050"
135
+ }
136
+ ]
137
+ },
138
+ "solution": [
139
+ {
140
+ "lang": "eng",
141
+ "value": "This issue is fixed in PAN-OS 8.1.17, PAN-OS 9.0.11, PAN-OS 9.1.5, PAN-OS 10.0.1, and all later PAN-OS versions."
142
+ }
143
+ ],
144
+ "source": {
145
+ "defect": [
146
+ "PAN-146650"
147
+ ],
148
+ "discovery": "INTERNAL"
149
+ },
150
+ "timeline": [
151
+ {
152
+ "lang": "eng",
153
+ "time": "2020-11-11T17:00:00.000Z",
154
+ "value": "Initial publication"
155
+ }
156
+ ],
157
+ "work_around": [
158
+ {
159
+ "lang": "eng",
160
+ "value": "This issue can be mitigated by configuring GlobalProtect SSL VPN to require gateway and portal users to authenticate with their credentials. Other authentication methods are not impacted by this issue."
161
+ }
162
+ ],
163
+ "x_advisoryEoL": false,
164
+ "x_affectedList": [
165
+ "PAN-OS 10.0.0",
166
+ "PAN-OS 10.0",
167
+ "PAN-OS 9.1.4",
168
+ "PAN-OS 9.1.3-h1",
169
+ "PAN-OS 9.1.3",
170
+ "PAN-OS 9.1.2-h1",
171
+ "PAN-OS 9.1.2",
172
+ "PAN-OS 9.1.1",
173
+ "PAN-OS 9.1.0-h3",
174
+ "PAN-OS 9.1.0-h2",
175
+ "PAN-OS 9.1.0-h1",
176
+ "PAN-OS 9.1.0",
177
+ "PAN-OS 9.1",
178
+ "PAN-OS 9.0.10",
179
+ "PAN-OS 9.0.9-h1",
180
+ "PAN-OS 9.0.9",
181
+ "PAN-OS 9.0.8",
182
+ "PAN-OS 9.0.7",
183
+ "PAN-OS 9.0.6",
184
+ "PAN-OS 9.0.5",
185
+ "PAN-OS 9.0.4",
186
+ "PAN-OS 9.0.3-h3",
187
+ "PAN-OS 9.0.3-h2",
188
+ "PAN-OS 9.0.3-h1",
189
+ "PAN-OS 9.0.3",
190
+ "PAN-OS 9.0.2-h4",
191
+ "PAN-OS 9.0.2-h3",
192
+ "PAN-OS 9.0.2-h2",
193
+ "PAN-OS 9.0.2-h1",
194
+ "PAN-OS 9.0.2",
195
+ "PAN-OS 9.0.1",
196
+ "PAN-OS 9.0.0",
197
+ "PAN-OS 9.0",
198
+ "PAN-OS 8.1.16",
199
+ "PAN-OS 8.1.15-h3",
200
+ "PAN-OS 8.1.15-h2",
201
+ "PAN-OS 8.1.15-h1",
202
+ "PAN-OS 8.1.15",
203
+ "PAN-OS 8.1.14-h2",
204
+ "PAN-OS 8.1.14-h1",
205
+ "PAN-OS 8.1.14",
206
+ "PAN-OS 8.1.13",
207
+ "PAN-OS 8.1.12",
208
+ "PAN-OS 8.1.11",
209
+ "PAN-OS 8.1.10",
210
+ "PAN-OS 8.1.9-h4",
211
+ "PAN-OS 8.1.9-h3",
212
+ "PAN-OS 8.1.9-h2",
213
+ "PAN-OS 8.1.9-h1",
214
+ "PAN-OS 8.1.9",
215
+ "PAN-OS 8.1.8-h5",
216
+ "PAN-OS 8.1.8-h4",
217
+ "PAN-OS 8.1.8-h3",
218
+ "PAN-OS 8.1.8-h2",
219
+ "PAN-OS 8.1.8-h1",
220
+ "PAN-OS 8.1.8",
221
+ "PAN-OS 8.1.7",
222
+ "PAN-OS 8.1.6-h2",
223
+ "PAN-OS 8.1.6-h1",
224
+ "PAN-OS 8.1.6",
225
+ "PAN-OS 8.1.5",
226
+ "PAN-OS 8.1.4",
227
+ "PAN-OS 8.1.3",
228
+ "PAN-OS 8.1.2",
229
+ "PAN-OS 8.1.1",
230
+ "PAN-OS 8.1.0",
231
+ "PAN-OS 8.1"
232
+ ]
233
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "references": {
3
+ "reference_data": [
4
+ {
5
+ "url": "https://www.ibm.com/support/pages/node/6367979",
6
+ "title": "IBM Security Bulletin 6367979 (Sterling B2B Integrator)",
7
+ "refsource": "CONFIRM",
8
+ "name": "https://www.ibm.com/support/pages/node/6367979"
9
+ },
10
+ {
11
+ "name": "ibm-sterling-cve20204700-priv-escalation (187077)",
12
+ "refsource": "XF",
13
+ "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/187077",
14
+ "title": "X-Force Vulnerability Report"
15
+ }
16
+ ]
17
+ },
18
+ "affects": {
19
+ "vendor": {
20
+ "vendor_data": [
21
+ {
22
+ "vendor_name": "IBM",
23
+ "product": {
24
+ "product_data": [
25
+ {
26
+ "version": {
27
+ "version_data": [
28
+ {
29
+ "version_value": "6.0.0.0"
30
+ },
31
+ {
32
+ "version_value": "5.2.0.0"
33
+ },
34
+ {
35
+ "version_value": "5.2.6.5"
36
+ },
37
+ {
38
+ "version_value": "6.0.3.2"
39
+ }
40
+ ]
41
+ },
42
+ "product_name": "Sterling B2B Integrator"
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ ]
48
+ }
49
+ },
50
+ "CVE_data_meta": {
51
+ "STATE": "PUBLIC",
52
+ "DATE_PUBLIC": "2020-11-13T00:00:00",
53
+ "ASSIGNER": "psirt@us.ibm.com",
54
+ "ID": "CVE-2020-4700"
55
+ },
56
+ "problemtype": {
57
+ "problemtype_data": [
58
+ {
59
+ "description": [
60
+ {
61
+ "value": "Gain Privileges",
62
+ "lang": "eng"
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ },
68
+ "data_format": "MITRE",
69
+ "description": {
70
+ "description_data": [
71
+ {
72
+ "lang": "eng",
73
+ "value": "IBM Sterling B2B Integrator Standard Edition 6.0.0.0 through 6.0.3.2 and 5.2.0.0 through 5.2.6.5 could allow an authenticated user belonging to a specific user group to create a user or group with administrative privileges. IBM X-Force ID: 187077."
74
+ }
75
+ ]
76
+ },
77
+ "data_version": "4.0",
78
+ "data_type": "CVE",
79
+ "impact": {
80
+ "cvssv3": {
81
+ "TM": {
82
+ "RC": "C",
83
+ "E": "U",
84
+ "RL": "O"
85
+ },
86
+ "BM": {
87
+ "I": "H",
88
+ "PR": "L",
89
+ "A": "H",
90
+ "C": "H",
91
+ "SCORE": "7.500",
92
+ "AV": "N",
93
+ "AC": "H",
94
+ "UI": "N",
95
+ "S": "U"
96
+ }
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,56 @@
1
+ require 'spec_helper'
2
+ require 'cve_schema/cve/has_lang_value'
3
+
4
+ describe CVESchema::CVE::HasLangValue do
5
+ let(:klass) do
6
+ Class.new.tap do |klass|
7
+ klass.send :include, described_class
8
+ end
9
+ end
10
+
11
+ let(:lang) { :eng }
12
+ let(:value) { 'foo bar' }
13
+
14
+ describe "#initialize" do
15
+ subject { klass }
16
+
17
+ describe "required keywords" do
18
+ it "must require the lang: keyword" do
19
+ expect {
20
+ subject.new(value: value)
21
+ }.to raise_error(ArgumentError)
22
+ end
23
+
24
+ it "must require the value: keyword" do
25
+ expect {
26
+ subject.new(lang: lang)
27
+ }.to raise_error(ArgumentError)
28
+ end
29
+ end
30
+ end
31
+
32
+ describe ".load" do
33
+ subject { klass }
34
+
35
+ let(:json) do
36
+ {
37
+ 'lang' => lang.to_s,
38
+ 'value' => value
39
+ }
40
+ end
41
+
42
+ subject { klass.load(json) }
43
+
44
+ it "must return an instance of the including Class" do
45
+ expect(subject).to be_kind_of(klass)
46
+ end
47
+
48
+ it "must set #lang" do
49
+ expect(subject.lang).to eq(lang)
50
+ end
51
+
52
+ it "must set #value" do
53
+ expect(subject.value).to eq(value)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,91 @@
1
+ require 'spec_helper'
2
+ require 'cve_schema/cve/id'
3
+
4
+ describe CVESchema::CVE::ID do
5
+ let(:year) { '2021' }
6
+ let(:number) { '9999' }
7
+
8
+ describe "#initialize" do
9
+ subject { described_class.new(year,number) }
10
+
11
+ it "must set #year" do
12
+ expect(subject.year).to eq(year)
13
+ end
14
+
15
+ it "must set #number" do
16
+ expect(subject.number).to eq(number)
17
+ end
18
+ end
19
+
20
+ describe ".parse" do
21
+ subject { described_class }
22
+
23
+ context "when given a valid CVE" do
24
+ let(:id) { "CVE-#{year}-#{number}" }
25
+
26
+ subject { super().parse(id) }
27
+
28
+ it "muset extract the year component" do
29
+ expect(subject.year).to eq(year)
30
+ end
31
+
32
+ it "must extract the number component" do
33
+ expect(subject.number).to eq(number)
34
+ end
35
+ end
36
+
37
+ context "when given an invalid CVE" do
38
+ let(:id) { 'XYZ-123-abc' }
39
+
40
+ it do
41
+ expect { subject.parse(id) }.to raise_error(ArgumentError)
42
+ end
43
+ end
44
+ end
45
+
46
+ subject { described_class.new(year,number) }
47
+
48
+ describe "#==" do
49
+ context "when given a non-ID object" do
50
+ let(:other) { Object.new }
51
+
52
+ it { expect(subject == other).to be(false) }
53
+ end
54
+
55
+ context "when given another ID object" do
56
+ context "and the other ID has the same year" do
57
+ context "but a different number" do
58
+ let(:other) { described_class.new(year,'0000') }
59
+
60
+ it { expect(subject == other).to be(false) }
61
+ end
62
+
63
+ context "and the same number" do
64
+ let(:other) { described_class.new(year,number) }
65
+
66
+ it { expect(subject == other).to be(true) }
67
+ end
68
+ end
69
+
70
+ context "and the other ID has a different year" do
71
+ context "but a different number" do
72
+ let(:other) { described_class.new('3000','0000') }
73
+
74
+ it { expect(subject == other).to be(false) }
75
+ end
76
+
77
+ context "and the same number" do
78
+ let(:other) { described_class.new('3000',number) }
79
+
80
+ it { expect(subject == other).to be(false) }
81
+ end
82
+ end
83
+ end
84
+ end
85
+
86
+ describe "#to_s" do
87
+ it "must convert the ID back into a valid CVE string" do
88
+ expect(subject.to_s).to eq("CVE-#{year}-#{number}")
89
+ end
90
+ end
91
+ end