Skip to content

Commit c8638e2

Browse files
authored
Merge pull request #99 from rsc/computable-packages
schema/v5.0: flatten affected into array of products
2 parents b419086 + 3208d6d commit c8638e2

File tree

1 file changed

+92
-99
lines changed

1 file changed

+92
-99
lines changed

schema/v5.0/CVE_JSON_5.0.schema

Lines changed: 92 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -81,56 +81,32 @@
8181
"product": {
8282
"type": "object",
8383
"description": "Provides information about the set of products and services affected by this vulnerability.",
84-
"required": [
85-
"productName",
86-
"versions"
84+
"allOf": [
85+
{
86+
"oneOf": [
87+
{"required": ["vendor", "product"]},
88+
{"required": ["collectionURL", "packageName"]}
89+
]
90+
},
91+
{
92+
"required": ["versions"]
93+
}
8794
],
8895
"properties": {
89-
"productName": {
96+
"vendor": {
9097
"type": "string",
91-
"description": "Name of the affected product.",
98+
"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.",
9299
"minLength": 1,
93-
"maxLength": 2058
94-
},
95-
"modules": {
96-
"type": "array",
97-
"description": "A list of the affected components, features, modules, sub-components, sub-products, APIs, commands, utilities, programs, or functionalities (optional)",
98-
"uniqueItems": true,
99-
"items": {
100-
"type": "string",
101-
"description": "Name of the affected component, feature, module, sub-component, sub-product, API, command, utility, program, or functionality (optional).",
102-
"minLength": 1,
103-
"maxLength": 4000
104-
}
105-
},
106-
"programFiles": {
107-
"type": "array",
108-
"description": "A list of the affected source code files (optional)",
109-
"uniqueItems": true,
110-
"items": {
111-
"description": "Name or path or location of the affected source code file in RFC3986 compliant format (optional).",
112-
"$ref": "#/definitions/uriType"
113-
}
114-
},
115-
"programRoutines": {
116-
"type": "array",
117-
"description": "A list of the affected source code functions, methods, subroutines, or procedures (optional).",
118-
"uniqueItems": true,
119-
"items": {
120-
"type": "string",
121-
"description": "Name of the affected source code file, function, method, subroutine, or procedure (optional).",
122-
"minLength": 1,
123-
"maxLength": 4000
124-
}
100+
"maxLength": 512
125101
},
126-
"packageName": {
102+
"product": {
127103
"type": "string",
128-
"description": "Name or identifier of the affected software package as used in the package collection (optional).",
104+
"description": "Name of the affected product.",
129105
"minLength": 1,
130106
"maxLength": 2058
131-
},
107+
},
132108
"collectionURL": {
133-
"description": "A URL that, among the users of the software package collection, is considered the most popular starting point for accessing the collection (optional).",
109+
"description": "URL identifying a package collection (determines meaning of packageName).",
134110
"$ref": "#/definitions/uriType",
135111
"examples": [
136112
"https://access.redhat.com/downloads/content/package-browser",
@@ -198,6 +174,77 @@
198174
"https://wordpress.org/plugins"
199175
]
200176
},
177+
"packageName": {
178+
"type": "string",
179+
"description": "Name or identifier of the affected software package as used in the package collection.",
180+
"minLength": 1,
181+
"maxLength": 2058
182+
},
183+
"cpes": {
184+
"type": "array",
185+
"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.",
186+
"uniqueItems": true,
187+
"items": {
188+
"title": "CPE Name",
189+
"type": "string",
190+
"description":"Common Platform Enumeration (CPE) Name in either 2.2 or 2.3 format",
191+
"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})",
192+
"minLength": 1,
193+
"maxLength": 2000
194+
}
195+
},
196+
"modules": {
197+
"type": "array",
198+
"description": "A list of the affected components, features, modules, sub-components, sub-products, APIs, commands, utilities, programs, or functionalities (optional)",
199+
"uniqueItems": true,
200+
"items": {
201+
"type": "string",
202+
"description": "Name of the affected component, feature, module, sub-component, sub-product, API, command, utility, program, or functionality (optional).",
203+
"minLength": 1,
204+
"maxLength": 4000
205+
}
206+
},
207+
"programFiles": {
208+
"type": "array",
209+
"description": "A list of the affected source code files (optional)",
210+
"uniqueItems": true,
211+
"items": {
212+
"description": "Name or path or location of the affected source code file in RFC3986 compliant format (optional).",
213+
"$ref": "#/definitions/uriType"
214+
}
215+
},
216+
"programRoutines": {
217+
"type": "array",
218+
"description": "A list of the affected source code functions, methods, subroutines, or procedures (optional).",
219+
"uniqueItems": true,
220+
"items": {
221+
"type": "object",
222+
"description": "Object describing program routine.",
223+
"required": [
224+
"name"
225+
],
226+
"properties": {
227+
"name": {
228+
"type": "string",
229+
"description": "Name of the affected source code file, function, method, subroutine, or procedure.",
230+
"minLength": 1,
231+
"maxLength": 4000
232+
}
233+
}
234+
}
235+
},
236+
"platforms": {
237+
"title": "Platforms",
238+
"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 technolgies, hardware models, or computing architectures. Lack of this field or an empty array implies that the other fields are applicable for all relevant platforms.",
239+
"type": "array",
240+
"minItems": 1,
241+
"uniqueItems": true,
242+
"items": {
243+
"type": "string",
244+
"examples": ["iOS", "Android", "Windows", "macOS", "x86", "ARM", "64 bit", "Big Endian", "iPad", "Chromebook", "Docker"],
245+
"maxLength": 1024
246+
}
247+
},
201248
"versions": {
202249
"type": "array",
203250
"description": "Set of product versions 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).",
@@ -241,18 +288,6 @@
241288
"?>="
242289
]
243290
},
244-
"platforms": {
245-
"title": "Platforms",
246-
"description": "List of specific platforms if the versionValue and versionAffected are only relevant in the context of these platforms (optional). Platforms may include execution environments, operating systems, virtualization technolgies, hardware models, or computing architectures. Lack of this field or an empty array implies that the other fields are applicable for all relevant platforms.",
247-
"type": "array",
248-
"minItems": 1,
249-
"uniqueItems": true,
250-
"items": {
251-
"type": "string",
252-
"examples": ["iOS", "Android", "Windows", "macOS", "x86", "ARM", "64 bit", "Big Endian", "iPad", "Chromebook", "Docker"],
253-
"maxLength": 1024
254-
}
255-
},
256291
"references": {
257292
"$ref": "#/definitions/references"
258293
}
@@ -592,52 +627,10 @@
592627
"additionalProperties": false
593628
},
594629
"affected": {
595-
"type": "object",
596-
"description": "CVE affects, there must be at least one defined vulnerable product either in the form of a text description (via data defined in vendors, product, version) OR a affectsCpe.",
597-
"minProperties": 1,
598-
"properties": {
599-
"vendors": {
600-
"type": "array",
601-
"description": "This is the container for affected vendors, it only goes in the affects container.",
602-
"minItems": 1,
603-
"uniqueItems": true,
604-
"items": {
605-
"type": "object",
606-
"description": "a vendor that ships vulnerable product(s) and the associated vulnerable product(s) information.",
607-
"required": [
608-
"vendorName",
609-
"products"
610-
],
611-
"properties": {
612-
"vendorName": {
613-
"type": "string",
614-
"description": "name of the organization, project, community, or individual that created or maintains this product or hosted service.",
615-
"minLength": 1,
616-
"maxLength": 512
617-
},
618-
"products": {
619-
"description": "This is the container for affected technologies, products, hardware, etc.",
620-
"type": "array",
621-
"minItems": 1,
622-
"uniqueItems": true,
623-
"items": {"$ref": "#/definitions/product"}
624-
}
625-
}
626-
}
627-
},
628-
"affectsCpes": {
629-
"type": "array",
630-
"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.",
631-
"minItems": 1,
632-
"uniqueItems": true,
633-
"items": {
634-
"type": "object",
635-
"properties": {},
636-
"minProperties": 1
637-
}
638-
}
639-
},
640-
"additionalProperties": false
630+
"type": "array",
631+
"description": "List of affected products.",
632+
"minItems": 1,
633+
"items": {"$ref": "#/definitions/product"}
641634
},
642635
"description": {
643636
"type": "object",

0 commit comments

Comments
 (0)