Merge ~eslerm/ubuntu-cve-tracker:cve-json5-verify into ubuntu-cve-tracker:master

Proposed by Mark Esler
Status: Merged
Merged at revision: 0c4de51433b7873bbb72362e4cb4a71adf4e4cf2
Proposed branch: ~eslerm/ubuntu-cve-tracker:cve-json5-verify
Merge into: ubuntu-cve-tracker:master
Diff against target: 2233 lines (+2221/-0)
2 files modified
scripts/cve-json5-schema.json (+2035/-0)
scripts/cve_json5_verify.py (+186/-0)
Reviewer Review Type Date Requested Status
Seth Arnold Approve
Review via email: mp+447823@code.launchpad.net

Commit message

init cve_json5_verify.py

Description of the change

Tooling which verifies cve-json5 files and can optionally check if necessary information is available for CNA publication.

To post a comment you must log in.
Revision history for this message
Seth Arnold (seth-arnold) wrote :

I've got some smaller comments that I hope will help make this easier to test and faster to run.

Thanks

Revision history for this message
Mark Esler (eslerm) wrote :

Thanks for your comments, I'll work on these changes and carry the concepts over to related work :)

I left a comment about scope.

Revision history for this message
Mark Esler (eslerm) wrote :

Seth, I addressed most of your suggestions, except the one that is redefined-outer-name related (I added comments).

Does squash and merge look okay?

Revision history for this message
Seth Arnold (seth-arnold) wrote :

[replies to comments only, no new review yet, sorry]

Revision history for this message
Seth Arnold (seth-arnold) wrote :

I'm sorry to say that I'm not exactly clear on the difference between cve-json5 files and cve-json5-api files -- I had hoped that I would understand by the end of the review, but it's still foggy. :)

Anyway, another few small notes on things.

Thanks

Revision history for this message
Mark Esler (eslerm) wrote :

Thank you Seth! Fixes to follow :)

I believe the trace code is good, but poorly documented.

cve-json5-api is just a subset of cve-json5. CNA's only deal with a portion of cve-json5 in CVE publication. This subset format is required (but not officially documented) by the CVE Program's API. It looks like: https://vulnogram.github.io/#source

Revision history for this message
Mark Esler (eslerm) wrote :

Seth, I updated the script based on your review.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Looks like nice changes; let's stop iterating and push it live, and see how it goes!

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/scripts/cve-json5-schema.json b/scripts/cve-json5-schema.json
0new file mode 1006440new file mode 100644
index 0000000..4cf417a
--- /dev/null
+++ b/scripts/cve-json5-schema.json
@@ -0,0 +1,2035 @@
1{
2 "$schema": "http://json-schema.org/draft-07/schema#",
3 "$id": "https://cve.org/cve/record/v5_00/",
4 "type": "object",
5 "title": "CVE JSON record format",
6 "description": "cve-schema specifies the CVE JSON record format. This is the blueprint for a rich set of JSON data that can be submitted by CVE Numbering Authorities (CNAs) and Authorized Data Publishers (ADPs) to describe a CVE Record. Some examples of CVE Record data include CVE ID number, affected product(s), affected version(s), and public references. While those specific items are required when assigning a CVE, there are many other optional data in the schema that can be used to enrich CVE Records for community benefit. Learn more about the CVE program at [the official website](https://cve.mitre.org). This CVE JSON record format is defined using JSON Schema. Learn more about JSON Schema [here](https://json-schema.org/).",
7 "definitions": {
8 "uriType": {
9 "description": "A universal resource identifier (URI), according to [RFC 3986](https://tools.ietf.org/html/rfc3986).",
10 "type": "string",
11 "format": "uri",
12 "minLength": 1,
13 "maxLength": 2048
14 },
15 "uuidType": {
16 "description": "A version 4 (random) universally unique identifier (UUID) as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.3).",
17 "type": "string",
18 "pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$"
19 },
20 "reference": {
21 "type": "object",
22 "required": [
23 "url"
24 ],
25 "properties": {
26 "url": {
27 "description": "The uniform resource locator (URL), according to [RFC 3986](https://tools.ietf.org/html/rfc3986#section-1.1.3), that can be used to retrieve the referenced resource.",
28 "$ref": "#/definitions/uriType"
29 },
30 "name": {
31 "description": "User created name for the reference, often the title of the page.",
32 "type": "string",
33 "maxLength": 512,
34 "minLength": 1
35 },
36 "tags": {
37 "description": "An array of one or more tags that describe the resource referenced by 'url'.",
38 "type": "array",
39 "minItems": 1,
40 "uniqueItems": true,
41 "items": {
42 "oneOf": [
43 {
44 "$ref": "#/definitions/tagExtension"
45 },
46 {
47 "$schema": "http://json-schema.org/draft-07/schema#",
48 "$id": "https://cve.mitre.org/cve/v5_00/tags/reference/",
49 "type": "string",
50 "description": "broken-link: The reference link is returning a 404 error, or the site is no longer online.\n\ncustomer-entitlement: Similar to Privileges Required, but specific to references that require non-public/paid access for customers of the particular vendor.\n\nexploit: Reference contains an in-depth/detailed description of steps to exploit a vulnerability OR the reference contains any legitimate Proof of Concept (PoC) code or exploit kit.\n\ngovernment-resource: All reference links that are from a government agency or organization should be given the Government Resource tag.\n\nissue-tracking: The reference is a post from a bug tracking tool such as MantisBT, Bugzilla, JIRA, Github Issues, etc...\n\nmailing-list: The reference is from a mailing list -- often specific to a product or vendor.\n\nmitigation: The reference contains information on steps to mitigate against the vulnerability in the event a patch can't be applied or is unavailable or for EOL product situations.\n\nnot-applicable: The reference link is not applicable to the vulnerability and was likely associated by MITRE accidentally (should be used sparingly).\n\npatch: The reference contains an update to the software that fixes the vulnerability.\n\npermissions-required: The reference link provided is blocked by a logon page. If credentials are required to see any information this tag must be applied.\n\nmedia-coverage: The reference is from a media outlet such as a newspaper, magazine, social media, or weblog. This tag is not intended to apply to any individual's personal social media account. It is strictly intended for public media entities.\n\nproduct: A reference appropriate for describing a product for the purpose of CPE or SWID.\n\nrelated: A reference that is for a related (but not the same) vulnerability.\n\nrelease-notes: The reference is in the format of a vendor or open source project's release notes or change log.\n\nsignature: The reference contains a method to detect or prevent the presence or exploitation of the vulnerability.\n\ntechnical-description: The reference contains in-depth technical information about a vulnerability and its exploitation process, typically in the form of a presentation or whitepaper.\n\nthird-party-advisory: Advisory is from an organization that is not the vulnerable product's vendor/publisher/maintainer.\n\nvendor-advisory: Advisory is from the vendor/publisher/maintainer of the product or the parent organization.\n\nvdb-entry: VDBs are loosely defined as sites that provide information about this vulnerability, such as advisories, with identifiers. Included VDBs are free to access, substantially public, and have broad scope and coverage (not limited to a single vendor or research organization). See: https://www.first.org/global/sigs/vrdx/vdb-catalog",
51 "enum": [
52 "broken-link",
53 "customer-entitlement",
54 "exploit",
55 "government-resource",
56 "issue-tracking",
57 "mailing-list",
58 "mitigation",
59 "not-applicable",
60 "patch",
61 "permissions-required",
62 "media-coverage",
63 "product",
64 "related",
65 "release-notes",
66 "signature",
67 "technical-description",
68 "third-party-advisory",
69 "vendor-advisory",
70 "vdb-entry"
71 ]
72 }
73 ]
74 }
75 }
76 }
77 },
78 "cveId": {
79 "type": "string",
80 "pattern": "^CVE-[0-9]{4}-[0-9]{4,19}$"
81 },
82 "orgId": {
83 "description": "A UUID for an organization participating in the CVE program. This UUID can be used to lookup the organization record in the user registry service.",
84 "$ref": "#/definitions/uuidType"
85 },
86 "userId": {
87 "description": "A UUID for a user participating in the CVE program. This UUID can be used to lookup the user record in the user registry service.",
88 "$ref": "#/definitions/uuidType"
89 },
90 "shortName": {
91 "description": "A 2-32 character name that can be used to complement an organization's UUID.",
92 "type": "string",
93 "minLength": 2,
94 "maxLength": 32
95 },
96 "datestamp": {
97 "description": "Date/time format based on RFC3339 and ISO ISO8601.",
98 "type": "string",
99 "format": "date",
100 "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))$"
101 },
102 "timestamp": {
103 "type": "string",
104 "format": "date-time",
105 "description": "Date/time format based on RFC3339 and ISO ISO8601, with an optional timezone in the format 'yyyy-MM-ddTHH:mm:ssZZZZ'. If timezone offset is not given, GMT (0000) is assumed.",
106 "pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})?$"
107 },
108 "version": {
109 "description": "A single version of a product, as expressed in its own version numbering scheme.",
110 "type": "string",
111 "minLength": 1,
112 "maxLength": 1024
113 },
114 "status": {
115 "description": "The vulnerability status of a given version or range of versions of a product. The statuses 'affected' and 'unaffected' indicate that the version is affected or unaffected by the vulnerability. The status 'unknown' indicates that it is unknown or unspecified whether the given version is affected. There can be many reasons for an 'unknown' status, including that an investigation has not been undertaken or that a vendor has not disclosed the status.",
116 "type": "string",
117 "enum": [
118 "affected",
119 "unaffected",
120 "unknown"
121 ]
122 },
123 "product": {
124 "type": "object",
125 "description": "Provides information about the set of products and services affected by this vulnerability.",
126 "allOf": [
127 {
128 "anyOf": [
129 {
130 "required": [
131 "vendor",
132 "product"
133 ]
134 },
135 {
136 "required": [
137 "collectionURL",
138 "packageName"
139 ]
140 }
141 ]
142 },
143 {
144 "anyOf": [
145 {
146 "required": [
147 "versions"
148 ]
149 },
150 {
151 "required": [
152 "defaultStatus"
153 ]
154 }
155 ]
156 }
157 ],
158 "properties": {
159 "vendor": {
160 "type": "string",
161 "description": "Name of the organization, project, community, individual, or user that created or maintains this product or hosted service. Can be 'N/A' if none of those apply. When collectionURL and packageName are used, this field may optionally represent the user or account within the package collection associated with the package.",
162 "minLength": 1,
163 "maxLength": 512
164 },
165 "product": {
166 "type": "string",
167 "description": "Name of the affected product.",
168 "minLength": 1,
169 "maxLength": 2048
170 },
171 "collectionURL": {
172 "description": "URL identifying a package collection (determines the meaning of packageName).",
173 "$ref": "#/definitions/uriType",
174 "examples": [
175 "https://access.redhat.com/downloads/content/package-browser",
176 "https://addons.mozilla.org",
177 "https://addons.thunderbird.net",
178 "https://anaconda.org/anaconda/repo",
179 "https://app.vagrantup.com/boxes/search",
180 "https://apps.apple.com",
181 "https://archlinux.org/packages",
182 "https://atmospherejs.meteor.com",
183 "https://atom.io/packages",
184 "https://bitbucket.org",
185 "https://bower.io",
186 "https://brew.sh/",
187 "https://chocolatey.org/packages",
188 "https://chrome.google.com/webstore",
189 "https://clojars.org",
190 "https://cocoapods.org",
191 "https://code.dlang.org",
192 "https://conan.io/center",
193 "https://cpan.org/modules",
194 "https://cran.r-project.org",
195 "https://crates.io",
196 "https://ctan.org/pkg",
197 "https://drupal.org",
198 "https://exchange.adobe.com",
199 "https://forge.puppet.com/modules",
200 "https://github.com",
201 "https://gitlab.com/explore",
202 "https://golang.org/pkg",
203 "https://guix.gnu.org/packages",
204 "https://hackage.haskell.org",
205 "https://helm.sh",
206 "https://hub.docker.com",
207 "https://juliahub.com",
208 "https://lib.haxe.org",
209 "https://luarocks.org",
210 "https://marketplace.visualstudio.com",
211 "https://melpa.org",
212 "https://microsoft.com/en-us/store/apps",
213 "https://nimble.directory",
214 "https://nuget.org/packages",
215 "https://opam.ocaml.org/packages",
216 "https://openwrt.org/packages/index",
217 "https://package.elm-lang.org",
218 "https://packagecontrol.io",
219 "https://packages.debian.org",
220 "https://packages.gentoo.org",
221 "https://packagist.org",
222 "https://pear.php.net/packages.php",
223 "https://pecl.php.net",
224 "https://platformio.org/lib",
225 "https://play.google.com/store",
226 "https://plugins.gradle.org",
227 "https://projects.eclipse.org",
228 "https://pub.dev",
229 "https://pypi.python.org",
230 "https://registry.npmjs.org",
231 "https://registry.terraform.io",
232 "https://repo.hex.pm",
233 "https://repo.maven.apache.org/maven2",
234 "https://rubygems.org",
235 "https://search.nixos.org/packages",
236 "https://sourceforge.net",
237 "https://wordpress.org/plugins"
238 ]
239 },
240 "packageName": {
241 "type": "string",
242 "description": "Name or identifier of the affected software package as used in the package collection.",
243 "minLength": 1,
244 "maxLength": 2048
245 },
246 "cpes": {
247 "type": "array",
248 "description": "Affected products defined by CPE. This is an array of CPE values (vulnerable and not), we use an array so that we can make multiple statements about the same version and they are separate (if we used a JSON object we'd essentially be keying on the CPE name and they would have to overlap). Also, this allows things like cveDataVersion or cveDescription to be applied directly to the product entry. This also allows more complex statements such as \"Product X between versions 10.2 and 10.8\" to be put in a machine-readable format. As well since multiple statements can be used multiple branches of the same product can be defined here.",
249 "uniqueItems": true,
250 "items": {
251 "title": "CPE Name",
252 "type": "string",
253 "description": "Common Platform Enumeration (CPE) Name in either 2.2 or 2.3 format",
254 "pattern": "([c][pP][eE]:/[AHOaho]?(:[A-Za-z0-9._\\-~%]*){0,6})|(cpe:2\\.3:[aho*\\-](:(((\\?*|\\*?)([a-zA-Z0-9\\-._]|(\\\\[\\\\*?!\"#$%&'()+,/:;<=>@\\[\\]\\^`{|}~]))+(\\?*|\\*?))|[*\\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[*\\-]))(:(((\\?*|\\*?)([a-zA-Z0-9\\-._]|(\\\\[\\\\*?!\"#$%&'()+,/:;<=>@\\[\\]\\^`{|}~]))+(\\?*|\\*?))|[*\\-])){4})",
255 "minLength": 1,
256 "maxLength": 2048
257 }
258 },
259 "modules": {
260 "type": "array",
261 "description": "A list of the affected components, features, modules, sub-components, sub-products, APIs, commands, utilities, programs, or functionalities (optional).",
262 "uniqueItems": true,
263 "items": {
264 "type": "string",
265 "description": "Name of the affected component, feature, module, sub-component, sub-product, API, command, utility, program, or functionality (optional).",
266 "minLength": 1,
267 "maxLength": 4096
268 }
269 },
270 "programFiles": {
271 "type": "array",
272 "description": "A list of the affected source code files (optional).",
273 "uniqueItems": true,
274 "items": {
275 "description": "Name or path or location of the affected source code file.",
276 "type": "string",
277 "minLength": 1,
278 "maxLength": 1024
279 }
280 },
281 "programRoutines": {
282 "type": "array",
283 "description": "A list of the affected source code functions, methods, subroutines, or procedures (optional).",
284 "uniqueItems": true,
285 "items": {
286 "type": "object",
287 "description": "An object describing program routine.",
288 "required": [
289 "name"
290 ],
291 "properties": {
292 "name": {
293 "type": "string",
294 "description": "Name of the affected source code file, function, method, subroutine, or procedure.",
295 "minLength": 1,
296 "maxLength": 4096
297 }
298 }
299 }
300 },
301 "platforms": {
302 "title": "Platforms",
303 "description": "List of specific platforms if the vulnerability is only relevant in the context of these platforms (optional). Platforms may include execution environments, operating systems, virtualization technologies, hardware models, or computing architectures. The lack of this field or an empty array implies that the other fields are applicable to all relevant platforms.",
304 "type": "array",
305 "minItems": 1,
306 "uniqueItems": true,
307 "items": {
308 "type": "string",
309 "examples": [
310 "iOS",
311 "Android",
312 "Windows",
313 "macOS",
314 "x86",
315 "ARM",
316 "64 bit",
317 "Big Endian",
318 "iPad",
319 "Chromebook",
320 "Docker",
321 "Model T"
322 ],
323 "maxLength": 1024
324 }
325 },
326 "repo": {
327 "description": "The URL of the source code repository, for informational purposes and/or to resolve git hash version ranges.",
328 "$ref": "#/definitions/uriType"
329 },
330 "defaultStatus": {
331 "description": "The default status for versions that are not otherwise listed in the versions list. If not specified, defaultStatus defaults to 'unknown'. Versions or defaultStatus may be omitted, but not both.",
332 "$ref": "#/definitions/status"
333 },
334 "versions": {
335 "type": "array",
336 "description": "Set of product versions or version ranges related to the vulnerability. The versions satisfy the CNA Rules [8.1.2 requirement](https://cve.mitre.org/cve/cna/rules.html#section_8-1_cve_entry_information_requirements). Versions or defaultStatus may be omitted, but not both.",
337 "minItems": 1,
338 "uniqueItems": true,
339 "items": {
340 "type": "object",
341 "description": "A single version or a range of versions, with vulnerability status.\n\nAn entry with only 'version' and 'status' indicates the status of a single version.\n\nOtherwise, an entry describes a range; it must include the 'versionType' property, to define the version numbering semantics in use, and 'limit', to indicate the non-inclusive upper limit of the range. The object describes the status for versions V such that 'version' <= V and V < 'limit', using the <= and < semantics defined for the specific kind of 'versionType'. Status changes within the range can be specified by an optional 'changes' list.\n\nThe algorithm to decide the status specified for a version V is:\n\n\tfor entry in product.versions {\n\t\tif entry.lessThan is not present and entry.lessThanOrEqual is not present and v == entry.version {\n\t\t\treturn entry.status\n\t\t}\n\t\tif (entry.lessThan is present and entry.version <= v and v < entry.lessThan) or\n\t\t (entry.lessThanOrEqual is present and entry.version <= v and v <= entry.lessThanOrEqual) { // <= and < defined by entry.versionType\n\t\t\tstatus = entry.status\n\t\t\tfor change in entry.changes {\n\t\t\t\tif change.at <= v {\n\t\t\t\t\tstatus = change.status\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn status\n\t\t}\n\t}\n\treturn product.defaultStatus\n\n.",
342 "oneOf": [
343 {
344 "required": [
345 "version",
346 "status"
347 ],
348 "maxProperties": 2
349 },
350 {
351 "required": [
352 "version",
353 "status",
354 "versionType"
355 ],
356 "oneOf": [
357 {
358 "required": [
359 "lessThan"
360 ]
361 },
362 {
363 "required": [
364 "lessThanOrEqual"
365 ]
366 }
367 ]
368 }
369 ],
370 "properties": {
371 "version": {
372 "description": "The single version being described, or the version at the start of the range. By convention, typically 0 denotes the earliest possible version.",
373 "$ref": "#/definitions/version"
374 },
375 "status": {
376 "description": "The vulnerability status for the version or range of versions. For a range, the status may be refined by the 'changes' list.",
377 "$ref": "#/definitions/status"
378 },
379 "versionType": {
380 "type": "string",
381 "description": "The version numbering system used for specifying the range. This defines the exact semantics of the comparison (less-than) operation on versions, which is required to understand the range itself. 'Custom' indicates that the version type is unspecified and should be avoided whenever possible. It is included primarily for use in conversion of older data files.",
382 "minLength": 1,
383 "maxLength": 128,
384 "examples": [
385 "custom",
386 "git",
387 "maven",
388 "python",
389 "rpm",
390 "semver"
391 ]
392 },
393 "lessThan": {
394 "description": "The non-inclusive upper limit of the range. This is the least version NOT in the range. The usual version syntax is expanded to allow a pattern to end in an asterisk `(*)`, indicating an arbitrarily large number in the version ordering. For example, `{version: 1.0 lessThan: 1.*}` would describe the entire 1.X branch for most range kinds, and `{version: 2.0, lessThan: *}` describes all versions starting at 2.0, including 3.0, 5.1, and so on. Only one of lessThan and lessThanOrEqual should be specified.",
395 "$ref": "#/definitions/version"
396 },
397 "lessThanOrEqual": {
398 "description": "The inclusive upper limit of the range. This is the greatest version contained in the range. Only one of lessThan and lessThanOrEqual should be specified. For example, `{version: 1.0, lessThanOrEqual: 1.3}` covers all versions from 1.0 up to and including 1.3.",
399 "$ref": "#/definitions/version"
400 },
401 "changes": {
402 "type": "array",
403 "description": "A list of status changes that take place during the range. The array should be sorted in increasing order by the 'at' field, according to the versionType, but clients must re-sort the list themselves rather than assume it is sorted.",
404 "minItems": 1,
405 "uniqueItems": true,
406 "items": {
407 "type": "object",
408 "description": "The start of a single status change during the range.",
409 "required": [
410 "at",
411 "status"
412 ],
413 "properties": {
414 "at": {
415 "description": "The version at which a status change occurs.",
416 "$ref": "#/definitions/version"
417 },
418 "status": {
419 "description": "The new status in the range starting at the given version.",
420 "$ref": "#/definitions/status"
421 }
422 }
423 }
424 }
425 }
426 }
427 }
428 }
429 },
430 "dataType": {
431 "description": "Indicates the type of information represented in the JSON instance.",
432 "type": "string",
433 "enum": [
434 "CVE_RECORD"
435 ]
436 },
437 "dataVersion": {
438 "description": "The version of the schema being used. Used to support multiple versions of this format.",
439 "type": "string",
440 "enum": [
441 "5.0"
442 ]
443 },
444 "cveMetadataPublished": {
445 "description": "This is meta data about the CVE ID such as the CVE ID, who requested it, who assigned it, when it was requested, the current state (PUBLISHED, REJECTED, etc.) and so on. These fields are controlled by the CVE Services.",
446 "type": "object",
447 "required": [
448 "cveId",
449 "assignerOrgId",
450 "state"
451 ],
452 "properties": {
453 "cveId": {
454 "description": "The CVE identifier that this record pertains to.",
455 "$ref": "#/definitions/cveId"
456 },
457 "assignerOrgId": {
458 "$ref": "#/definitions/orgId",
459 "description": "The UUID for the organization to which the CVE ID was originally assigned. This UUID can be used to lookup the organization record in the user registry service."
460 },
461 "assignerShortName": {
462 "$ref": "#/definitions/shortName",
463 "description": "The short name for the organization to which the CVE ID was originally assigned."
464 },
465 "requesterUserId": {
466 "$ref": "#/definitions/userId",
467 "description": "The user that requested the CVE identifier."
468 },
469 "dateUpdated": {
470 "description": "The date/time the record was last updated.",
471 "$ref": "#/definitions/timestamp"
472 },
473 "serial": {
474 "type": "integer",
475 "minimum": 1,
476 "description": "The system of record causes this to start at 1, and increment by 1 each time a submission from a data provider changes this CVE Record. The incremented value moves to the Rejected schema upon a PUBLISHED->REJECTED transition, and moves to the Published schema upon a REJECTED->PUBLISHED transition."
477 },
478 "dateReserved": {
479 "$ref": "#/definitions/timestamp",
480 "description": "The date/time this CVE ID was reserved in the CVE automation workgroup services system. Disclaimer: This date reflects when the CVE ID was reserved, and does not necessarily indicate when this vulnerability was discovered, shared with the affected vendor, publicly disclosed, or updated in CVE."
481 },
482 "datePublished": {
483 "$ref": "#/definitions/timestamp",
484 "description": "The date/time the CVE Record was first published in the CVE List."
485 },
486 "state": {
487 "description": "State of CVE - PUBLISHED, REJECTED.",
488 "type": "string",
489 "enum": [
490 "PUBLISHED"
491 ]
492 }
493 },
494 "additionalProperties": false
495 },
496 "cveMetadataRejected": {
497 "type": "object",
498 "description": "This is meta data about the CVE ID such as the CVE ID, who requested it, who assigned it, when it was requested, the current state (PUBLISHED, REJECTED, etc.) and so on. These fields are controlled by the CVE Services.",
499 "required": [
500 "cveId",
501 "assignerOrgId",
502 "state"
503 ],
504 "properties": {
505 "cveId": {
506 "description": "The CVE identifier that this record pertains to.",
507 "$ref": "#/definitions/cveId"
508 },
509 "assignerOrgId": {
510 "$ref": "#/definitions/orgId",
511 "description": "The UUID for the organization to which the CVE ID was originally assigned."
512 },
513 "assignerShortName": {
514 "$ref": "#/definitions/shortName",
515 "description": "The short name for the organization to which the CVE ID was originally assigned."
516 },
517 "serial": {
518 "type": "integer",
519 "minimum": 1,
520 "description": "The system of record causes this to start at 1, and increment by 1 each time a submission from a data provider changes this CVE Record. The incremented value moves to the Rejected schema upon a PUBLISHED->REJECTED transition, and moves to the Published schema upon a REJECTED->PUBLISHED transition."
521 },
522 "dateUpdated": {
523 "description": "The date/time the record was last updated.",
524 "$ref": "#/definitions/timestamp"
525 },
526 "datePublished": {
527 "$ref": "#/definitions/timestamp",
528 "description": "The date/time the CVE Record was first published in the CVE List."
529 },
530 "dateRejected": {
531 "$ref": "#/definitions/timestamp",
532 "description": "The date/time the CVE ID was rejected."
533 },
534 "state": {
535 "type": "string",
536 "description": "State of CVE - PUBLISHED, REJECTED.",
537 "enum": [
538 "REJECTED"
539 ]
540 },
541 "dateReserved": {
542 "$ref": "#/definitions/timestamp",
543 "description": "The date/time this CVE ID was reserved in the CVE automation workgroup services system. Disclaimer: This date reflects when the CVE ID was reserved, and does not necessarily indicate when this vulnerability was discovered, shared with the affected vendor, publicly disclosed, or updated in CVE."
544 }
545 },
546 "additionalProperties": false
547 },
548 "providerMetadata": {
549 "type": "object",
550 "description": "Details related to the information container provider (CNA or ADP).",
551 "properties": {
552 "orgId": {
553 "$ref": "#/definitions/orgId",
554 "description": "The container provider's organizational UUID."
555 },
556 "shortName": {
557 "$ref": "#/definitions/shortName",
558 "description": "The container provider's organizational short name."
559 },
560 "dateUpdated": {
561 "$ref": "#/definitions/timestamp",
562 "description": "Timestamp to be set by the system of record at time of submission. If dateUpdated is provided to the system of record it will be replaced by the current timestamp at the time of submission."
563 }
564 },
565 "required": [
566 "orgId"
567 ]
568 },
569 "cnaPublishedContainer": {
570 "description": "An object containing the vulnerability information provided by a CVE Numbering Authority (CNA) for a published CVE ID. There can only be one CNA container per CVE record since there can only be one assigning CNA. The CNA container must include the required information defined in the CVE Rules, which includes a product, version, problem type, prose description, and a reference.",
571 "type": "object",
572 "properties": {
573 "providerMetadata": {
574 "$ref": "#/definitions/providerMetadata"
575 },
576 "dateAssigned": {
577 "$ref": "#/definitions/timestamp",
578 "description": "The date/time this CVE ID was associated with a vulnerability by a CNA."
579 },
580 "datePublic": {
581 "$ref": "#/definitions/timestamp",
582 "description": "If known, the date/time the vulnerability was disclosed publicly."
583 },
584 "title": {
585 "type": "string",
586 "description": "A title, headline, or a brief phrase summarizing the CVE record. Eg., Buffer overflow in Example Soft.",
587 "minLength": 1,
588 "maxLength": 256
589 },
590 "descriptions": {
591 "$ref": "#/definitions/descriptions"
592 },
593 "affected": {
594 "$ref": "#/definitions/affected"
595 },
596 "problemTypes": {
597 "$ref": "#/definitions/problemTypes"
598 },
599 "references": {
600 "$ref": "#/definitions/references"
601 },
602 "impacts": {
603 "$ref": "#/definitions/impacts"
604 },
605 "metrics": {
606 "$ref": "#/definitions/metrics"
607 },
608 "configurations": {
609 "$ref": "#/definitions/configurations"
610 },
611 "workarounds": {
612 "$ref": "#/definitions/workarounds"
613 },
614 "solutions": {
615 "$ref": "#/definitions/solutions"
616 },
617 "exploits": {
618 "$ref": "#/definitions/exploits"
619 },
620 "timeline": {
621 "$ref": "#/definitions/timeline"
622 },
623 "credits": {
624 "$ref": "#/definitions/credits"
625 },
626 "source": {
627 "$ref": "#/definitions/source"
628 },
629 "tags": {
630 "$ref": "#/definitions/cnaTags"
631 },
632 "taxonomyMappings": {
633 "$ref": "#/definitions/taxonomyMappings"
634 }
635 },
636 "required": [
637 "providerMetadata",
638 "descriptions",
639 "affected",
640 "references"
641 ],
642 "patternProperties": {
643 "^x_[^.]*$": {}
644 },
645 "additionalProperties": false
646 },
647 "cnaRejectedContainer": {
648 "description": "An object containing the vulnerability information provided by a CVE Numbering Authority (CNA) for a rejected CVE ID. There can only be one CNA container per CVE record since there can only be one assigning CNA.",
649 "type": "object",
650 "properties": {
651 "providerMetadata": {
652 "$ref": "#/definitions/providerMetadata"
653 },
654 "rejectedReasons": {
655 "description": "Reasons for rejecting this CVE Record.",
656 "$ref": "#/definitions/descriptions"
657 },
658 "replacedBy": {
659 "type": "array",
660 "description": "Contains an array of CVE IDs that this CVE ID was rejected in favor of because this CVE ID was assigned to the vulnerabilities.",
661 "minItems": 1,
662 "uniqueItems": true,
663 "items": {
664 "$ref": "#/definitions/cveId"
665 }
666 }
667 },
668 "required": [
669 "providerMetadata",
670 "rejectedReasons"
671 ],
672 "patternProperties": {
673 "^x_[^.]*$": {}
674 },
675 "additionalProperties": false
676 },
677 "adpContainer": {
678 "description": "An object containing the vulnerability information provided by an Authorized Data Publisher (ADP). Since multiple ADPs can provide information for a CVE ID, an ADP container must indicate which ADP is the source of the information in the object.",
679 "type": "object",
680 "properties": {
681 "providerMetadata": {
682 "$ref": "#/definitions/providerMetadata"
683 },
684 "datePublic": {
685 "$ref": "#/definitions/timestamp",
686 "description": "If known, the date/time the vulnerability was disclosed publicly."
687 },
688 "title": {
689 "type": "string",
690 "description": "A title, headline, or a brief phrase summarizing the information in an ADP container.",
691 "minLength": 1,
692 "maxLength": 256
693 },
694 "descriptions": {
695 "$ref": "#/definitions/descriptions"
696 },
697 "affected": {
698 "$ref": "#/definitions/affected"
699 },
700 "problemTypes": {
701 "$ref": "#/definitions/problemTypes"
702 },
703 "references": {
704 "$ref": "#/definitions/references"
705 },
706 "impacts": {
707 "$ref": "#/definitions/impacts"
708 },
709 "metrics": {
710 "$ref": "#/definitions/metrics"
711 },
712 "configurations": {
713 "$ref": "#/definitions/configurations"
714 },
715 "workarounds": {
716 "$ref": "#/definitions/workarounds"
717 },
718 "solutions": {
719 "$ref": "#/definitions/solutions"
720 },
721 "exploits": {
722 "$ref": "#/definitions/exploits"
723 },
724 "timeline": {
725 "$ref": "#/definitions/timeline"
726 },
727 "credits": {
728 "$ref": "#/definitions/credits"
729 },
730 "source": {
731 "$ref": "#/definitions/source"
732 },
733 "tags": {
734 "$ref": "#/definitions/adpTags"
735 },
736 "taxonomyMappings": {
737 "$ref": "#/definitions/taxonomyMappings"
738 }
739 },
740 "required": [
741 "providerMetadata"
742 ],
743 "minProperties": 2,
744 "patternProperties": {
745 "^x_[^.]*$": {}
746 },
747 "additionalProperties": false
748 },
749 "affected": {
750 "type": "array",
751 "description": "List of affected products.",
752 "minItems": 1,
753 "items": {
754 "$ref": "#/definitions/product"
755 }
756 },
757 "description": {
758 "type": "object",
759 "description": "Text in a particular language with optional alternate markup or formatted representation (e.g., Markdown) or embedded media.",
760 "properties": {
761 "lang": {
762 "$ref": "#/definitions/language"
763 },
764 "value": {
765 "type": "string",
766 "description": "Plain text description.",
767 "minLength": 1,
768 "maxLength": 4096
769 },
770 "supportingMedia": {
771 "type": "array",
772 "title": "Supporting media",
773 "description": "Supporting media data for the description such as markdown, diagrams, .. (optional). Similar to RFC 2397 each media object has three main parts: media type, media data value, and an optional boolean flag to indicate if the media data is base64 encoded.",
774 "uniqueItems": true,
775 "minItems": 1,
776 "items": {
777 "type": "object",
778 "properties": {
779 "type": {
780 "type": "string",
781 "title": "Media type",
782 "minLength": 1,
783 "maxLength": 256,
784 "description": "RFC2046 compliant IANA Media type for eg., text/markdown, text/html.",
785 "examples": [
786 "text/markdown",
787 "text/html",
788 "image/png",
789 "image/svg",
790 "audio/mp3"
791 ]
792 },
793 "base64": {
794 "type": "boolean",
795 "title": "Encoding",
796 "description": "If true then the value field contains the media data encoded in base64. If false then the value field contains the UTF-8 media content.",
797 "default": false
798 },
799 "value": {
800 "type": "string",
801 "description": "Supporting media content, up to 16K. If base64 is true, this field stores base64 encoded data.",
802 "minLength": 1,
803 "maxLength": 16384
804 }
805 },
806 "required": [
807 "type",
808 "value"
809 ]
810 }
811 }
812 },
813 "required": [
814 "lang",
815 "value"
816 ],
817 "additionalProperties": false
818 },
819 "englishLanguageDescription": {
820 "type": "object",
821 "description": "A description with lang set to an English language (en, en_US, en_UK, and so on).",
822 "properties": {
823 "lang": {
824 "$ref": "#/definitions/englishLanguage"
825 }
826 },
827 "required": [
828 "lang"
829 ]
830 },
831 "descriptions": {
832 "type": "array",
833 "description": "A list of multi-lingual descriptions of the vulnerability. E.g., [PROBLEMTYPE] in [COMPONENT] in [VENDOR] [PRODUCT] [VERSION] on [PLATFORMS] allows [ATTACKER] to [IMPACT] via [VECTOR]. OR [COMPONENT] in [VENDOR] [PRODUCT] [VERSION] [ROOT CAUSE], which allows [ATTACKER] to [IMPACT] via [VECTOR].",
834 "minItems": 1,
835 "uniqueItems": true,
836 "items": {
837 "$ref": "#/definitions/description"
838 },
839 "contains": {
840 "$ref": "#/definitions/englishLanguageDescription"
841 }
842 },
843 "problemTypes": {
844 "type": "array",
845 "description": "This is problem type information (e.g. CWE identifier). Must contain: At least one entry, can be text, OWASP, CWE, please note that while only one is required you can use more than one (or indeed all three) as long as they are correct). (CNA requirement: [PROBLEMTYPE]).",
846 "items": {
847 "type": "object",
848 "required": [
849 "descriptions"
850 ],
851 "properties": {
852 "descriptions": {
853 "type": "array",
854 "items": {
855 "type": "object",
856 "required": [
857 "lang",
858 "description"
859 ],
860 "properties": {
861 "lang": {
862 "$ref": "#/definitions/language"
863 },
864 "description": {
865 "type": "string",
866 "description": "Text description of problemType, or title from CWE or OWASP.",
867 "minLength": 1,
868 "maxLength": 4096
869 },
870 "cweId": {
871 "type": "string",
872 "description": "CWE ID of the CWE that best describes this problemType entry.",
873 "minLength": 5,
874 "maxLength": 9,
875 "pattern": "^CWE-[1-9][0-9]*$"
876 },
877 "type": {
878 "type": "string",
879 "description": "Problemtype source, text, OWASP, CWE, etc.,",
880 "minLength": 1,
881 "maxLength": 128
882 },
883 "references": {
884 "$ref": "#/definitions/references"
885 }
886 }
887 },
888 "minItems": 1,
889 "uniqueItems": true
890 }
891 }
892 },
893 "minItems": 1,
894 "uniqueItems": true
895 },
896 "references": {
897 "type": "array",
898 "description": "This is reference data in the form of URLs or file objects (uuencoded and embedded within the JSON file, exact format to be decided, e.g. we may require a compressed format so the objects require unpacking before they are \"dangerous\").",
899 "items": {
900 "$ref": "#/definitions/reference"
901 },
902 "minItems": 1,
903 "maxItems": 512,
904 "uniqueItems": true
905 },
906 "impacts": {
907 "type": "array",
908 "description": "Collection of impacts of this vulnerability.",
909 "minItems": 1,
910 "uniqueItems": true,
911 "items": {
912 "type": "object",
913 "description": "This is impact type information (e.g. a text description.",
914 "required": [
915 "descriptions"
916 ],
917 "properties": {
918 "capecId": {
919 "type": "string",
920 "description": "CAPEC ID that best relates to this impact.",
921 "minLength": 7,
922 "maxLength": 11,
923 "pattern": "^CAPEC-[1-9][0-9]{0,4}$"
924 },
925 "descriptions": {
926 "description": "Prose description of the impact scenario. At a minimum provide the description given by CAPEC.",
927 "$ref": "#/definitions/descriptions"
928 }
929 }
930 }
931 },
932 "metrics": {
933 "type": "array",
934 "description": "Collection of impact scores with attribution.",
935 "minItems": 1,
936 "uniqueItems": true,
937 "items": {
938 "type": "object",
939 "description": "This is impact type information (e.g. a text description, CVSSv2, CVSSv3, etc.). Must contain: At least one entry, can be text, CVSSv2, CVSSv3, others may be added.",
940 "anyOf": [
941 {
942 "required": [
943 "cvssV3_1"
944 ]
945 },
946 {
947 "required": [
948 "cvssV3_0"
949 ]
950 },
951 {
952 "required": [
953 "cvssV2_0"
954 ]
955 },
956 {
957 "required": [
958 "other"
959 ]
960 }
961 ],
962 "properties": {
963 "format": {
964 "type": "string",
965 "description": "Name of the scoring format. This provides a bit of future proofing. Additional properties are not prohibited, so this will support the inclusion of proprietary formats. It also provides an easy future conversion mechanism when future score formats become part of the schema. example: cvssV44, format = 'cvssV44', other = cvssV4_4 JSON object. In the future, the other properties can be converted to score properties when they become part of the schema.",
966 "minLength": 1,
967 "maxLength": 64
968 },
969 "scenarios": {
970 "type": "array",
971 "description": "Description of the scenarios this metrics object applies to. If no specific scenario is given, GENERAL is used as the default and applies when no more specific metric matches.",
972 "minItems": 1,
973 "uniqueItems": true,
974 "items": {
975 "type": "object",
976 "properties": {
977 "lang": {
978 "$ref": "#/definitions/language"
979 },
980 "value": {
981 "type": "string",
982 "default": "GENERAL",
983 "description": "Description of the scenario this metrics object applies to. If no specific scenario is given, GENERAL is used as the default and applies when no more specific metric matches.",
984 "minLength": 1,
985 "maxLength": 4096
986 }
987 },
988 "required": [
989 "lang",
990 "value"
991 ]
992 }
993 },
994 "cvssV3_1": {
995 "$schema": "http://json-schema.org/draft-07/schema#",
996 "title": "JSON Schema for Common Vulnerability Scoring System version 3.1",
997 "type": "object",
998 "definitions": {
999 "attackVectorType": {
1000 "type": "string",
1001 "enum": [
1002 "NETWORK",
1003 "ADJACENT_NETWORK",
1004 "LOCAL",
1005 "PHYSICAL"
1006 ]
1007 },
1008 "modifiedAttackVectorType": {
1009 "type": "string",
1010 "enum": [
1011 "NETWORK",
1012 "ADJACENT_NETWORK",
1013 "LOCAL",
1014 "PHYSICAL",
1015 "NOT_DEFINED"
1016 ]
1017 },
1018 "attackComplexityType": {
1019 "type": "string",
1020 "enum": [
1021 "HIGH",
1022 "LOW"
1023 ]
1024 },
1025 "modifiedAttackComplexityType": {
1026 "type": "string",
1027 "enum": [
1028 "HIGH",
1029 "LOW",
1030 "NOT_DEFINED"
1031 ]
1032 },
1033 "privilegesRequiredType": {
1034 "type": "string",
1035 "enum": [
1036 "HIGH",
1037 "LOW",
1038 "NONE"
1039 ]
1040 },
1041 "modifiedPrivilegesRequiredType": {
1042 "type": "string",
1043 "enum": [
1044 "HIGH",
1045 "LOW",
1046 "NONE",
1047 "NOT_DEFINED"
1048 ]
1049 },
1050 "userInteractionType": {
1051 "type": "string",
1052 "enum": [
1053 "NONE",
1054 "REQUIRED"
1055 ]
1056 },
1057 "modifiedUserInteractionType": {
1058 "type": "string",
1059 "enum": [
1060 "NONE",
1061 "REQUIRED",
1062 "NOT_DEFINED"
1063 ]
1064 },
1065 "scopeType": {
1066 "type": "string",
1067 "enum": [
1068 "UNCHANGED",
1069 "CHANGED"
1070 ]
1071 },
1072 "modifiedScopeType": {
1073 "type": "string",
1074 "enum": [
1075 "UNCHANGED",
1076 "CHANGED",
1077 "NOT_DEFINED"
1078 ]
1079 },
1080 "ciaType": {
1081 "type": "string",
1082 "enum": [
1083 "NONE",
1084 "LOW",
1085 "HIGH"
1086 ]
1087 },
1088 "modifiedCiaType": {
1089 "type": "string",
1090 "enum": [
1091 "NONE",
1092 "LOW",
1093 "HIGH",
1094 "NOT_DEFINED"
1095 ]
1096 },
1097 "exploitCodeMaturityType": {
1098 "type": "string",
1099 "enum": [
1100 "UNPROVEN",
1101 "PROOF_OF_CONCEPT",
1102 "FUNCTIONAL",
1103 "HIGH",
1104 "NOT_DEFINED"
1105 ]
1106 },
1107 "remediationLevelType": {
1108 "type": "string",
1109 "enum": [
1110 "OFFICIAL_FIX",
1111 "TEMPORARY_FIX",
1112 "WORKAROUND",
1113 "UNAVAILABLE",
1114 "NOT_DEFINED"
1115 ]
1116 },
1117 "confidenceType": {
1118 "type": "string",
1119 "enum": [
1120 "UNKNOWN",
1121 "REASONABLE",
1122 "CONFIRMED",
1123 "NOT_DEFINED"
1124 ]
1125 },
1126 "ciaRequirementType": {
1127 "type": "string",
1128 "enum": [
1129 "LOW",
1130 "MEDIUM",
1131 "HIGH",
1132 "NOT_DEFINED"
1133 ]
1134 },
1135 "scoreType": {
1136 "type": "number",
1137 "minimum": 0,
1138 "maximum": 10
1139 },
1140 "severityType": {
1141 "type": "string",
1142 "enum": [
1143 "NONE",
1144 "LOW",
1145 "MEDIUM",
1146 "HIGH",
1147 "CRITICAL"
1148 ]
1149 }
1150 },
1151 "properties": {
1152 "version": {
1153 "description": "CVSS Version",
1154 "type": "string",
1155 "enum": [
1156 "3.1"
1157 ]
1158 },
1159 "vectorString": {
1160 "type": "string",
1161 "pattern": "^CVSS:3[.]1/((AV:[NALP]|AC:[LH]|PR:[NLH]|UI:[NR]|S:[UC]|[CIA]:[NLH]|E:[XUPFH]|RL:[XOTWU]|RC:[XURC]|[CIA]R:[XLMH]|MAV:[XNALP]|MAC:[XLH]|MPR:[XNLH]|MUI:[XNR]|MS:[XUC]|M[CIA]:[XNLH])/)*(AV:[NALP]|AC:[LH]|PR:[NLH]|UI:[NR]|S:[UC]|[CIA]:[NLH]|E:[XUPFH]|RL:[XOTWU]|RC:[XURC]|[CIA]R:[XLMH]|MAV:[XNALP]|MAC:[XLH]|MPR:[XNLH]|MUI:[XNR]|MS:[XUC]|M[CIA]:[XNLH])$"
1162 },
1163 "attackVector": {
1164 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/attackVectorType"
1165 },
1166 "attackComplexity": {
1167 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/attackComplexityType"
1168 },
1169 "privilegesRequired": {
1170 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/privilegesRequiredType"
1171 },
1172 "userInteraction": {
1173 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/userInteractionType"
1174 },
1175 "scope": {
1176 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/scopeType"
1177 },
1178 "confidentialityImpact": {
1179 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaType"
1180 },
1181 "integrityImpact": {
1182 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaType"
1183 },
1184 "availabilityImpact": {
1185 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaType"
1186 },
1187 "baseScore": {
1188 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/scoreType"
1189 },
1190 "baseSeverity": {
1191 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/severityType"
1192 },
1193 "exploitCodeMaturity": {
1194 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/exploitCodeMaturityType"
1195 },
1196 "remediationLevel": {
1197 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/remediationLevelType"
1198 },
1199 "reportConfidence": {
1200 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/confidenceType"
1201 },
1202 "temporalScore": {
1203 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/scoreType"
1204 },
1205 "temporalSeverity": {
1206 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/severityType"
1207 },
1208 "confidentialityRequirement": {
1209 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaRequirementType"
1210 },
1211 "integrityRequirement": {
1212 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaRequirementType"
1213 },
1214 "availabilityRequirement": {
1215 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaRequirementType"
1216 },
1217 "modifiedAttackVector": {
1218 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedAttackVectorType"
1219 },
1220 "modifiedAttackComplexity": {
1221 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedAttackComplexityType"
1222 },
1223 "modifiedPrivilegesRequired": {
1224 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedPrivilegesRequiredType"
1225 },
1226 "modifiedUserInteraction": {
1227 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedUserInteractionType"
1228 },
1229 "modifiedScope": {
1230 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedScopeType"
1231 },
1232 "modifiedConfidentialityImpact": {
1233 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedCiaType"
1234 },
1235 "modifiedIntegrityImpact": {
1236 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedCiaType"
1237 },
1238 "modifiedAvailabilityImpact": {
1239 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedCiaType"
1240 },
1241 "environmentalScore": {
1242 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/scoreType"
1243 },
1244 "environmentalSeverity": {
1245 "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/severityType"
1246 }
1247 },
1248 "required": [
1249 "version",
1250 "vectorString",
1251 "baseScore",
1252 "baseSeverity"
1253 ]
1254 },
1255 "cvssV3_0": {
1256 "$schema": "http://json-schema.org/draft-04/schema#",
1257 "title": "JSON Schema for Common Vulnerability Scoring System version 3.0",
1258 "type": "object",
1259 "definitions": {
1260 "attackVectorType": {
1261 "type": "string",
1262 "enum": [
1263 "NETWORK",
1264 "ADJACENT_NETWORK",
1265 "LOCAL",
1266 "PHYSICAL"
1267 ]
1268 },
1269 "modifiedAttackVectorType": {
1270 "type": "string",
1271 "enum": [
1272 "NETWORK",
1273 "ADJACENT_NETWORK",
1274 "LOCAL",
1275 "PHYSICAL",
1276 "NOT_DEFINED"
1277 ]
1278 },
1279 "attackComplexityType": {
1280 "type": "string",
1281 "enum": [
1282 "HIGH",
1283 "LOW"
1284 ]
1285 },
1286 "modifiedAttackComplexityType": {
1287 "type": "string",
1288 "enum": [
1289 "HIGH",
1290 "LOW",
1291 "NOT_DEFINED"
1292 ]
1293 },
1294 "privilegesRequiredType": {
1295 "type": "string",
1296 "enum": [
1297 "HIGH",
1298 "LOW",
1299 "NONE"
1300 ]
1301 },
1302 "modifiedPrivilegesRequiredType": {
1303 "type": "string",
1304 "enum": [
1305 "HIGH",
1306 "LOW",
1307 "NONE",
1308 "NOT_DEFINED"
1309 ]
1310 },
1311 "userInteractionType": {
1312 "type": "string",
1313 "enum": [
1314 "NONE",
1315 "REQUIRED"
1316 ]
1317 },
1318 "modifiedUserInteractionType": {
1319 "type": "string",
1320 "enum": [
1321 "NONE",
1322 "REQUIRED",
1323 "NOT_DEFINED"
1324 ]
1325 },
1326 "scopeType": {
1327 "type": "string",
1328 "enum": [
1329 "UNCHANGED",
1330 "CHANGED"
1331 ]
1332 },
1333 "modifiedScopeType": {
1334 "type": "string",
1335 "enum": [
1336 "UNCHANGED",
1337 "CHANGED",
1338 "NOT_DEFINED"
1339 ]
1340 },
1341 "ciaType": {
1342 "type": "string",
1343 "enum": [
1344 "NONE",
1345 "LOW",
1346 "HIGH"
1347 ]
1348 },
1349 "modifiedCiaType": {
1350 "type": "string",
1351 "enum": [
1352 "NONE",
1353 "LOW",
1354 "HIGH",
1355 "NOT_DEFINED"
1356 ]
1357 },
1358 "exploitCodeMaturityType": {
1359 "type": "string",
1360 "enum": [
1361 "UNPROVEN",
1362 "PROOF_OF_CONCEPT",
1363 "FUNCTIONAL",
1364 "HIGH",
1365 "NOT_DEFINED"
1366 ]
1367 },
1368 "remediationLevelType": {
1369 "type": "string",
1370 "enum": [
1371 "OFFICIAL_FIX",
1372 "TEMPORARY_FIX",
1373 "WORKAROUND",
1374 "UNAVAILABLE",
1375 "NOT_DEFINED"
1376 ]
1377 },
1378 "confidenceType": {
1379 "type": "string",
1380 "enum": [
1381 "UNKNOWN",
1382 "REASONABLE",
1383 "CONFIRMED",
1384 "NOT_DEFINED"
1385 ]
1386 },
1387 "ciaRequirementType": {
1388 "type": "string",
1389 "enum": [
1390 "LOW",
1391 "MEDIUM",
1392 "HIGH",
1393 "NOT_DEFINED"
1394 ]
1395 },
1396 "scoreType": {
1397 "type": "number",
1398 "minimum": 0,
1399 "maximum": 10
1400 },
1401 "severityType": {
1402 "type": "string",
1403 "enum": [
1404 "NONE",
1405 "LOW",
1406 "MEDIUM",
1407 "HIGH",
1408 "CRITICAL"
1409 ]
1410 }
1411 },
1412 "properties": {
1413 "version": {
1414 "description": "CVSS Version",
1415 "type": "string",
1416 "enum": [
1417 "3.0"
1418 ]
1419 },
1420 "vectorString": {
1421 "type": "string",
1422 "pattern": "^CVSS:3[.]0/((AV:[NALP]|AC:[LH]|PR:[UNLH]|UI:[NR]|S:[UC]|[CIA]:[NLH]|E:[XUPFH]|RL:[XOTWU]|RC:[XURC]|[CIA]R:[XLMH]|MAV:[XNALP]|MAC:[XLH]|MPR:[XUNLH]|MUI:[XNR]|MS:[XUC]|M[CIA]:[XNLH])/)*(AV:[NALP]|AC:[LH]|PR:[UNLH]|UI:[NR]|S:[UC]|[CIA]:[NLH]|E:[XUPFH]|RL:[XOTWU]|RC:[XURC]|[CIA]R:[XLMH]|MAV:[XNALP]|MAC:[XLH]|MPR:[XUNLH]|MUI:[XNR]|MS:[XUC]|M[CIA]:[XNLH])$"
1423 },
1424 "attackVector": {
1425 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/attackVectorType"
1426 },
1427 "attackComplexity": {
1428 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/attackComplexityType"
1429 },
1430 "privilegesRequired": {
1431 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/privilegesRequiredType"
1432 },
1433 "userInteraction": {
1434 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/userInteractionType"
1435 },
1436 "scope": {
1437 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/scopeType"
1438 },
1439 "confidentialityImpact": {
1440 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaType"
1441 },
1442 "integrityImpact": {
1443 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaType"
1444 },
1445 "availabilityImpact": {
1446 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaType"
1447 },
1448 "baseScore": {
1449 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/scoreType"
1450 },
1451 "baseSeverity": {
1452 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/severityType"
1453 },
1454 "exploitCodeMaturity": {
1455 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/exploitCodeMaturityType"
1456 },
1457 "remediationLevel": {
1458 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/remediationLevelType"
1459 },
1460 "reportConfidence": {
1461 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/confidenceType"
1462 },
1463 "temporalScore": {
1464 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/scoreType"
1465 },
1466 "temporalSeverity": {
1467 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/severityType"
1468 },
1469 "confidentialityRequirement": {
1470 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaRequirementType"
1471 },
1472 "integrityRequirement": {
1473 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaRequirementType"
1474 },
1475 "availabilityRequirement": {
1476 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaRequirementType"
1477 },
1478 "modifiedAttackVector": {
1479 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedAttackVectorType"
1480 },
1481 "modifiedAttackComplexity": {
1482 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedAttackComplexityType"
1483 },
1484 "modifiedPrivilegesRequired": {
1485 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedPrivilegesRequiredType"
1486 },
1487 "modifiedUserInteraction": {
1488 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedUserInteractionType"
1489 },
1490 "modifiedScope": {
1491 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedScopeType"
1492 },
1493 "modifiedConfidentialityImpact": {
1494 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedCiaType"
1495 },
1496 "modifiedIntegrityImpact": {
1497 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedCiaType"
1498 },
1499 "modifiedAvailabilityImpact": {
1500 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedCiaType"
1501 },
1502 "environmentalScore": {
1503 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/scoreType"
1504 },
1505 "environmentalSeverity": {
1506 "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/severityType"
1507 }
1508 },
1509 "required": [
1510 "version",
1511 "vectorString",
1512 "baseScore",
1513 "baseSeverity"
1514 ]
1515 },
1516 "cvssV2_0": {
1517 "$schema": "http://json-schema.org/draft-04/schema#",
1518 "title": "JSON Schema for Common Vulnerability Scoring System version 2.0",
1519 "type": "object",
1520 "definitions": {
1521 "accessVectorType": {
1522 "type": "string",
1523 "enum": [
1524 "NETWORK",
1525 "ADJACENT_NETWORK",
1526 "LOCAL"
1527 ]
1528 },
1529 "accessComplexityType": {
1530 "type": "string",
1531 "enum": [
1532 "HIGH",
1533 "MEDIUM",
1534 "LOW"
1535 ]
1536 },
1537 "authenticationType": {
1538 "type": "string",
1539 "enum": [
1540 "MULTIPLE",
1541 "SINGLE",
1542 "NONE"
1543 ]
1544 },
1545 "ciaType": {
1546 "type": "string",
1547 "enum": [
1548 "NONE",
1549 "PARTIAL",
1550 "COMPLETE"
1551 ]
1552 },
1553 "exploitabilityType": {
1554 "type": "string",
1555 "enum": [
1556 "UNPROVEN",
1557 "PROOF_OF_CONCEPT",
1558 "FUNCTIONAL",
1559 "HIGH",
1560 "NOT_DEFINED"
1561 ]
1562 },
1563 "remediationLevelType": {
1564 "type": "string",
1565 "enum": [
1566 "OFFICIAL_FIX",
1567 "TEMPORARY_FIX",
1568 "WORKAROUND",
1569 "UNAVAILABLE",
1570 "NOT_DEFINED"
1571 ]
1572 },
1573 "reportConfidenceType": {
1574 "type": "string",
1575 "enum": [
1576 "UNCONFIRMED",
1577 "UNCORROBORATED",
1578 "CONFIRMED",
1579 "NOT_DEFINED"
1580 ]
1581 },
1582 "collateralDamagePotentialType": {
1583 "type": "string",
1584 "enum": [
1585 "NONE",
1586 "LOW",
1587 "LOW_MEDIUM",
1588 "MEDIUM_HIGH",
1589 "HIGH",
1590 "NOT_DEFINED"
1591 ]
1592 },
1593 "targetDistributionType": {
1594 "type": "string",
1595 "enum": [
1596 "NONE",
1597 "LOW",
1598 "MEDIUM",
1599 "HIGH",
1600 "NOT_DEFINED"
1601 ]
1602 },
1603 "ciaRequirementType": {
1604 "type": "string",
1605 "enum": [
1606 "LOW",
1607 "MEDIUM",
1608 "HIGH",
1609 "NOT_DEFINED"
1610 ]
1611 },
1612 "scoreType": {
1613 "type": "number",
1614 "minimum": 0,
1615 "maximum": 10
1616 }
1617 },
1618 "properties": {
1619 "version": {
1620 "description": "CVSS Version",
1621 "type": "string",
1622 "enum": [
1623 "2.0"
1624 ]
1625 },
1626 "vectorString": {
1627 "type": "string",
1628 "pattern": "^((AV:[NAL]|AC:[LMH]|Au:[MSN]|[CIA]:[NPC]|E:(U|POC|F|H|ND)|RL:(OF|TF|W|U|ND)|RC:(UC|UR|C|ND)|CDP:(N|L|LM|MH|H|ND)|TD:(N|L|M|H|ND)|[CIA]R:(L|M|H|ND))/)*(AV:[NAL]|AC:[LMH]|Au:[MSN]|[CIA]:[NPC]|E:(U|POC|F|H|ND)|RL:(OF|TF|W|U|ND)|RC:(UC|UR|C|ND)|CDP:(N|L|LM|MH|H|ND)|TD:(N|L|M|H|ND)|[CIA]R:(L|M|H|ND))$"
1629 },
1630 "accessVector": {
1631 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/accessVectorType"
1632 },
1633 "accessComplexity": {
1634 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/accessComplexityType"
1635 },
1636 "authentication": {
1637 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/authenticationType"
1638 },
1639 "confidentialityImpact": {
1640 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaType"
1641 },
1642 "integrityImpact": {
1643 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaType"
1644 },
1645 "availabilityImpact": {
1646 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaType"
1647 },
1648 "baseScore": {
1649 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/scoreType"
1650 },
1651 "exploitability": {
1652 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/exploitabilityType"
1653 },
1654 "remediationLevel": {
1655 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/remediationLevelType"
1656 },
1657 "reportConfidence": {
1658 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/reportConfidenceType"
1659 },
1660 "temporalScore": {
1661 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/scoreType"
1662 },
1663 "collateralDamagePotential": {
1664 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/collateralDamagePotentialType"
1665 },
1666 "targetDistribution": {
1667 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/targetDistributionType"
1668 },
1669 "confidentialityRequirement": {
1670 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaRequirementType"
1671 },
1672 "integrityRequirement": {
1673 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaRequirementType"
1674 },
1675 "availabilityRequirement": {
1676 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaRequirementType"
1677 },
1678 "environmentalScore": {
1679 "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/scoreType"
1680 }
1681 },
1682 "required": [
1683 "version",
1684 "vectorString",
1685 "baseScore"
1686 ]
1687 },
1688 "other": {
1689 "type": "object",
1690 "description": "A non-standard impact description, may be prose or JSON block.",
1691 "required": [
1692 "type",
1693 "content"
1694 ],
1695 "properties": {
1696 "type": {
1697 "description": "Name of the non-standard impact metrics format used.",
1698 "type": "string",
1699 "minLength": 1,
1700 "maxLength": 128
1701 },
1702 "content": {
1703 "type": "object",
1704 "description": "JSON object not covered by another metrics format.",
1705 "minProperties": 1
1706 }
1707 }
1708 }
1709 }
1710 }
1711 },
1712 "configurations": {
1713 "type": "array",
1714 "description": "Configurations required for exploiting this vulnerability.",
1715 "minItems": 1,
1716 "uniqueItems": true,
1717 "items": {
1718 "$ref": "#/definitions/description"
1719 }
1720 },
1721 "workarounds": {
1722 "type": "array",
1723 "description": "Workarounds and mitigations for this vulnerability.",
1724 "minItems": 1,
1725 "uniqueItems": true,
1726 "items": {
1727 "$ref": "#/definitions/description"
1728 }
1729 },
1730 "solutions": {
1731 "type": "array",
1732 "description": "Information about solutions or remediations available for this vulnerability.",
1733 "minItems": 1,
1734 "uniqueItems": true,
1735 "items": {
1736 "$ref": "#/definitions/description"
1737 }
1738 },
1739 "exploits": {
1740 "type": "array",
1741 "description": "Information about exploits of the vulnerability.",
1742 "minItems": 1,
1743 "uniqueItems": true,
1744 "items": {
1745 "$ref": "#/definitions/description"
1746 }
1747 },
1748 "timeline": {
1749 "type": "array",
1750 "description": "This is timeline information for significant events about this vulnerability or changes to the CVE Record.",
1751 "minItems": 1,
1752 "uniqueItems": true,
1753 "items": {
1754 "type": "object",
1755 "required": [
1756 "time",
1757 "lang",
1758 "value"
1759 ],
1760 "properties": {
1761 "time": {
1762 "description": "Timestamp representing when the event in the timeline occurred. The timestamp format is based on RFC3339 and ISO ISO8601, with an optional timezone. yyyy-MM-ddTHH:mm:ssZZZZ - if the timezone offset is not given, GMT (0000) is assumed.",
1763 "$ref": "#/definitions/timestamp"
1764 },
1765 "lang": {
1766 "description": "The language used in the description of the event. The language field is included so that CVE Records can support translations. The value must be a BCP 47 language code.",
1767 "$ref": "#/definitions/language"
1768 },
1769 "value": {
1770 "description": "A summary of the event.",
1771 "type": "string",
1772 "minLength": 1,
1773 "maxLength": 4096
1774 }
1775 }
1776 }
1777 },
1778 "credits": {
1779 "type": "array",
1780 "description": "Statements acknowledging specific people, organizations, or tools recognizing the work done in researching, discovering, remediating or helping with activities related to this CVE.",
1781 "minItems": 1,
1782 "uniqueItems": true,
1783 "items": {
1784 "type": "object",
1785 "properties": {
1786 "lang": {
1787 "description": "The language used when describing the credits. The language field is included so that CVE Records can support translations. The value must be a BCP 47 language code.",
1788 "$ref": "#/definitions/language"
1789 },
1790 "value": {
1791 "type": "string",
1792 "minLength": 1,
1793 "maxLength": 4096
1794 },
1795 "user": {
1796 "description": "UUID of the user being credited if present in the CVE User Registry (optional). This UUID can be used to lookup the user record in the user registry service.",
1797 "$ref": "#/definitions/uuidType"
1798 },
1799 "type": {
1800 "type": "string",
1801 "description": "Type or role of the entity being credited (optional). finder: identifies the vulnerability.\nreporter: notifies the vendor of the vulnerability to a CNA.\nanalyst: validates the vulnerability to ensure accuracy or severity.\ncoordinator: facilitates the coordinated response process.\nremediation developer: prepares a code change or other remediation plans.\nremediation reviewer: reviews vulnerability remediation plans or code changes for effectiveness and completeness.\nremediation verifier: tests and verifies the vulnerability or its remediation.\ntool: names of tools used in vulnerability discovery or identification.\nsponsor: supports the vulnerability identification or remediation activities.",
1802 "default": "finder",
1803 "enum": [
1804 "finder",
1805 "reporter",
1806 "analyst",
1807 "coordinator",
1808 "remediation developer",
1809 "remediation reviewer",
1810 "remediation verifier",
1811 "tool",
1812 "sponsor",
1813 "other"
1814 ]
1815 }
1816 },
1817 "required": [
1818 "lang",
1819 "value"
1820 ]
1821 }
1822 },
1823 "source": {
1824 "type": "object",
1825 "description": "This is the source information (who discovered it, who researched it, etc.) and optionally a chain of CNA information (e.g. the originating CNA and subsequent parent CNAs who have processed it before it arrives at the MITRE root).\n Must contain: IF this is in the root level it MUST contain a CNA_chain entry, IF this source entry is NOT in the root (e.g. it is part of a vendor statement) then it must contain at least one type of data entry.",
1826 "minProperties": 1
1827 },
1828 "language": {
1829 "type": "string",
1830 "description": "BCP 47 language code, language-region.",
1831 "default": "en",
1832 "pattern": "^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$"
1833 },
1834 "englishLanguage": {
1835 "type": "string",
1836 "description": "BCP 47 language code, language-region, required to be English.",
1837 "pattern": "^en([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$"
1838 },
1839 "taxonomyMappings": {
1840 "type": "array",
1841 "description": "List of taxonomy items related to the vulnerability.",
1842 "minItems": 1,
1843 "uniqueItems": true,
1844 "items": {
1845 "type": "object",
1846 "description": "",
1847 "required": [
1848 "taxonomyName",
1849 "taxonomyRelations"
1850 ],
1851 "properties": {
1852 "taxonomyName": {
1853 "type": "string",
1854 "description": "The name of the taxonomy.",
1855 "minLength": 1,
1856 "maxLength": 128
1857 },
1858 "taxonomyVersion": {
1859 "type": "string",
1860 "description": "The version of taxonomy the identifiers come from.",
1861 "minLength": 1,
1862 "maxLength": 128
1863 },
1864 "taxonomyRelations": {
1865 "type": "array",
1866 "description": "",
1867 "minItems": 1,
1868 "uniqueItems": true,
1869 "items": {
1870 "type": "object",
1871 "description": "List of relationships to the taxonomy for the vulnerability. Relationships can be between the taxonomy and the CVE or two taxonomy items.",
1872 "required": [
1873 "taxonomyId",
1874 "relationshipName",
1875 "relationshipValue"
1876 ],
1877 "properties": {
1878 "taxonomyId": {
1879 "type": "string",
1880 "description": "Identifier of the item in the taxonomy. Used as the subject of the relationship.",
1881 "minLength": 1,
1882 "maxLength": 2048
1883 },
1884 "relationshipName": {
1885 "type": "string",
1886 "description": "A description of the relationship.",
1887 "minLength": 1,
1888 "maxLength": 128
1889 },
1890 "relationshipValue": {
1891 "type": "string",
1892 "description": "The target of the relationship. Can be the CVE ID or another taxonomy identifier.",
1893 "minLength": 1,
1894 "maxLength": 2048
1895 }
1896 }
1897 }
1898 }
1899 }
1900 }
1901 },
1902 "tagExtension": {
1903 "type": "string",
1904 "minLength": 2,
1905 "maxLength": 128,
1906 "pattern": "^x_.*$"
1907 },
1908 "cnaTags": {
1909 "type": "array",
1910 "description": "Tags provided by a CNA describing the CVE Record.",
1911 "uniqueItems": true,
1912 "minItems": 1,
1913 "items": {
1914 "oneOf": [
1915 {
1916 "$ref": "#/definitions/tagExtension"
1917 },
1918 {
1919 "$schema": "http://json-schema.org/draft-07/schema#",
1920 "$id": "https://cve.mitre.org/cve/v5_00/tags/cna/",
1921 "type": "string",
1922 "description": "exclusively-hosted-service: All known software and/or hardware affected by this CVE Record is known to exist only in the affected hosted service. If the vulnerability affects both hosted and on-prem software and/or hardware, then the tag should not be used.\n\nunsupported-when-assigned: Used by the assigning CNA to indicate that when a request for a CVE assignment was received, the product was already end-of-life (EOL) or a product or specific version was deemed not to be supported by the vendor. This tag should only be applied to a CVE Record when all affected products or version lines referenced in the CVE-Record are EOL.\n\ndisputed: When one party disagrees with another party's assertion that a particular issue in software is a vulnerability, a CVE Record assigned to that issue may be tagged as being 'disputed'.",
1923 "enum": [
1924 "unsupported-when-assigned",
1925 "exclusively-hosted-service",
1926 "disputed"
1927 ]
1928 }
1929 ]
1930 }
1931 },
1932 "adpTags": {
1933 "type": "array",
1934 "description": "Tags provided by an ADP describing the CVE Record.",
1935 "uniqueItems": true,
1936 "minItems": 1,
1937 "items": {
1938 "oneOf": [
1939 {
1940 "$ref": "#/definitions/tagExtension"
1941 },
1942 {
1943 "$schema": "http://json-schema.org/draft-07/schema#",
1944 "$id": "https://cve.mitre.org/cve/v5_00/tags/adp/",
1945 "type": "string",
1946 "description": "disputed: When one party disagrees with another party's assertion that a particular issue in software is a vulnerability, a CVE Record assigned to that issue may be tagged as being 'disputed'.",
1947 "enum": [
1948 "disputed"
1949 ]
1950 }
1951 ]
1952 }
1953 }
1954 },
1955 "oneOf": [
1956 {
1957 "title": "Published",
1958 "description": "When a CNA populates the data associated with a CVE ID as a CVE Record, the state of the CVE Record is Published.",
1959 "properties": {
1960 "dataType": {
1961 "$ref": "#/definitions/dataType"
1962 },
1963 "dataVersion": {
1964 "$ref": "#/definitions/dataVersion"
1965 },
1966 "cveMetadata": {
1967 "$ref": "#/definitions/cveMetadataPublished"
1968 },
1969 "containers": {
1970 "description": "A set of structures (called containers) used to store vulnerability information related to a specific CVE ID provided by a specific organization participating in the CVE program. Each container includes information provided by a different source.\n\nAt a minimum, a 'cna' container containing the vulnerability information provided by the CNA who initially assigned the CVE ID must be included.\n\nThere can only be one 'cna' container, as there can only be one assigning CNA. However, there can be multiple 'adp' containers, allowing multiple organizations participating in the CVE program to add additional information related to the vulnerability. For the most part, the 'cna' and 'adp' containers contain the same properties. The main differences are the source of the information. The 'cna' container requires the CNA to include certain fields, while the 'adp' container does not.",
1971 "type": "object",
1972 "properties": {
1973 "cna": {
1974 "$ref": "#/definitions/cnaPublishedContainer"
1975 },
1976 "adp": {
1977 "type": "array",
1978 "items": {
1979 "$ref": "#/definitions/adpContainer"
1980 },
1981 "minItems": 1,
1982 "uniqueItems": true
1983 }
1984 },
1985 "required": [
1986 "cna"
1987 ],
1988 "additionalProperties": false
1989 }
1990 },
1991 "required": [
1992 "dataType",
1993 "dataVersion",
1994 "cveMetadata",
1995 "containers"
1996 ],
1997 "additionalProperties": false
1998 },
1999 {
2000 "title": "Rejected",
2001 "description": "If the CVE ID and associated CVE Record should no longer be used, the CVE Record is placed in the Rejected state. A Rejected CVE Record remains on the CVE List so that users can know when it is invalid.",
2002 "properties": {
2003 "dataType": {
2004 "$ref": "#/definitions/dataType"
2005 },
2006 "dataVersion": {
2007 "$ref": "#/definitions/dataVersion"
2008 },
2009 "cveMetadata": {
2010 "$ref": "#/definitions/cveMetadataRejected"
2011 },
2012 "containers": {
2013 "description": "A set of structures (called containers) used to store vulnerability information related to a specific CVE ID provided by a specific organization participating in the CVE program. Each container includes information provided by a different source.\n\nAt minimum, a 'cna' container containing the vulnerability information provided by the CNA who initially assigned the CVE ID must be included.\n\nThere can only be one 'cna' container, as there can only be one assigning CNA.",
2014 "type": "object",
2015 "properties": {
2016 "cna": {
2017 "$ref": "#/definitions/cnaRejectedContainer"
2018 }
2019 },
2020 "required": [
2021 "cna"
2022 ],
2023 "additionalProperties": false
2024 }
2025 },
2026 "required": [
2027 "dataType",
2028 "dataVersion",
2029 "cveMetadata",
2030 "containers"
2031 ],
2032 "additionalProperties": false
2033 }
2034 ]
2035}
diff --git a/scripts/cve_json5_verify.py b/scripts/cve_json5_verify.py
0new file mode 1007552036new file mode 100755
index 0000000..d92669a
--- /dev/null
+++ b/scripts/cve_json5_verify.py
@@ -0,0 +1,186 @@
1#!/usr/bin/env python3
2
3"""
4verify the schema of a cve-json5 and cve-json5-api files
5set --debug to check cve-json5-api before CNA publication
6
7$ ./scripts/cve_verify_json5.py $PATH_TO_JSON
8
9nb: a cve-json5-api file is a subset of cve-json5 and
10 required to interact with the API for CNAs
11
12Copyright 2023, Canonical Ltd.
13Author: Mark Esler <mark.esler@canonical.com>
14"""
15
16
17import argparse
18import inspect
19import json
20import pathlib
21import sys
22from typing import Tuple
23
24import jsonschema
25
26
27def debug(msg: str) -> None:
28 """print to stderr"""
29 print("DEBUG: " + msg, file=sys.stderr)
30
31
32def load_json(path: pathlib.Path) -> dict:
33 """loads generic ascii json files"""
34 # NOTE: all files *should* be ascii encoding
35 # https://github.com/CVEProject/cvelistV5/issues/25
36 # pylint: disable=unspecified-encoding
37 with open(path) as j:
38 data = json.load(j)
39 return data
40
41
42def load_schema(path: pathlib.Path) -> Tuple[dict, dict]:
43 """returns json schemas"""
44 json5_schema = load_json(path)
45 json5_schema_cna = json5_schema["definitions"]["cnaPublishedContainer"]["properties"]
46 return json5_schema, json5_schema_cna
47
48
49def debug_cve_json5_api_affected() -> bool:
50 """
51 tests cve["affected"] for CVE Project requirements
52
53 debug relies on inspect.trace to write messages
54 if a "pointless-statement" fails, trace prints
55
56 function returns True or False depending if API compliant
57 """
58 passed = True
59 try:
60 # check if set
61 # pylint: disable=pointless-statement
62 cve["affected"]
63 # check if set but false
64 if not cve["affected"]:
65 debug('cve["affected"] is empty')
66 raise ValueError
67 try:
68 # in case of multiple packages, check each package
69 # first check is cve["affected"][0]["versions"][0]["status"]
70 for i in cve["affected"]:
71 if not i["versions"]:
72 debug('cve["affected"]{["versions"]} is empty')
73 raise ValueError
74 try:
75 for j in i["versions"]:
76 # pylint: disable=pointless-statement
77 j["status"]
78 # pylint: disable=bare-except
79 except:
80 passed = False
81 debug('cve["affected"]{["versions"]{["status"}} is missing:')
82 debug(str(inspect.trace()[-1][0].f_locals["j"]))
83 # pylint: disable=bare-except
84 except:
85 passed = False
86 debug(f'cve["affected"]{["versions"]} information is missing:')
87 debug(str(inspect.trace()[-1][0].f_locals["i"]))
88 # pylint: disable=bare-except
89 except:
90 passed = False
91 debug('cve["affected"] does not exist or is empty')
92 return passed
93
94
95def debug_cve_json5_api_metrics() -> None:
96 """
97 tests cve["metrics"] for CVE Project requirements
98
99 debug relies on inspect.trace to write messages
100 if a "pointless-statement" fails, trace prints
101
102 function returns True or False depending if API compliant
103 """
104 passed = True
105 try:
106 # pylint: disable=pointless-statement
107 cve["metrics"]
108 if not cve["metrics"]:
109 debug('cve["metrics"] is empty')
110 raise ValueError
111 try:
112 for i in cve["metrics"]:
113 if not i["cvssV3_1"]["vectorString"]:
114 debug('cve["metrics"]{["cvssV3_1"]["vectorString"]} is empty')
115 raise ValueError
116 # pylint: disable=bare-except
117 except:
118 passed = False
119 debug('cve["metrics"]{["cssV3_1"]["vectorString"]} information is missing:')
120 debug(str(inspect.trace()[-1][0].f_locals["i"]))
121 # pylint: disable=bare-except
122 except:
123 passed = False
124 debug('cve["metrics"] does not exist or is empty')
125 return passed
126
127
128def debug_cve_json5_api() -> bool:
129 """tests fields which the CVE Project requires"""
130 return debug_cve_json5_api_affected() and debug_cve_json5_api_metrics
131
132
133def verify_cve_json5() -> bool:
134 """verify cve-json5"""
135 return jsonschema.Draft7Validator(schema).is_valid(cve)
136
137
138def verify_cve_json5_api() -> bool:
139 """
140 verify cve-json5-api and optionally check for publication
141
142 --debug is required to check API compiance
143 """
144 if jsonschema.Draft7Validator(schema_cna).is_valid(cve):
145 if DEBUG:
146 #NOTE: a cve_json5_api file can have a valid syntax, but not be
147 # ready for publication if information is missing
148 if debug_cve_json5_api():
149 debug("ready for CNA publication")
150 else:
151 debug("not ready for CNA publication")
152 # note: the json5 can be valid, but not API compliant
153 # --debug required for API compliance
154 return True
155 return False
156
157
158def verify() -> None:
159 """check if file is a valid cve-json5 type"""
160 if verify_cve_json5():
161 if DEBUG:
162 debug(f"{cve_file} is a valid cve-json5 file")
163 sys.exit(0)
164 elif verify_cve_json5_api():
165 if DEBUG:
166 debug(f"{cve_file} is a valid cve-json5-api file")
167 sys.exit(0)
168 else:
169 raise TypeError(f"{cve_file} is NOT a valid cve-json5 or cve-json5-api file")
170 sys.exit(1)
171
172
173if __name__ == "__main__":
174 parser = argparse.ArgumentParser(description="cve-verify")
175 parser.add_argument("cve_json5_paths", nargs="+", type=pathlib.Path)
176 parser.add_argument("--debug", help="add debug info, required for API check", action="store_true")
177 cve_files = parser.parse_args().cve_json5_paths
178 DEBUG = parser.parse_args().debug
179
180 uct_path = pathlib.Path(__file__).resolve().parent.parent
181 schema_path = uct_path.joinpath("./scripts/cve-json5-schema.json")
182 schema, schema_cna = load_schema(schema_path)
183
184 for cve_file in cve_files:
185 cve = load_json(cve_file)
186 verify()

Subscribers

People subscribed via source and target branches