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
1diff --git a/scripts/cve-json5-schema.json b/scripts/cve-json5-schema.json
2new file mode 100644
3index 0000000..4cf417a
4--- /dev/null
5+++ b/scripts/cve-json5-schema.json
6@@ -0,0 +1,2035 @@
7+{
8+ "$schema": "http://json-schema.org/draft-07/schema#",
9+ "$id": "https://cve.org/cve/record/v5_00/",
10+ "type": "object",
11+ "title": "CVE JSON record format",
12+ "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/).",
13+ "definitions": {
14+ "uriType": {
15+ "description": "A universal resource identifier (URI), according to [RFC 3986](https://tools.ietf.org/html/rfc3986).",
16+ "type": "string",
17+ "format": "uri",
18+ "minLength": 1,
19+ "maxLength": 2048
20+ },
21+ "uuidType": {
22+ "description": "A version 4 (random) universally unique identifier (UUID) as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.3).",
23+ "type": "string",
24+ "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}$"
25+ },
26+ "reference": {
27+ "type": "object",
28+ "required": [
29+ "url"
30+ ],
31+ "properties": {
32+ "url": {
33+ "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.",
34+ "$ref": "#/definitions/uriType"
35+ },
36+ "name": {
37+ "description": "User created name for the reference, often the title of the page.",
38+ "type": "string",
39+ "maxLength": 512,
40+ "minLength": 1
41+ },
42+ "tags": {
43+ "description": "An array of one or more tags that describe the resource referenced by 'url'.",
44+ "type": "array",
45+ "minItems": 1,
46+ "uniqueItems": true,
47+ "items": {
48+ "oneOf": [
49+ {
50+ "$ref": "#/definitions/tagExtension"
51+ },
52+ {
53+ "$schema": "http://json-schema.org/draft-07/schema#",
54+ "$id": "https://cve.mitre.org/cve/v5_00/tags/reference/",
55+ "type": "string",
56+ "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",
57+ "enum": [
58+ "broken-link",
59+ "customer-entitlement",
60+ "exploit",
61+ "government-resource",
62+ "issue-tracking",
63+ "mailing-list",
64+ "mitigation",
65+ "not-applicable",
66+ "patch",
67+ "permissions-required",
68+ "media-coverage",
69+ "product",
70+ "related",
71+ "release-notes",
72+ "signature",
73+ "technical-description",
74+ "third-party-advisory",
75+ "vendor-advisory",
76+ "vdb-entry"
77+ ]
78+ }
79+ ]
80+ }
81+ }
82+ }
83+ },
84+ "cveId": {
85+ "type": "string",
86+ "pattern": "^CVE-[0-9]{4}-[0-9]{4,19}$"
87+ },
88+ "orgId": {
89+ "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.",
90+ "$ref": "#/definitions/uuidType"
91+ },
92+ "userId": {
93+ "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.",
94+ "$ref": "#/definitions/uuidType"
95+ },
96+ "shortName": {
97+ "description": "A 2-32 character name that can be used to complement an organization's UUID.",
98+ "type": "string",
99+ "minLength": 2,
100+ "maxLength": 32
101+ },
102+ "datestamp": {
103+ "description": "Date/time format based on RFC3339 and ISO ISO8601.",
104+ "type": "string",
105+ "format": "date",
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))$"
107+ },
108+ "timestamp": {
109+ "type": "string",
110+ "format": "date-time",
111+ "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.",
112+ "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})?$"
113+ },
114+ "version": {
115+ "description": "A single version of a product, as expressed in its own version numbering scheme.",
116+ "type": "string",
117+ "minLength": 1,
118+ "maxLength": 1024
119+ },
120+ "status": {
121+ "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.",
122+ "type": "string",
123+ "enum": [
124+ "affected",
125+ "unaffected",
126+ "unknown"
127+ ]
128+ },
129+ "product": {
130+ "type": "object",
131+ "description": "Provides information about the set of products and services affected by this vulnerability.",
132+ "allOf": [
133+ {
134+ "anyOf": [
135+ {
136+ "required": [
137+ "vendor",
138+ "product"
139+ ]
140+ },
141+ {
142+ "required": [
143+ "collectionURL",
144+ "packageName"
145+ ]
146+ }
147+ ]
148+ },
149+ {
150+ "anyOf": [
151+ {
152+ "required": [
153+ "versions"
154+ ]
155+ },
156+ {
157+ "required": [
158+ "defaultStatus"
159+ ]
160+ }
161+ ]
162+ }
163+ ],
164+ "properties": {
165+ "vendor": {
166+ "type": "string",
167+ "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.",
168+ "minLength": 1,
169+ "maxLength": 512
170+ },
171+ "product": {
172+ "type": "string",
173+ "description": "Name of the affected product.",
174+ "minLength": 1,
175+ "maxLength": 2048
176+ },
177+ "collectionURL": {
178+ "description": "URL identifying a package collection (determines the meaning of packageName).",
179+ "$ref": "#/definitions/uriType",
180+ "examples": [
181+ "https://access.redhat.com/downloads/content/package-browser",
182+ "https://addons.mozilla.org",
183+ "https://addons.thunderbird.net",
184+ "https://anaconda.org/anaconda/repo",
185+ "https://app.vagrantup.com/boxes/search",
186+ "https://apps.apple.com",
187+ "https://archlinux.org/packages",
188+ "https://atmospherejs.meteor.com",
189+ "https://atom.io/packages",
190+ "https://bitbucket.org",
191+ "https://bower.io",
192+ "https://brew.sh/",
193+ "https://chocolatey.org/packages",
194+ "https://chrome.google.com/webstore",
195+ "https://clojars.org",
196+ "https://cocoapods.org",
197+ "https://code.dlang.org",
198+ "https://conan.io/center",
199+ "https://cpan.org/modules",
200+ "https://cran.r-project.org",
201+ "https://crates.io",
202+ "https://ctan.org/pkg",
203+ "https://drupal.org",
204+ "https://exchange.adobe.com",
205+ "https://forge.puppet.com/modules",
206+ "https://github.com",
207+ "https://gitlab.com/explore",
208+ "https://golang.org/pkg",
209+ "https://guix.gnu.org/packages",
210+ "https://hackage.haskell.org",
211+ "https://helm.sh",
212+ "https://hub.docker.com",
213+ "https://juliahub.com",
214+ "https://lib.haxe.org",
215+ "https://luarocks.org",
216+ "https://marketplace.visualstudio.com",
217+ "https://melpa.org",
218+ "https://microsoft.com/en-us/store/apps",
219+ "https://nimble.directory",
220+ "https://nuget.org/packages",
221+ "https://opam.ocaml.org/packages",
222+ "https://openwrt.org/packages/index",
223+ "https://package.elm-lang.org",
224+ "https://packagecontrol.io",
225+ "https://packages.debian.org",
226+ "https://packages.gentoo.org",
227+ "https://packagist.org",
228+ "https://pear.php.net/packages.php",
229+ "https://pecl.php.net",
230+ "https://platformio.org/lib",
231+ "https://play.google.com/store",
232+ "https://plugins.gradle.org",
233+ "https://projects.eclipse.org",
234+ "https://pub.dev",
235+ "https://pypi.python.org",
236+ "https://registry.npmjs.org",
237+ "https://registry.terraform.io",
238+ "https://repo.hex.pm",
239+ "https://repo.maven.apache.org/maven2",
240+ "https://rubygems.org",
241+ "https://search.nixos.org/packages",
242+ "https://sourceforge.net",
243+ "https://wordpress.org/plugins"
244+ ]
245+ },
246+ "packageName": {
247+ "type": "string",
248+ "description": "Name or identifier of the affected software package as used in the package collection.",
249+ "minLength": 1,
250+ "maxLength": 2048
251+ },
252+ "cpes": {
253+ "type": "array",
254+ "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.",
255+ "uniqueItems": true,
256+ "items": {
257+ "title": "CPE Name",
258+ "type": "string",
259+ "description": "Common Platform Enumeration (CPE) Name in either 2.2 or 2.3 format",
260+ "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})",
261+ "minLength": 1,
262+ "maxLength": 2048
263+ }
264+ },
265+ "modules": {
266+ "type": "array",
267+ "description": "A list of the affected components, features, modules, sub-components, sub-products, APIs, commands, utilities, programs, or functionalities (optional).",
268+ "uniqueItems": true,
269+ "items": {
270+ "type": "string",
271+ "description": "Name of the affected component, feature, module, sub-component, sub-product, API, command, utility, program, or functionality (optional).",
272+ "minLength": 1,
273+ "maxLength": 4096
274+ }
275+ },
276+ "programFiles": {
277+ "type": "array",
278+ "description": "A list of the affected source code files (optional).",
279+ "uniqueItems": true,
280+ "items": {
281+ "description": "Name or path or location of the affected source code file.",
282+ "type": "string",
283+ "minLength": 1,
284+ "maxLength": 1024
285+ }
286+ },
287+ "programRoutines": {
288+ "type": "array",
289+ "description": "A list of the affected source code functions, methods, subroutines, or procedures (optional).",
290+ "uniqueItems": true,
291+ "items": {
292+ "type": "object",
293+ "description": "An object describing program routine.",
294+ "required": [
295+ "name"
296+ ],
297+ "properties": {
298+ "name": {
299+ "type": "string",
300+ "description": "Name of the affected source code file, function, method, subroutine, or procedure.",
301+ "minLength": 1,
302+ "maxLength": 4096
303+ }
304+ }
305+ }
306+ },
307+ "platforms": {
308+ "title": "Platforms",
309+ "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.",
310+ "type": "array",
311+ "minItems": 1,
312+ "uniqueItems": true,
313+ "items": {
314+ "type": "string",
315+ "examples": [
316+ "iOS",
317+ "Android",
318+ "Windows",
319+ "macOS",
320+ "x86",
321+ "ARM",
322+ "64 bit",
323+ "Big Endian",
324+ "iPad",
325+ "Chromebook",
326+ "Docker",
327+ "Model T"
328+ ],
329+ "maxLength": 1024
330+ }
331+ },
332+ "repo": {
333+ "description": "The URL of the source code repository, for informational purposes and/or to resolve git hash version ranges.",
334+ "$ref": "#/definitions/uriType"
335+ },
336+ "defaultStatus": {
337+ "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.",
338+ "$ref": "#/definitions/status"
339+ },
340+ "versions": {
341+ "type": "array",
342+ "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.",
343+ "minItems": 1,
344+ "uniqueItems": true,
345+ "items": {
346+ "type": "object",
347+ "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.",
348+ "oneOf": [
349+ {
350+ "required": [
351+ "version",
352+ "status"
353+ ],
354+ "maxProperties": 2
355+ },
356+ {
357+ "required": [
358+ "version",
359+ "status",
360+ "versionType"
361+ ],
362+ "oneOf": [
363+ {
364+ "required": [
365+ "lessThan"
366+ ]
367+ },
368+ {
369+ "required": [
370+ "lessThanOrEqual"
371+ ]
372+ }
373+ ]
374+ }
375+ ],
376+ "properties": {
377+ "version": {
378+ "description": "The single version being described, or the version at the start of the range. By convention, typically 0 denotes the earliest possible version.",
379+ "$ref": "#/definitions/version"
380+ },
381+ "status": {
382+ "description": "The vulnerability status for the version or range of versions. For a range, the status may be refined by the 'changes' list.",
383+ "$ref": "#/definitions/status"
384+ },
385+ "versionType": {
386+ "type": "string",
387+ "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.",
388+ "minLength": 1,
389+ "maxLength": 128,
390+ "examples": [
391+ "custom",
392+ "git",
393+ "maven",
394+ "python",
395+ "rpm",
396+ "semver"
397+ ]
398+ },
399+ "lessThan": {
400+ "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.",
401+ "$ref": "#/definitions/version"
402+ },
403+ "lessThanOrEqual": {
404+ "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.",
405+ "$ref": "#/definitions/version"
406+ },
407+ "changes": {
408+ "type": "array",
409+ "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.",
410+ "minItems": 1,
411+ "uniqueItems": true,
412+ "items": {
413+ "type": "object",
414+ "description": "The start of a single status change during the range.",
415+ "required": [
416+ "at",
417+ "status"
418+ ],
419+ "properties": {
420+ "at": {
421+ "description": "The version at which a status change occurs.",
422+ "$ref": "#/definitions/version"
423+ },
424+ "status": {
425+ "description": "The new status in the range starting at the given version.",
426+ "$ref": "#/definitions/status"
427+ }
428+ }
429+ }
430+ }
431+ }
432+ }
433+ }
434+ }
435+ },
436+ "dataType": {
437+ "description": "Indicates the type of information represented in the JSON instance.",
438+ "type": "string",
439+ "enum": [
440+ "CVE_RECORD"
441+ ]
442+ },
443+ "dataVersion": {
444+ "description": "The version of the schema being used. Used to support multiple versions of this format.",
445+ "type": "string",
446+ "enum": [
447+ "5.0"
448+ ]
449+ },
450+ "cveMetadataPublished": {
451+ "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.",
452+ "type": "object",
453+ "required": [
454+ "cveId",
455+ "assignerOrgId",
456+ "state"
457+ ],
458+ "properties": {
459+ "cveId": {
460+ "description": "The CVE identifier that this record pertains to.",
461+ "$ref": "#/definitions/cveId"
462+ },
463+ "assignerOrgId": {
464+ "$ref": "#/definitions/orgId",
465+ "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."
466+ },
467+ "assignerShortName": {
468+ "$ref": "#/definitions/shortName",
469+ "description": "The short name for the organization to which the CVE ID was originally assigned."
470+ },
471+ "requesterUserId": {
472+ "$ref": "#/definitions/userId",
473+ "description": "The user that requested the CVE identifier."
474+ },
475+ "dateUpdated": {
476+ "description": "The date/time the record was last updated.",
477+ "$ref": "#/definitions/timestamp"
478+ },
479+ "serial": {
480+ "type": "integer",
481+ "minimum": 1,
482+ "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."
483+ },
484+ "dateReserved": {
485+ "$ref": "#/definitions/timestamp",
486+ "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."
487+ },
488+ "datePublished": {
489+ "$ref": "#/definitions/timestamp",
490+ "description": "The date/time the CVE Record was first published in the CVE List."
491+ },
492+ "state": {
493+ "description": "State of CVE - PUBLISHED, REJECTED.",
494+ "type": "string",
495+ "enum": [
496+ "PUBLISHED"
497+ ]
498+ }
499+ },
500+ "additionalProperties": false
501+ },
502+ "cveMetadataRejected": {
503+ "type": "object",
504+ "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.",
505+ "required": [
506+ "cveId",
507+ "assignerOrgId",
508+ "state"
509+ ],
510+ "properties": {
511+ "cveId": {
512+ "description": "The CVE identifier that this record pertains to.",
513+ "$ref": "#/definitions/cveId"
514+ },
515+ "assignerOrgId": {
516+ "$ref": "#/definitions/orgId",
517+ "description": "The UUID for the organization to which the CVE ID was originally assigned."
518+ },
519+ "assignerShortName": {
520+ "$ref": "#/definitions/shortName",
521+ "description": "The short name for the organization to which the CVE ID was originally assigned."
522+ },
523+ "serial": {
524+ "type": "integer",
525+ "minimum": 1,
526+ "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."
527+ },
528+ "dateUpdated": {
529+ "description": "The date/time the record was last updated.",
530+ "$ref": "#/definitions/timestamp"
531+ },
532+ "datePublished": {
533+ "$ref": "#/definitions/timestamp",
534+ "description": "The date/time the CVE Record was first published in the CVE List."
535+ },
536+ "dateRejected": {
537+ "$ref": "#/definitions/timestamp",
538+ "description": "The date/time the CVE ID was rejected."
539+ },
540+ "state": {
541+ "type": "string",
542+ "description": "State of CVE - PUBLISHED, REJECTED.",
543+ "enum": [
544+ "REJECTED"
545+ ]
546+ },
547+ "dateReserved": {
548+ "$ref": "#/definitions/timestamp",
549+ "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."
550+ }
551+ },
552+ "additionalProperties": false
553+ },
554+ "providerMetadata": {
555+ "type": "object",
556+ "description": "Details related to the information container provider (CNA or ADP).",
557+ "properties": {
558+ "orgId": {
559+ "$ref": "#/definitions/orgId",
560+ "description": "The container provider's organizational UUID."
561+ },
562+ "shortName": {
563+ "$ref": "#/definitions/shortName",
564+ "description": "The container provider's organizational short name."
565+ },
566+ "dateUpdated": {
567+ "$ref": "#/definitions/timestamp",
568+ "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."
569+ }
570+ },
571+ "required": [
572+ "orgId"
573+ ]
574+ },
575+ "cnaPublishedContainer": {
576+ "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.",
577+ "type": "object",
578+ "properties": {
579+ "providerMetadata": {
580+ "$ref": "#/definitions/providerMetadata"
581+ },
582+ "dateAssigned": {
583+ "$ref": "#/definitions/timestamp",
584+ "description": "The date/time this CVE ID was associated with a vulnerability by a CNA."
585+ },
586+ "datePublic": {
587+ "$ref": "#/definitions/timestamp",
588+ "description": "If known, the date/time the vulnerability was disclosed publicly."
589+ },
590+ "title": {
591+ "type": "string",
592+ "description": "A title, headline, or a brief phrase summarizing the CVE record. Eg., Buffer overflow in Example Soft.",
593+ "minLength": 1,
594+ "maxLength": 256
595+ },
596+ "descriptions": {
597+ "$ref": "#/definitions/descriptions"
598+ },
599+ "affected": {
600+ "$ref": "#/definitions/affected"
601+ },
602+ "problemTypes": {
603+ "$ref": "#/definitions/problemTypes"
604+ },
605+ "references": {
606+ "$ref": "#/definitions/references"
607+ },
608+ "impacts": {
609+ "$ref": "#/definitions/impacts"
610+ },
611+ "metrics": {
612+ "$ref": "#/definitions/metrics"
613+ },
614+ "configurations": {
615+ "$ref": "#/definitions/configurations"
616+ },
617+ "workarounds": {
618+ "$ref": "#/definitions/workarounds"
619+ },
620+ "solutions": {
621+ "$ref": "#/definitions/solutions"
622+ },
623+ "exploits": {
624+ "$ref": "#/definitions/exploits"
625+ },
626+ "timeline": {
627+ "$ref": "#/definitions/timeline"
628+ },
629+ "credits": {
630+ "$ref": "#/definitions/credits"
631+ },
632+ "source": {
633+ "$ref": "#/definitions/source"
634+ },
635+ "tags": {
636+ "$ref": "#/definitions/cnaTags"
637+ },
638+ "taxonomyMappings": {
639+ "$ref": "#/definitions/taxonomyMappings"
640+ }
641+ },
642+ "required": [
643+ "providerMetadata",
644+ "descriptions",
645+ "affected",
646+ "references"
647+ ],
648+ "patternProperties": {
649+ "^x_[^.]*$": {}
650+ },
651+ "additionalProperties": false
652+ },
653+ "cnaRejectedContainer": {
654+ "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.",
655+ "type": "object",
656+ "properties": {
657+ "providerMetadata": {
658+ "$ref": "#/definitions/providerMetadata"
659+ },
660+ "rejectedReasons": {
661+ "description": "Reasons for rejecting this CVE Record.",
662+ "$ref": "#/definitions/descriptions"
663+ },
664+ "replacedBy": {
665+ "type": "array",
666+ "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.",
667+ "minItems": 1,
668+ "uniqueItems": true,
669+ "items": {
670+ "$ref": "#/definitions/cveId"
671+ }
672+ }
673+ },
674+ "required": [
675+ "providerMetadata",
676+ "rejectedReasons"
677+ ],
678+ "patternProperties": {
679+ "^x_[^.]*$": {}
680+ },
681+ "additionalProperties": false
682+ },
683+ "adpContainer": {
684+ "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.",
685+ "type": "object",
686+ "properties": {
687+ "providerMetadata": {
688+ "$ref": "#/definitions/providerMetadata"
689+ },
690+ "datePublic": {
691+ "$ref": "#/definitions/timestamp",
692+ "description": "If known, the date/time the vulnerability was disclosed publicly."
693+ },
694+ "title": {
695+ "type": "string",
696+ "description": "A title, headline, or a brief phrase summarizing the information in an ADP container.",
697+ "minLength": 1,
698+ "maxLength": 256
699+ },
700+ "descriptions": {
701+ "$ref": "#/definitions/descriptions"
702+ },
703+ "affected": {
704+ "$ref": "#/definitions/affected"
705+ },
706+ "problemTypes": {
707+ "$ref": "#/definitions/problemTypes"
708+ },
709+ "references": {
710+ "$ref": "#/definitions/references"
711+ },
712+ "impacts": {
713+ "$ref": "#/definitions/impacts"
714+ },
715+ "metrics": {
716+ "$ref": "#/definitions/metrics"
717+ },
718+ "configurations": {
719+ "$ref": "#/definitions/configurations"
720+ },
721+ "workarounds": {
722+ "$ref": "#/definitions/workarounds"
723+ },
724+ "solutions": {
725+ "$ref": "#/definitions/solutions"
726+ },
727+ "exploits": {
728+ "$ref": "#/definitions/exploits"
729+ },
730+ "timeline": {
731+ "$ref": "#/definitions/timeline"
732+ },
733+ "credits": {
734+ "$ref": "#/definitions/credits"
735+ },
736+ "source": {
737+ "$ref": "#/definitions/source"
738+ },
739+ "tags": {
740+ "$ref": "#/definitions/adpTags"
741+ },
742+ "taxonomyMappings": {
743+ "$ref": "#/definitions/taxonomyMappings"
744+ }
745+ },
746+ "required": [
747+ "providerMetadata"
748+ ],
749+ "minProperties": 2,
750+ "patternProperties": {
751+ "^x_[^.]*$": {}
752+ },
753+ "additionalProperties": false
754+ },
755+ "affected": {
756+ "type": "array",
757+ "description": "List of affected products.",
758+ "minItems": 1,
759+ "items": {
760+ "$ref": "#/definitions/product"
761+ }
762+ },
763+ "description": {
764+ "type": "object",
765+ "description": "Text in a particular language with optional alternate markup or formatted representation (e.g., Markdown) or embedded media.",
766+ "properties": {
767+ "lang": {
768+ "$ref": "#/definitions/language"
769+ },
770+ "value": {
771+ "type": "string",
772+ "description": "Plain text description.",
773+ "minLength": 1,
774+ "maxLength": 4096
775+ },
776+ "supportingMedia": {
777+ "type": "array",
778+ "title": "Supporting media",
779+ "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.",
780+ "uniqueItems": true,
781+ "minItems": 1,
782+ "items": {
783+ "type": "object",
784+ "properties": {
785+ "type": {
786+ "type": "string",
787+ "title": "Media type",
788+ "minLength": 1,
789+ "maxLength": 256,
790+ "description": "RFC2046 compliant IANA Media type for eg., text/markdown, text/html.",
791+ "examples": [
792+ "text/markdown",
793+ "text/html",
794+ "image/png",
795+ "image/svg",
796+ "audio/mp3"
797+ ]
798+ },
799+ "base64": {
800+ "type": "boolean",
801+ "title": "Encoding",
802+ "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.",
803+ "default": false
804+ },
805+ "value": {
806+ "type": "string",
807+ "description": "Supporting media content, up to 16K. If base64 is true, this field stores base64 encoded data.",
808+ "minLength": 1,
809+ "maxLength": 16384
810+ }
811+ },
812+ "required": [
813+ "type",
814+ "value"
815+ ]
816+ }
817+ }
818+ },
819+ "required": [
820+ "lang",
821+ "value"
822+ ],
823+ "additionalProperties": false
824+ },
825+ "englishLanguageDescription": {
826+ "type": "object",
827+ "description": "A description with lang set to an English language (en, en_US, en_UK, and so on).",
828+ "properties": {
829+ "lang": {
830+ "$ref": "#/definitions/englishLanguage"
831+ }
832+ },
833+ "required": [
834+ "lang"
835+ ]
836+ },
837+ "descriptions": {
838+ "type": "array",
839+ "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].",
840+ "minItems": 1,
841+ "uniqueItems": true,
842+ "items": {
843+ "$ref": "#/definitions/description"
844+ },
845+ "contains": {
846+ "$ref": "#/definitions/englishLanguageDescription"
847+ }
848+ },
849+ "problemTypes": {
850+ "type": "array",
851+ "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]).",
852+ "items": {
853+ "type": "object",
854+ "required": [
855+ "descriptions"
856+ ],
857+ "properties": {
858+ "descriptions": {
859+ "type": "array",
860+ "items": {
861+ "type": "object",
862+ "required": [
863+ "lang",
864+ "description"
865+ ],
866+ "properties": {
867+ "lang": {
868+ "$ref": "#/definitions/language"
869+ },
870+ "description": {
871+ "type": "string",
872+ "description": "Text description of problemType, or title from CWE or OWASP.",
873+ "minLength": 1,
874+ "maxLength": 4096
875+ },
876+ "cweId": {
877+ "type": "string",
878+ "description": "CWE ID of the CWE that best describes this problemType entry.",
879+ "minLength": 5,
880+ "maxLength": 9,
881+ "pattern": "^CWE-[1-9][0-9]*$"
882+ },
883+ "type": {
884+ "type": "string",
885+ "description": "Problemtype source, text, OWASP, CWE, etc.,",
886+ "minLength": 1,
887+ "maxLength": 128
888+ },
889+ "references": {
890+ "$ref": "#/definitions/references"
891+ }
892+ }
893+ },
894+ "minItems": 1,
895+ "uniqueItems": true
896+ }
897+ }
898+ },
899+ "minItems": 1,
900+ "uniqueItems": true
901+ },
902+ "references": {
903+ "type": "array",
904+ "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\").",
905+ "items": {
906+ "$ref": "#/definitions/reference"
907+ },
908+ "minItems": 1,
909+ "maxItems": 512,
910+ "uniqueItems": true
911+ },
912+ "impacts": {
913+ "type": "array",
914+ "description": "Collection of impacts of this vulnerability.",
915+ "minItems": 1,
916+ "uniqueItems": true,
917+ "items": {
918+ "type": "object",
919+ "description": "This is impact type information (e.g. a text description.",
920+ "required": [
921+ "descriptions"
922+ ],
923+ "properties": {
924+ "capecId": {
925+ "type": "string",
926+ "description": "CAPEC ID that best relates to this impact.",
927+ "minLength": 7,
928+ "maxLength": 11,
929+ "pattern": "^CAPEC-[1-9][0-9]{0,4}$"
930+ },
931+ "descriptions": {
932+ "description": "Prose description of the impact scenario. At a minimum provide the description given by CAPEC.",
933+ "$ref": "#/definitions/descriptions"
934+ }
935+ }
936+ }
937+ },
938+ "metrics": {
939+ "type": "array",
940+ "description": "Collection of impact scores with attribution.",
941+ "minItems": 1,
942+ "uniqueItems": true,
943+ "items": {
944+ "type": "object",
945+ "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.",
946+ "anyOf": [
947+ {
948+ "required": [
949+ "cvssV3_1"
950+ ]
951+ },
952+ {
953+ "required": [
954+ "cvssV3_0"
955+ ]
956+ },
957+ {
958+ "required": [
959+ "cvssV2_0"
960+ ]
961+ },
962+ {
963+ "required": [
964+ "other"
965+ ]
966+ }
967+ ],
968+ "properties": {
969+ "format": {
970+ "type": "string",
971+ "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.",
972+ "minLength": 1,
973+ "maxLength": 64
974+ },
975+ "scenarios": {
976+ "type": "array",
977+ "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.",
978+ "minItems": 1,
979+ "uniqueItems": true,
980+ "items": {
981+ "type": "object",
982+ "properties": {
983+ "lang": {
984+ "$ref": "#/definitions/language"
985+ },
986+ "value": {
987+ "type": "string",
988+ "default": "GENERAL",
989+ "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.",
990+ "minLength": 1,
991+ "maxLength": 4096
992+ }
993+ },
994+ "required": [
995+ "lang",
996+ "value"
997+ ]
998+ }
999+ },
1000+ "cvssV3_1": {
1001+ "$schema": "http://json-schema.org/draft-07/schema#",
1002+ "title": "JSON Schema for Common Vulnerability Scoring System version 3.1",
1003+ "type": "object",
1004+ "definitions": {
1005+ "attackVectorType": {
1006+ "type": "string",
1007+ "enum": [
1008+ "NETWORK",
1009+ "ADJACENT_NETWORK",
1010+ "LOCAL",
1011+ "PHYSICAL"
1012+ ]
1013+ },
1014+ "modifiedAttackVectorType": {
1015+ "type": "string",
1016+ "enum": [
1017+ "NETWORK",
1018+ "ADJACENT_NETWORK",
1019+ "LOCAL",
1020+ "PHYSICAL",
1021+ "NOT_DEFINED"
1022+ ]
1023+ },
1024+ "attackComplexityType": {
1025+ "type": "string",
1026+ "enum": [
1027+ "HIGH",
1028+ "LOW"
1029+ ]
1030+ },
1031+ "modifiedAttackComplexityType": {
1032+ "type": "string",
1033+ "enum": [
1034+ "HIGH",
1035+ "LOW",
1036+ "NOT_DEFINED"
1037+ ]
1038+ },
1039+ "privilegesRequiredType": {
1040+ "type": "string",
1041+ "enum": [
1042+ "HIGH",
1043+ "LOW",
1044+ "NONE"
1045+ ]
1046+ },
1047+ "modifiedPrivilegesRequiredType": {
1048+ "type": "string",
1049+ "enum": [
1050+ "HIGH",
1051+ "LOW",
1052+ "NONE",
1053+ "NOT_DEFINED"
1054+ ]
1055+ },
1056+ "userInteractionType": {
1057+ "type": "string",
1058+ "enum": [
1059+ "NONE",
1060+ "REQUIRED"
1061+ ]
1062+ },
1063+ "modifiedUserInteractionType": {
1064+ "type": "string",
1065+ "enum": [
1066+ "NONE",
1067+ "REQUIRED",
1068+ "NOT_DEFINED"
1069+ ]
1070+ },
1071+ "scopeType": {
1072+ "type": "string",
1073+ "enum": [
1074+ "UNCHANGED",
1075+ "CHANGED"
1076+ ]
1077+ },
1078+ "modifiedScopeType": {
1079+ "type": "string",
1080+ "enum": [
1081+ "UNCHANGED",
1082+ "CHANGED",
1083+ "NOT_DEFINED"
1084+ ]
1085+ },
1086+ "ciaType": {
1087+ "type": "string",
1088+ "enum": [
1089+ "NONE",
1090+ "LOW",
1091+ "HIGH"
1092+ ]
1093+ },
1094+ "modifiedCiaType": {
1095+ "type": "string",
1096+ "enum": [
1097+ "NONE",
1098+ "LOW",
1099+ "HIGH",
1100+ "NOT_DEFINED"
1101+ ]
1102+ },
1103+ "exploitCodeMaturityType": {
1104+ "type": "string",
1105+ "enum": [
1106+ "UNPROVEN",
1107+ "PROOF_OF_CONCEPT",
1108+ "FUNCTIONAL",
1109+ "HIGH",
1110+ "NOT_DEFINED"
1111+ ]
1112+ },
1113+ "remediationLevelType": {
1114+ "type": "string",
1115+ "enum": [
1116+ "OFFICIAL_FIX",
1117+ "TEMPORARY_FIX",
1118+ "WORKAROUND",
1119+ "UNAVAILABLE",
1120+ "NOT_DEFINED"
1121+ ]
1122+ },
1123+ "confidenceType": {
1124+ "type": "string",
1125+ "enum": [
1126+ "UNKNOWN",
1127+ "REASONABLE",
1128+ "CONFIRMED",
1129+ "NOT_DEFINED"
1130+ ]
1131+ },
1132+ "ciaRequirementType": {
1133+ "type": "string",
1134+ "enum": [
1135+ "LOW",
1136+ "MEDIUM",
1137+ "HIGH",
1138+ "NOT_DEFINED"
1139+ ]
1140+ },
1141+ "scoreType": {
1142+ "type": "number",
1143+ "minimum": 0,
1144+ "maximum": 10
1145+ },
1146+ "severityType": {
1147+ "type": "string",
1148+ "enum": [
1149+ "NONE",
1150+ "LOW",
1151+ "MEDIUM",
1152+ "HIGH",
1153+ "CRITICAL"
1154+ ]
1155+ }
1156+ },
1157+ "properties": {
1158+ "version": {
1159+ "description": "CVSS Version",
1160+ "type": "string",
1161+ "enum": [
1162+ "3.1"
1163+ ]
1164+ },
1165+ "vectorString": {
1166+ "type": "string",
1167+ "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])$"
1168+ },
1169+ "attackVector": {
1170+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/attackVectorType"
1171+ },
1172+ "attackComplexity": {
1173+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/attackComplexityType"
1174+ },
1175+ "privilegesRequired": {
1176+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/privilegesRequiredType"
1177+ },
1178+ "userInteraction": {
1179+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/userInteractionType"
1180+ },
1181+ "scope": {
1182+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/scopeType"
1183+ },
1184+ "confidentialityImpact": {
1185+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaType"
1186+ },
1187+ "integrityImpact": {
1188+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaType"
1189+ },
1190+ "availabilityImpact": {
1191+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaType"
1192+ },
1193+ "baseScore": {
1194+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/scoreType"
1195+ },
1196+ "baseSeverity": {
1197+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/severityType"
1198+ },
1199+ "exploitCodeMaturity": {
1200+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/exploitCodeMaturityType"
1201+ },
1202+ "remediationLevel": {
1203+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/remediationLevelType"
1204+ },
1205+ "reportConfidence": {
1206+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/confidenceType"
1207+ },
1208+ "temporalScore": {
1209+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/scoreType"
1210+ },
1211+ "temporalSeverity": {
1212+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/severityType"
1213+ },
1214+ "confidentialityRequirement": {
1215+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaRequirementType"
1216+ },
1217+ "integrityRequirement": {
1218+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaRequirementType"
1219+ },
1220+ "availabilityRequirement": {
1221+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/ciaRequirementType"
1222+ },
1223+ "modifiedAttackVector": {
1224+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedAttackVectorType"
1225+ },
1226+ "modifiedAttackComplexity": {
1227+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedAttackComplexityType"
1228+ },
1229+ "modifiedPrivilegesRequired": {
1230+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedPrivilegesRequiredType"
1231+ },
1232+ "modifiedUserInteraction": {
1233+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedUserInteractionType"
1234+ },
1235+ "modifiedScope": {
1236+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedScopeType"
1237+ },
1238+ "modifiedConfidentialityImpact": {
1239+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedCiaType"
1240+ },
1241+ "modifiedIntegrityImpact": {
1242+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedCiaType"
1243+ },
1244+ "modifiedAvailabilityImpact": {
1245+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/modifiedCiaType"
1246+ },
1247+ "environmentalScore": {
1248+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/scoreType"
1249+ },
1250+ "environmentalSeverity": {
1251+ "$ref": "#/definitions/metrics/items/properties/cvssV3_1/definitions/severityType"
1252+ }
1253+ },
1254+ "required": [
1255+ "version",
1256+ "vectorString",
1257+ "baseScore",
1258+ "baseSeverity"
1259+ ]
1260+ },
1261+ "cvssV3_0": {
1262+ "$schema": "http://json-schema.org/draft-04/schema#",
1263+ "title": "JSON Schema for Common Vulnerability Scoring System version 3.0",
1264+ "type": "object",
1265+ "definitions": {
1266+ "attackVectorType": {
1267+ "type": "string",
1268+ "enum": [
1269+ "NETWORK",
1270+ "ADJACENT_NETWORK",
1271+ "LOCAL",
1272+ "PHYSICAL"
1273+ ]
1274+ },
1275+ "modifiedAttackVectorType": {
1276+ "type": "string",
1277+ "enum": [
1278+ "NETWORK",
1279+ "ADJACENT_NETWORK",
1280+ "LOCAL",
1281+ "PHYSICAL",
1282+ "NOT_DEFINED"
1283+ ]
1284+ },
1285+ "attackComplexityType": {
1286+ "type": "string",
1287+ "enum": [
1288+ "HIGH",
1289+ "LOW"
1290+ ]
1291+ },
1292+ "modifiedAttackComplexityType": {
1293+ "type": "string",
1294+ "enum": [
1295+ "HIGH",
1296+ "LOW",
1297+ "NOT_DEFINED"
1298+ ]
1299+ },
1300+ "privilegesRequiredType": {
1301+ "type": "string",
1302+ "enum": [
1303+ "HIGH",
1304+ "LOW",
1305+ "NONE"
1306+ ]
1307+ },
1308+ "modifiedPrivilegesRequiredType": {
1309+ "type": "string",
1310+ "enum": [
1311+ "HIGH",
1312+ "LOW",
1313+ "NONE",
1314+ "NOT_DEFINED"
1315+ ]
1316+ },
1317+ "userInteractionType": {
1318+ "type": "string",
1319+ "enum": [
1320+ "NONE",
1321+ "REQUIRED"
1322+ ]
1323+ },
1324+ "modifiedUserInteractionType": {
1325+ "type": "string",
1326+ "enum": [
1327+ "NONE",
1328+ "REQUIRED",
1329+ "NOT_DEFINED"
1330+ ]
1331+ },
1332+ "scopeType": {
1333+ "type": "string",
1334+ "enum": [
1335+ "UNCHANGED",
1336+ "CHANGED"
1337+ ]
1338+ },
1339+ "modifiedScopeType": {
1340+ "type": "string",
1341+ "enum": [
1342+ "UNCHANGED",
1343+ "CHANGED",
1344+ "NOT_DEFINED"
1345+ ]
1346+ },
1347+ "ciaType": {
1348+ "type": "string",
1349+ "enum": [
1350+ "NONE",
1351+ "LOW",
1352+ "HIGH"
1353+ ]
1354+ },
1355+ "modifiedCiaType": {
1356+ "type": "string",
1357+ "enum": [
1358+ "NONE",
1359+ "LOW",
1360+ "HIGH",
1361+ "NOT_DEFINED"
1362+ ]
1363+ },
1364+ "exploitCodeMaturityType": {
1365+ "type": "string",
1366+ "enum": [
1367+ "UNPROVEN",
1368+ "PROOF_OF_CONCEPT",
1369+ "FUNCTIONAL",
1370+ "HIGH",
1371+ "NOT_DEFINED"
1372+ ]
1373+ },
1374+ "remediationLevelType": {
1375+ "type": "string",
1376+ "enum": [
1377+ "OFFICIAL_FIX",
1378+ "TEMPORARY_FIX",
1379+ "WORKAROUND",
1380+ "UNAVAILABLE",
1381+ "NOT_DEFINED"
1382+ ]
1383+ },
1384+ "confidenceType": {
1385+ "type": "string",
1386+ "enum": [
1387+ "UNKNOWN",
1388+ "REASONABLE",
1389+ "CONFIRMED",
1390+ "NOT_DEFINED"
1391+ ]
1392+ },
1393+ "ciaRequirementType": {
1394+ "type": "string",
1395+ "enum": [
1396+ "LOW",
1397+ "MEDIUM",
1398+ "HIGH",
1399+ "NOT_DEFINED"
1400+ ]
1401+ },
1402+ "scoreType": {
1403+ "type": "number",
1404+ "minimum": 0,
1405+ "maximum": 10
1406+ },
1407+ "severityType": {
1408+ "type": "string",
1409+ "enum": [
1410+ "NONE",
1411+ "LOW",
1412+ "MEDIUM",
1413+ "HIGH",
1414+ "CRITICAL"
1415+ ]
1416+ }
1417+ },
1418+ "properties": {
1419+ "version": {
1420+ "description": "CVSS Version",
1421+ "type": "string",
1422+ "enum": [
1423+ "3.0"
1424+ ]
1425+ },
1426+ "vectorString": {
1427+ "type": "string",
1428+ "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])$"
1429+ },
1430+ "attackVector": {
1431+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/attackVectorType"
1432+ },
1433+ "attackComplexity": {
1434+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/attackComplexityType"
1435+ },
1436+ "privilegesRequired": {
1437+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/privilegesRequiredType"
1438+ },
1439+ "userInteraction": {
1440+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/userInteractionType"
1441+ },
1442+ "scope": {
1443+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/scopeType"
1444+ },
1445+ "confidentialityImpact": {
1446+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaType"
1447+ },
1448+ "integrityImpact": {
1449+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaType"
1450+ },
1451+ "availabilityImpact": {
1452+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaType"
1453+ },
1454+ "baseScore": {
1455+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/scoreType"
1456+ },
1457+ "baseSeverity": {
1458+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/severityType"
1459+ },
1460+ "exploitCodeMaturity": {
1461+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/exploitCodeMaturityType"
1462+ },
1463+ "remediationLevel": {
1464+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/remediationLevelType"
1465+ },
1466+ "reportConfidence": {
1467+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/confidenceType"
1468+ },
1469+ "temporalScore": {
1470+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/scoreType"
1471+ },
1472+ "temporalSeverity": {
1473+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/severityType"
1474+ },
1475+ "confidentialityRequirement": {
1476+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaRequirementType"
1477+ },
1478+ "integrityRequirement": {
1479+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaRequirementType"
1480+ },
1481+ "availabilityRequirement": {
1482+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/ciaRequirementType"
1483+ },
1484+ "modifiedAttackVector": {
1485+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedAttackVectorType"
1486+ },
1487+ "modifiedAttackComplexity": {
1488+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedAttackComplexityType"
1489+ },
1490+ "modifiedPrivilegesRequired": {
1491+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedPrivilegesRequiredType"
1492+ },
1493+ "modifiedUserInteraction": {
1494+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedUserInteractionType"
1495+ },
1496+ "modifiedScope": {
1497+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedScopeType"
1498+ },
1499+ "modifiedConfidentialityImpact": {
1500+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedCiaType"
1501+ },
1502+ "modifiedIntegrityImpact": {
1503+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedCiaType"
1504+ },
1505+ "modifiedAvailabilityImpact": {
1506+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/modifiedCiaType"
1507+ },
1508+ "environmentalScore": {
1509+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/scoreType"
1510+ },
1511+ "environmentalSeverity": {
1512+ "$ref": "#/definitions/metrics/items/properties/cvssV3_0/definitions/severityType"
1513+ }
1514+ },
1515+ "required": [
1516+ "version",
1517+ "vectorString",
1518+ "baseScore",
1519+ "baseSeverity"
1520+ ]
1521+ },
1522+ "cvssV2_0": {
1523+ "$schema": "http://json-schema.org/draft-04/schema#",
1524+ "title": "JSON Schema for Common Vulnerability Scoring System version 2.0",
1525+ "type": "object",
1526+ "definitions": {
1527+ "accessVectorType": {
1528+ "type": "string",
1529+ "enum": [
1530+ "NETWORK",
1531+ "ADJACENT_NETWORK",
1532+ "LOCAL"
1533+ ]
1534+ },
1535+ "accessComplexityType": {
1536+ "type": "string",
1537+ "enum": [
1538+ "HIGH",
1539+ "MEDIUM",
1540+ "LOW"
1541+ ]
1542+ },
1543+ "authenticationType": {
1544+ "type": "string",
1545+ "enum": [
1546+ "MULTIPLE",
1547+ "SINGLE",
1548+ "NONE"
1549+ ]
1550+ },
1551+ "ciaType": {
1552+ "type": "string",
1553+ "enum": [
1554+ "NONE",
1555+ "PARTIAL",
1556+ "COMPLETE"
1557+ ]
1558+ },
1559+ "exploitabilityType": {
1560+ "type": "string",
1561+ "enum": [
1562+ "UNPROVEN",
1563+ "PROOF_OF_CONCEPT",
1564+ "FUNCTIONAL",
1565+ "HIGH",
1566+ "NOT_DEFINED"
1567+ ]
1568+ },
1569+ "remediationLevelType": {
1570+ "type": "string",
1571+ "enum": [
1572+ "OFFICIAL_FIX",
1573+ "TEMPORARY_FIX",
1574+ "WORKAROUND",
1575+ "UNAVAILABLE",
1576+ "NOT_DEFINED"
1577+ ]
1578+ },
1579+ "reportConfidenceType": {
1580+ "type": "string",
1581+ "enum": [
1582+ "UNCONFIRMED",
1583+ "UNCORROBORATED",
1584+ "CONFIRMED",
1585+ "NOT_DEFINED"
1586+ ]
1587+ },
1588+ "collateralDamagePotentialType": {
1589+ "type": "string",
1590+ "enum": [
1591+ "NONE",
1592+ "LOW",
1593+ "LOW_MEDIUM",
1594+ "MEDIUM_HIGH",
1595+ "HIGH",
1596+ "NOT_DEFINED"
1597+ ]
1598+ },
1599+ "targetDistributionType": {
1600+ "type": "string",
1601+ "enum": [
1602+ "NONE",
1603+ "LOW",
1604+ "MEDIUM",
1605+ "HIGH",
1606+ "NOT_DEFINED"
1607+ ]
1608+ },
1609+ "ciaRequirementType": {
1610+ "type": "string",
1611+ "enum": [
1612+ "LOW",
1613+ "MEDIUM",
1614+ "HIGH",
1615+ "NOT_DEFINED"
1616+ ]
1617+ },
1618+ "scoreType": {
1619+ "type": "number",
1620+ "minimum": 0,
1621+ "maximum": 10
1622+ }
1623+ },
1624+ "properties": {
1625+ "version": {
1626+ "description": "CVSS Version",
1627+ "type": "string",
1628+ "enum": [
1629+ "2.0"
1630+ ]
1631+ },
1632+ "vectorString": {
1633+ "type": "string",
1634+ "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))$"
1635+ },
1636+ "accessVector": {
1637+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/accessVectorType"
1638+ },
1639+ "accessComplexity": {
1640+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/accessComplexityType"
1641+ },
1642+ "authentication": {
1643+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/authenticationType"
1644+ },
1645+ "confidentialityImpact": {
1646+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaType"
1647+ },
1648+ "integrityImpact": {
1649+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaType"
1650+ },
1651+ "availabilityImpact": {
1652+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaType"
1653+ },
1654+ "baseScore": {
1655+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/scoreType"
1656+ },
1657+ "exploitability": {
1658+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/exploitabilityType"
1659+ },
1660+ "remediationLevel": {
1661+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/remediationLevelType"
1662+ },
1663+ "reportConfidence": {
1664+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/reportConfidenceType"
1665+ },
1666+ "temporalScore": {
1667+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/scoreType"
1668+ },
1669+ "collateralDamagePotential": {
1670+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/collateralDamagePotentialType"
1671+ },
1672+ "targetDistribution": {
1673+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/targetDistributionType"
1674+ },
1675+ "confidentialityRequirement": {
1676+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaRequirementType"
1677+ },
1678+ "integrityRequirement": {
1679+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaRequirementType"
1680+ },
1681+ "availabilityRequirement": {
1682+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/ciaRequirementType"
1683+ },
1684+ "environmentalScore": {
1685+ "$ref": "#/definitions/metrics/items/properties/cvssV2_0/definitions/scoreType"
1686+ }
1687+ },
1688+ "required": [
1689+ "version",
1690+ "vectorString",
1691+ "baseScore"
1692+ ]
1693+ },
1694+ "other": {
1695+ "type": "object",
1696+ "description": "A non-standard impact description, may be prose or JSON block.",
1697+ "required": [
1698+ "type",
1699+ "content"
1700+ ],
1701+ "properties": {
1702+ "type": {
1703+ "description": "Name of the non-standard impact metrics format used.",
1704+ "type": "string",
1705+ "minLength": 1,
1706+ "maxLength": 128
1707+ },
1708+ "content": {
1709+ "type": "object",
1710+ "description": "JSON object not covered by another metrics format.",
1711+ "minProperties": 1
1712+ }
1713+ }
1714+ }
1715+ }
1716+ }
1717+ },
1718+ "configurations": {
1719+ "type": "array",
1720+ "description": "Configurations required for exploiting this vulnerability.",
1721+ "minItems": 1,
1722+ "uniqueItems": true,
1723+ "items": {
1724+ "$ref": "#/definitions/description"
1725+ }
1726+ },
1727+ "workarounds": {
1728+ "type": "array",
1729+ "description": "Workarounds and mitigations for this vulnerability.",
1730+ "minItems": 1,
1731+ "uniqueItems": true,
1732+ "items": {
1733+ "$ref": "#/definitions/description"
1734+ }
1735+ },
1736+ "solutions": {
1737+ "type": "array",
1738+ "description": "Information about solutions or remediations available for this vulnerability.",
1739+ "minItems": 1,
1740+ "uniqueItems": true,
1741+ "items": {
1742+ "$ref": "#/definitions/description"
1743+ }
1744+ },
1745+ "exploits": {
1746+ "type": "array",
1747+ "description": "Information about exploits of the vulnerability.",
1748+ "minItems": 1,
1749+ "uniqueItems": true,
1750+ "items": {
1751+ "$ref": "#/definitions/description"
1752+ }
1753+ },
1754+ "timeline": {
1755+ "type": "array",
1756+ "description": "This is timeline information for significant events about this vulnerability or changes to the CVE Record.",
1757+ "minItems": 1,
1758+ "uniqueItems": true,
1759+ "items": {
1760+ "type": "object",
1761+ "required": [
1762+ "time",
1763+ "lang",
1764+ "value"
1765+ ],
1766+ "properties": {
1767+ "time": {
1768+ "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.",
1769+ "$ref": "#/definitions/timestamp"
1770+ },
1771+ "lang": {
1772+ "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.",
1773+ "$ref": "#/definitions/language"
1774+ },
1775+ "value": {
1776+ "description": "A summary of the event.",
1777+ "type": "string",
1778+ "minLength": 1,
1779+ "maxLength": 4096
1780+ }
1781+ }
1782+ }
1783+ },
1784+ "credits": {
1785+ "type": "array",
1786+ "description": "Statements acknowledging specific people, organizations, or tools recognizing the work done in researching, discovering, remediating or helping with activities related to this CVE.",
1787+ "minItems": 1,
1788+ "uniqueItems": true,
1789+ "items": {
1790+ "type": "object",
1791+ "properties": {
1792+ "lang": {
1793+ "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.",
1794+ "$ref": "#/definitions/language"
1795+ },
1796+ "value": {
1797+ "type": "string",
1798+ "minLength": 1,
1799+ "maxLength": 4096
1800+ },
1801+ "user": {
1802+ "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.",
1803+ "$ref": "#/definitions/uuidType"
1804+ },
1805+ "type": {
1806+ "type": "string",
1807+ "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.",
1808+ "default": "finder",
1809+ "enum": [
1810+ "finder",
1811+ "reporter",
1812+ "analyst",
1813+ "coordinator",
1814+ "remediation developer",
1815+ "remediation reviewer",
1816+ "remediation verifier",
1817+ "tool",
1818+ "sponsor",
1819+ "other"
1820+ ]
1821+ }
1822+ },
1823+ "required": [
1824+ "lang",
1825+ "value"
1826+ ]
1827+ }
1828+ },
1829+ "source": {
1830+ "type": "object",
1831+ "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.",
1832+ "minProperties": 1
1833+ },
1834+ "language": {
1835+ "type": "string",
1836+ "description": "BCP 47 language code, language-region.",
1837+ "default": "en",
1838+ "pattern": "^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$"
1839+ },
1840+ "englishLanguage": {
1841+ "type": "string",
1842+ "description": "BCP 47 language code, language-region, required to be English.",
1843+ "pattern": "^en([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$"
1844+ },
1845+ "taxonomyMappings": {
1846+ "type": "array",
1847+ "description": "List of taxonomy items related to the vulnerability.",
1848+ "minItems": 1,
1849+ "uniqueItems": true,
1850+ "items": {
1851+ "type": "object",
1852+ "description": "",
1853+ "required": [
1854+ "taxonomyName",
1855+ "taxonomyRelations"
1856+ ],
1857+ "properties": {
1858+ "taxonomyName": {
1859+ "type": "string",
1860+ "description": "The name of the taxonomy.",
1861+ "minLength": 1,
1862+ "maxLength": 128
1863+ },
1864+ "taxonomyVersion": {
1865+ "type": "string",
1866+ "description": "The version of taxonomy the identifiers come from.",
1867+ "minLength": 1,
1868+ "maxLength": 128
1869+ },
1870+ "taxonomyRelations": {
1871+ "type": "array",
1872+ "description": "",
1873+ "minItems": 1,
1874+ "uniqueItems": true,
1875+ "items": {
1876+ "type": "object",
1877+ "description": "List of relationships to the taxonomy for the vulnerability. Relationships can be between the taxonomy and the CVE or two taxonomy items.",
1878+ "required": [
1879+ "taxonomyId",
1880+ "relationshipName",
1881+ "relationshipValue"
1882+ ],
1883+ "properties": {
1884+ "taxonomyId": {
1885+ "type": "string",
1886+ "description": "Identifier of the item in the taxonomy. Used as the subject of the relationship.",
1887+ "minLength": 1,
1888+ "maxLength": 2048
1889+ },
1890+ "relationshipName": {
1891+ "type": "string",
1892+ "description": "A description of the relationship.",
1893+ "minLength": 1,
1894+ "maxLength": 128
1895+ },
1896+ "relationshipValue": {
1897+ "type": "string",
1898+ "description": "The target of the relationship. Can be the CVE ID or another taxonomy identifier.",
1899+ "minLength": 1,
1900+ "maxLength": 2048
1901+ }
1902+ }
1903+ }
1904+ }
1905+ }
1906+ }
1907+ },
1908+ "tagExtension": {
1909+ "type": "string",
1910+ "minLength": 2,
1911+ "maxLength": 128,
1912+ "pattern": "^x_.*$"
1913+ },
1914+ "cnaTags": {
1915+ "type": "array",
1916+ "description": "Tags provided by a CNA describing the CVE Record.",
1917+ "uniqueItems": true,
1918+ "minItems": 1,
1919+ "items": {
1920+ "oneOf": [
1921+ {
1922+ "$ref": "#/definitions/tagExtension"
1923+ },
1924+ {
1925+ "$schema": "http://json-schema.org/draft-07/schema#",
1926+ "$id": "https://cve.mitre.org/cve/v5_00/tags/cna/",
1927+ "type": "string",
1928+ "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'.",
1929+ "enum": [
1930+ "unsupported-when-assigned",
1931+ "exclusively-hosted-service",
1932+ "disputed"
1933+ ]
1934+ }
1935+ ]
1936+ }
1937+ },
1938+ "adpTags": {
1939+ "type": "array",
1940+ "description": "Tags provided by an ADP describing the CVE Record.",
1941+ "uniqueItems": true,
1942+ "minItems": 1,
1943+ "items": {
1944+ "oneOf": [
1945+ {
1946+ "$ref": "#/definitions/tagExtension"
1947+ },
1948+ {
1949+ "$schema": "http://json-schema.org/draft-07/schema#",
1950+ "$id": "https://cve.mitre.org/cve/v5_00/tags/adp/",
1951+ "type": "string",
1952+ "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'.",
1953+ "enum": [
1954+ "disputed"
1955+ ]
1956+ }
1957+ ]
1958+ }
1959+ }
1960+ },
1961+ "oneOf": [
1962+ {
1963+ "title": "Published",
1964+ "description": "When a CNA populates the data associated with a CVE ID as a CVE Record, the state of the CVE Record is Published.",
1965+ "properties": {
1966+ "dataType": {
1967+ "$ref": "#/definitions/dataType"
1968+ },
1969+ "dataVersion": {
1970+ "$ref": "#/definitions/dataVersion"
1971+ },
1972+ "cveMetadata": {
1973+ "$ref": "#/definitions/cveMetadataPublished"
1974+ },
1975+ "containers": {
1976+ "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.",
1977+ "type": "object",
1978+ "properties": {
1979+ "cna": {
1980+ "$ref": "#/definitions/cnaPublishedContainer"
1981+ },
1982+ "adp": {
1983+ "type": "array",
1984+ "items": {
1985+ "$ref": "#/definitions/adpContainer"
1986+ },
1987+ "minItems": 1,
1988+ "uniqueItems": true
1989+ }
1990+ },
1991+ "required": [
1992+ "cna"
1993+ ],
1994+ "additionalProperties": false
1995+ }
1996+ },
1997+ "required": [
1998+ "dataType",
1999+ "dataVersion",
2000+ "cveMetadata",
2001+ "containers"
2002+ ],
2003+ "additionalProperties": false
2004+ },
2005+ {
2006+ "title": "Rejected",
2007+ "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.",
2008+ "properties": {
2009+ "dataType": {
2010+ "$ref": "#/definitions/dataType"
2011+ },
2012+ "dataVersion": {
2013+ "$ref": "#/definitions/dataVersion"
2014+ },
2015+ "cveMetadata": {
2016+ "$ref": "#/definitions/cveMetadataRejected"
2017+ },
2018+ "containers": {
2019+ "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.",
2020+ "type": "object",
2021+ "properties": {
2022+ "cna": {
2023+ "$ref": "#/definitions/cnaRejectedContainer"
2024+ }
2025+ },
2026+ "required": [
2027+ "cna"
2028+ ],
2029+ "additionalProperties": false
2030+ }
2031+ },
2032+ "required": [
2033+ "dataType",
2034+ "dataVersion",
2035+ "cveMetadata",
2036+ "containers"
2037+ ],
2038+ "additionalProperties": false
2039+ }
2040+ ]
2041+}
2042diff --git a/scripts/cve_json5_verify.py b/scripts/cve_json5_verify.py
2043new file mode 100755
2044index 0000000..d92669a
2045--- /dev/null
2046+++ b/scripts/cve_json5_verify.py
2047@@ -0,0 +1,186 @@
2048+#!/usr/bin/env python3
2049+
2050+"""
2051+verify the schema of a cve-json5 and cve-json5-api files
2052+set --debug to check cve-json5-api before CNA publication
2053+
2054+$ ./scripts/cve_verify_json5.py $PATH_TO_JSON
2055+
2056+nb: a cve-json5-api file is a subset of cve-json5 and
2057+ required to interact with the API for CNAs
2058+
2059+Copyright 2023, Canonical Ltd.
2060+Author: Mark Esler <mark.esler@canonical.com>
2061+"""
2062+
2063+
2064+import argparse
2065+import inspect
2066+import json
2067+import pathlib
2068+import sys
2069+from typing import Tuple
2070+
2071+import jsonschema
2072+
2073+
2074+def debug(msg: str) -> None:
2075+ """print to stderr"""
2076+ print("DEBUG: " + msg, file=sys.stderr)
2077+
2078+
2079+def load_json(path: pathlib.Path) -> dict:
2080+ """loads generic ascii json files"""
2081+ # NOTE: all files *should* be ascii encoding
2082+ # https://github.com/CVEProject/cvelistV5/issues/25
2083+ # pylint: disable=unspecified-encoding
2084+ with open(path) as j:
2085+ data = json.load(j)
2086+ return data
2087+
2088+
2089+def load_schema(path: pathlib.Path) -> Tuple[dict, dict]:
2090+ """returns json schemas"""
2091+ json5_schema = load_json(path)
2092+ json5_schema_cna = json5_schema["definitions"]["cnaPublishedContainer"]["properties"]
2093+ return json5_schema, json5_schema_cna
2094+
2095+
2096+def debug_cve_json5_api_affected() -> bool:
2097+ """
2098+ tests cve["affected"] for CVE Project requirements
2099+
2100+ debug relies on inspect.trace to write messages
2101+ if a "pointless-statement" fails, trace prints
2102+
2103+ function returns True or False depending if API compliant
2104+ """
2105+ passed = True
2106+ try:
2107+ # check if set
2108+ # pylint: disable=pointless-statement
2109+ cve["affected"]
2110+ # check if set but false
2111+ if not cve["affected"]:
2112+ debug('cve["affected"] is empty')
2113+ raise ValueError
2114+ try:
2115+ # in case of multiple packages, check each package
2116+ # first check is cve["affected"][0]["versions"][0]["status"]
2117+ for i in cve["affected"]:
2118+ if not i["versions"]:
2119+ debug('cve["affected"]{["versions"]} is empty')
2120+ raise ValueError
2121+ try:
2122+ for j in i["versions"]:
2123+ # pylint: disable=pointless-statement
2124+ j["status"]
2125+ # pylint: disable=bare-except
2126+ except:
2127+ passed = False
2128+ debug('cve["affected"]{["versions"]{["status"}} is missing:')
2129+ debug(str(inspect.trace()[-1][0].f_locals["j"]))
2130+ # pylint: disable=bare-except
2131+ except:
2132+ passed = False
2133+ debug(f'cve["affected"]{["versions"]} information is missing:')
2134+ debug(str(inspect.trace()[-1][0].f_locals["i"]))
2135+ # pylint: disable=bare-except
2136+ except:
2137+ passed = False
2138+ debug('cve["affected"] does not exist or is empty')
2139+ return passed
2140+
2141+
2142+def debug_cve_json5_api_metrics() -> None:
2143+ """
2144+ tests cve["metrics"] for CVE Project requirements
2145+
2146+ debug relies on inspect.trace to write messages
2147+ if a "pointless-statement" fails, trace prints
2148+
2149+ function returns True or False depending if API compliant
2150+ """
2151+ passed = True
2152+ try:
2153+ # pylint: disable=pointless-statement
2154+ cve["metrics"]
2155+ if not cve["metrics"]:
2156+ debug('cve["metrics"] is empty')
2157+ raise ValueError
2158+ try:
2159+ for i in cve["metrics"]:
2160+ if not i["cvssV3_1"]["vectorString"]:
2161+ debug('cve["metrics"]{["cvssV3_1"]["vectorString"]} is empty')
2162+ raise ValueError
2163+ # pylint: disable=bare-except
2164+ except:
2165+ passed = False
2166+ debug('cve["metrics"]{["cssV3_1"]["vectorString"]} information is missing:')
2167+ debug(str(inspect.trace()[-1][0].f_locals["i"]))
2168+ # pylint: disable=bare-except
2169+ except:
2170+ passed = False
2171+ debug('cve["metrics"] does not exist or is empty')
2172+ return passed
2173+
2174+
2175+def debug_cve_json5_api() -> bool:
2176+ """tests fields which the CVE Project requires"""
2177+ return debug_cve_json5_api_affected() and debug_cve_json5_api_metrics
2178+
2179+
2180+def verify_cve_json5() -> bool:
2181+ """verify cve-json5"""
2182+ return jsonschema.Draft7Validator(schema).is_valid(cve)
2183+
2184+
2185+def verify_cve_json5_api() -> bool:
2186+ """
2187+ verify cve-json5-api and optionally check for publication
2188+
2189+ --debug is required to check API compiance
2190+ """
2191+ if jsonschema.Draft7Validator(schema_cna).is_valid(cve):
2192+ if DEBUG:
2193+ #NOTE: a cve_json5_api file can have a valid syntax, but not be
2194+ # ready for publication if information is missing
2195+ if debug_cve_json5_api():
2196+ debug("ready for CNA publication")
2197+ else:
2198+ debug("not ready for CNA publication")
2199+ # note: the json5 can be valid, but not API compliant
2200+ # --debug required for API compliance
2201+ return True
2202+ return False
2203+
2204+
2205+def verify() -> None:
2206+ """check if file is a valid cve-json5 type"""
2207+ if verify_cve_json5():
2208+ if DEBUG:
2209+ debug(f"{cve_file} is a valid cve-json5 file")
2210+ sys.exit(0)
2211+ elif verify_cve_json5_api():
2212+ if DEBUG:
2213+ debug(f"{cve_file} is a valid cve-json5-api file")
2214+ sys.exit(0)
2215+ else:
2216+ raise TypeError(f"{cve_file} is NOT a valid cve-json5 or cve-json5-api file")
2217+ sys.exit(1)
2218+
2219+
2220+if __name__ == "__main__":
2221+ parser = argparse.ArgumentParser(description="cve-verify")
2222+ parser.add_argument("cve_json5_paths", nargs="+", type=pathlib.Path)
2223+ parser.add_argument("--debug", help="add debug info, required for API check", action="store_true")
2224+ cve_files = parser.parse_args().cve_json5_paths
2225+ DEBUG = parser.parse_args().debug
2226+
2227+ uct_path = pathlib.Path(__file__).resolve().parent.parent
2228+ schema_path = uct_path.joinpath("./scripts/cve-json5-schema.json")
2229+ schema, schema_cna = load_schema(schema_path)
2230+
2231+ for cve_file in cve_files:
2232+ cve = load_json(cve_file)
2233+ verify()

Subscribers

People subscribed via source and target branches