Skip to content

Commit 9419f8c

Browse files
authored
Merge pull request #356 from ccoffin/feature-322-cpeApplicability
Feature 322 cpe applicability
2 parents b5be6d9 + 50dae0b commit 9419f8c

2 files changed

Lines changed: 156 additions & 9 deletions

File tree

schema/CVE_Record_Format.json

Lines changed: 109 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@
5353
"type": "string",
5454
"pattern": "^CVE-[0-9]{4}-[0-9]{4,19}$"
5555
},
56+
"cpe22and23": {
57+
"type": "string",
58+
"description":"Common Platform Enumeration (CPE) Name in either 2.2 or 2.3 format",
59+
"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})",
60+
"minLength": 1,
61+
"maxLength": 2048
62+
},
63+
"cpe23": {
64+
"type": "string",
65+
"description":"Common Platform Enumeration (CPE) Name in 2.3 format",
66+
"pattern": "(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})",
67+
"minLength": 1,
68+
"maxLength": 2048
69+
},
5670
"orgId": {
5771
"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.",
5872
"$ref": "#/definitions/uuidType"
@@ -196,15 +210,12 @@
196210
},
197211
"cpes": {
198212
"type": "array",
199-
"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.",
213+
"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. NOTE: Consider using the newer cpeApplicability block for defining CPE data using the CPE Applicability Language which includes more options for defining CPE Names.",
200214
"uniqueItems": true,
201215
"items": {
202216
"title": "CPE Name",
203-
"type": "string",
204217
"description":"Common Platform Enumeration (CPE) Name in either 2.2 or 2.3 format",
205-
"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})",
206-
"minLength": 1,
207-
"maxLength": 2048
218+
"$ref": "#/definitions/cpe22and23"
208219
}
209220
},
210221
"modules": {
@@ -487,6 +498,87 @@
487498
"required": ["orgId"],
488499
"additionalProperties": false
489500
},
501+
"cpeApplicabilityElement": {
502+
"description": "Affected products defined using an implementation of the CPE Applicability Language, mostly copied/forked from the NIST NVD CVE API v2.0 schema (optional). An operator property allows AND or OR logic between CPEs or combinations of CPEs. The negate and vulnerable Boolean properties allow CPEs to be inverted and/or defined as vulnerable or not. Multiple version fields are provided for capturing ranges of products when defining a CPE Match String Range. NOTE: When defining a cpeApplicability block, it is recommended that it align with (as much as possible) the product data provided within the affected block.",
503+
"properties": {
504+
"operator": {
505+
"type": "string",
506+
"enum": [
507+
"AND",
508+
"OR"
509+
]
510+
},
511+
"negate": {
512+
"type": "boolean"
513+
},
514+
"nodes": {
515+
"type": "array",
516+
"items": {
517+
"$ref": "#/definitions/cpe_node"
518+
}
519+
}
520+
},
521+
"required": [
522+
"nodes"
523+
]
524+
},
525+
"cpe_node": {
526+
"description": "Defines a CPE configuration node in an applicability statement.",
527+
"properties": {
528+
"operator": {
529+
"type": "string",
530+
"enum": [
531+
"AND",
532+
"OR"
533+
]
534+
},
535+
"negate": {
536+
"type": "boolean"
537+
},
538+
"cpeMatch": {
539+
"type": "array",
540+
"items": {
541+
"$ref": "#/definitions/cpe_match"
542+
}
543+
}
544+
},
545+
"required": [
546+
"operator",
547+
"cpeMatch"
548+
]
549+
},
550+
"cpe_match": {
551+
"description": "CPE match string or range",
552+
"type": "object",
553+
"properties": {
554+
"vulnerable": {
555+
"type": "boolean"
556+
},
557+
"criteria": {
558+
"$ref": "#/definitions/cpe23"
559+
},
560+
"matchCriteriaId": {
561+
"$ref": "#/definitions/uuidType"
562+
},
563+
"versionStartExcluding": {
564+
"$ref": "#/definitions/version"
565+
},
566+
"versionStartIncluding": {
567+
"$ref": "#/definitions/version"
568+
},
569+
"versionEndExcluding": {
570+
"$ref": "#/definitions/version"
571+
},
572+
"versionEndIncluding": {
573+
"$ref": "#/definitions/version"
574+
}
575+
},
576+
"required": [
577+
"vulnerable",
578+
"criteria"
579+
],
580+
"additionalProperties": false
581+
},
490582
"cnaPublishedContainer": {
491583
"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.",
492584
"type": "object",
@@ -514,6 +606,12 @@
514606
"affected": {
515607
"$ref": "#/definitions/affected"
516608
},
609+
"cpeApplicability": {
610+
"type": "array",
611+
"items": {
612+
"$ref": "#/definitions/cpeApplicabilityElement"
613+
}
614+
},
517615
"problemTypes": {
518616
"$ref": "#/definitions/problemTypes"
519617
},
@@ -620,6 +718,12 @@
620718
"affected": {
621719
"$ref": "#/definitions/affected"
622720
},
721+
"cpeApplicability": {
722+
"type": "array",
723+
"items": {
724+
"$ref": "#/definitions/cpeApplicabilityElement"
725+
}
726+
},
623727
"problemTypes": {
624728
"$ref": "#/definitions/problemTypes"
625729
},

schema/docs/full-record-advanced-example.json

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,69 @@
9797
"defaultStatus": "unaffected"
9898
}
9999
],
100+
"cpeApplicability": [
101+
{
102+
"operator": "AND",
103+
"nodes": [
104+
{
105+
"operator": "OR",
106+
"negate": false,
107+
"cpeMatch": [
108+
{
109+
"vulnerable": true,
110+
"criteria": "cpe:2.3:a:example_org:example_enterprise:*:*:*:*:*:*:*:*",
111+
"versionStartIncluding": "1.0.0",
112+
"versionEndExcluding": "1.0.6"
113+
},
114+
{
115+
"vulnerable": true,
116+
"criteria": "cpe:2.3:a:example_org:example_enterprise:*:*:*:*:*:*:*:*",
117+
"versionStartIncluding": "2.1.6",
118+
"versionEndExcluding": "2.1.9"
119+
}
120+
]
121+
},
122+
{
123+
"operator": "OR",
124+
"negate": false,
125+
"cpeMatch": [
126+
{
127+
"vulnerable": false,
128+
"criteria": "cpe:2.3:o:microsoft:windows:*:*:*:*:*:*:*:*"
129+
},
130+
{
131+
"vulnerable": false,
132+
"criteria": "cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*"
133+
},
134+
{
135+
"vulnerable": false,
136+
"criteria": "cpe:2.3:h:some_company:xt-4500:*:*:*:*:*:*:*:*"
137+
}
138+
]
139+
}
140+
]
141+
}
142+
],
100143
"descriptions": [
101144
{
102145
"lang": "en",
103-
"value": "OS Command Injection vulnerability parseFilename function of example.php in the Web Management Interface of Example.org Example Enterprise on Windows, macOS, and XT-4500 allows remote unauthenticated attackers to escalate privileges. This issue affects: 1.0 versions before 1.0.6, 2.1 versions from 2.16 until 2.1.9.",
146+
"value": "OS Command Injection vulnerability parseFilename function of example.php in the Web Management Interface of Example.org Example Enterprise on Windows, macOS, and XT-4500 allows remote unauthenticated attackers to escalate privileges. This issue affects: 1.0 versions before 1.0.6, 2.1 versions from 2.1.6 until 2.1.9.",
104147
"supportingMedia": [
105148
{
106149
"type": "text/html",
107150
"base64": false,
108-
"value": "OS Command Injection vulnerability <tt>parseFilename</tt> function of <tt>example.php</tt> in the Web Management Interface of Example.org Example Enterprise on Windows, macOS, and XT-4500 allows remote unauthenticated attackers to escalate privileges.<br><br>This issue affects:<br><ul><li>1.0 versions before 1.0.6</li><li>2.1 versions from 2.16 until 2.1.9.</li></ul>"
151+
"value": "OS Command Injection vulnerability <tt>parseFilename</tt> function of <tt>example.php</tt> in the Web Management Interface of Example.org Example Enterprise on Windows, macOS, and XT-4500 allows remote unauthenticated attackers to escalate privileges.<br><br>This issue affects:<br><ul><li>1.0 versions before 1.0.6</li><li>2.1 versions from 2.1.6 until 2.1.9.</li></ul>"
109152
}
110153
]
111154
},
112155
{
113156
"lang": "eo",
114-
"value": "OS-komand-injekta vundebleco parseFilename funkcio de example.php en la Web Administrado-Interfaco de Example.org Example Enterprise ĉe Windows, macOS kaj XT-4500 permesas al malproksimaj neaŭtentikigitaj atakantoj eskaladi privilegiojn. Ĉi tiu afero efikas: 1.0-versioj antaŭ 1.0.6, 2.1-versioj de 2.16 ĝis 2.1.9.",
157+
"value": "OS-komand-injekta vundebleco parseFilename funkcio de example.php en la Web Administrado-Interfaco de Example.org Example Enterprise ĉe Windows, macOS kaj XT-4500 permesas al malproksimaj neaŭtentikigitaj atakantoj eskaladi privilegiojn. Ĉi tiu afero efikas: 1.0-versioj antaŭ 1.0.6, 2.1-versioj de 2.1.6 ĝis 2.1.9.",
115158
"supportingMedia": [
116159
{
117160
"type": "text/html",
118161
"base64": false,
119-
"value": "OS-komand-injekta vundebleco <tt>parseFilename</tt> funkcio de <tt>example.php</tt> en la Web Administrado-Interfaco de Example.org Example Enterprise ĉe Windows, macOS kaj XT-4500 permesas al malproksimaj neaŭtentikigitaj atakantoj eskaladi privilegiojn.<br><br> Ĉi tiu afero efikas:<br><ul><li>1.0-versioj antaŭ 1.0.6</li><li>2.1-versioj de 2.16 ĝis 2.1.9.</li></ul>"
162+
"value": "OS-komand-injekta vundebleco <tt>parseFilename</tt> funkcio de <tt>example.php</tt> en la Web Administrado-Interfaco de Example.org Example Enterprise ĉe Windows, macOS kaj XT-4500 permesas al malproksimaj neaŭtentikigitaj atakantoj eskaladi privilegiojn.<br><br> Ĉi tiu afero efikas:<br><ul><li>1.0-versioj antaŭ 1.0.6</li><li>2.1-versioj de 2.1.6 ĝis 2.1.9.</li></ul>"
120163
}
121164
]
122165
}

0 commit comments

Comments
 (0)