-
Notifications
You must be signed in to change notification settings - Fork 205
Add a formal semver 2.0.0 version type #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature-PR371-semver2.0
Are you sure you want to change the base?
Changes from 15 commits
c50a136
bec099b
20f9b39
e637776
fffd0cd
16680d2
208980b
0ce6601
62db169
34af2ae
046dadd
484ca76
3527158
b037e53
226158a
e264318
ddf4895
7b77630
bf48730
e333f53
992e9c3
9226d60
3f33ceb
eb4fd2f
36a22ee
fd0d7e1
745cc6f
a0ff77b
9f839d6
5cc921e
9a4ad63
50d0e12
a72e5b8
9d53824
30bd0de
10c83ec
fc8b7b8
6135668
43e4f17
1e91117
0dc04e2
da94093
5ac7c5f
a3f5748
b8b9afd
85af8eb
97f14c2
b800796
69aba3f
c9fde50
bc077f5
64774b5
4d091a0
7ba977b
1bb151e
4427021
c6e12cb
46c5293
cffccd7
8a4824a
f7c4fe6
5cfcb16
56f7a0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,6 +288,78 @@ Now that we know how to encode version objects, that would be written as: | |
} | ||
] | ||
|
||
### Version Types | ||
|
||
#### Semantic versioning 2.0.0 | ||
|
||
Type identifier: `semver-2.0.0` | ||
Formally specified here at https://semver.org/spec/v2.0.0.html | ||
`semver-2.0.0` is new type introduced to formally specify usage of semantic versioning. | ||
|
||
|
||
`semver-2.0.0` in its simplest form is a dot separated triple. eg `1.2.3`. The three parts have names with the first being the `MAJOR`, the second being `MINOR` and the third `PATCH`. The [Semantic](https://en.wikipedia.org/wiki/Semantics) meaning of each is described as | ||
1. MAJOR version when you make incompatible API changes | ||
2. MINOR version when you add functionality in a backward compatible manner | ||
3. PATCH version when you make backward compatible bug fixes | ||
This triple can be extended with either a `-` or a `+` or with both for `pre-release` and `build` identifiers. | ||
The triple can only be populated with non-negative integers and must not contain leading zeros. | ||
Ordering of the triple is determined by the first difference when comparing each of these identifiers from left to right as follows: Major, minor, and patch versions are always compared numerically. | ||
Full ordering for pre-releases and builds are described in the semver document [here](https://semver.org/spec/v2.0.0.html#spec-item-11). | ||
While the triple can only contain numeric values the `pre-release` and `build` are free to be alpha numeric. | ||
A complete definition of this version type can be viewed here | ||
https://semver.org/spec/v2.0.0.html#backusnaur-form-grammar-for-valid-semver-versions | ||
|
||
In the interest of simplicity the `semver-2.0.0` version type has two parameters which define a continuous range. `lowerBound` and `upperBound` each must be a valid semver triple with optional pre-release/build extensions. | ||
|
||
|
||
##### Example | ||
|
||
``` | ||
"affected": [ | ||
{ | ||
"vendor": "Example.org", | ||
"product": "Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"inclusiveLowerBound": "1.2.3-alpha", | ||
"exclusiveUpperBound": "2.3.4+build17" | ||
} | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "unaffected", | ||
"exclusiveLowerBound": "3.4.5-beta", | ||
"inclusiveUpperBound": "4.5.6+assembly88" | ||
} | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"exactly": "5.6.7-gamma", | ||
} | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"exactly": "6.7.8-delta", | ||
} | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"exclusiveUpperBound": "1.0.0", | ||
} | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "unknown", | ||
"inclusiveLowerBound": "9.0.0", | ||
} | ||
], | ||
} | ||
], | ||
``` | ||
|
||
#### Explainer | ||
|
||
A `semver-2.0.0` version is expressed as either a range or as a single exact version. Chaining multiple `semver-2.0.0` versions can be done to express more complex ranges. A `semver-2.0.0` range must begin with a lower bound which is followed by an upper bound. Each bound may be either inclusive or exclusive. These terms map as `exclusiveUpperBound` to `<`, `inclusiveUpperBound` to `<=`, `exclusiveLowerBound` to `>`, `inclusiveLowerBound` to `>=` and `exactly` to `=`. Thus the first example above could be rewritten as `>= 1.2.3-alpha, < 2.3.4+build17`. | ||
|
||
|
||
## Version Status Changes | ||
|
||
As presented in the previous section, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{ | ||
"dataType": "CVE_RECORD", | ||
"dataVersion": "5.1", | ||
"cveMetadata": { | ||
"cveId": "CVE-1900-1234", | ||
"assignerOrgId": "b3476cb9-2e3d-41a6-98d0-0f47421a65b6", | ||
"state": "PUBLISHED" | ||
}, | ||
"containers": { | ||
"cna": { | ||
"providerMetadata": { | ||
"orgId": "b3476cb9-2e3d-41a6-98d0-0f47421a65b6" | ||
}, | ||
"problemTypes": [ | ||
{ | ||
"descriptions": [ | ||
{ | ||
"lang": "en", | ||
"description": "CWE-78 OS Command Injection" | ||
} | ||
] | ||
} | ||
], | ||
"affected": [ | ||
{ | ||
"vendor": "Example.org", | ||
"product": "Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"exactly": "1.2.3" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
}, | ||
{ | ||
"vendor": "Example2.org", | ||
"product": "Another Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"exclusiveLowerBound": "1.2.3" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
}, | ||
{ | ||
"vendor": "Example3.org", | ||
"product": "Another Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"inclusiveLowerBound": "1.2.3" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
}, | ||
{ | ||
"vendor": "Example4.org", | ||
"product": "Another Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"inclusiveUpperBound": "1.2.3" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
}, | ||
{ | ||
"vendor": "Example4.org", | ||
"product": "Another Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"exclusiveUpperBound": "1.2.3" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
}, | ||
{ | ||
"vendor": "Example5.org", | ||
"product": "Another Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"inclusiveLowerBound": "1.2.3", | ||
"inclusiveUpperBound": "2.3.4" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
}, | ||
{ | ||
"vendor": "Example6.org", | ||
"product": "Another Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"inclusiveLowerBound": "1.2.3", | ||
"exclusiveUpperBound": "2.3.4" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
}, | ||
{ | ||
"vendor": "Example7.org", | ||
"product": "Another Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"exclusiveLowerBound": "1.2.3", | ||
"inclusiveUpperBound": "2.3.4" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
}, | ||
{ | ||
"vendor": "Example8.org", | ||
"product": "Another Example Enterprise", | ||
"versions": [ | ||
{ | ||
"versionType": "semver-2.0.0", | ||
"status": "affected", | ||
"exclusiveLowerBound": "1.2.3", | ||
"exclusiveUpperBound": "2.3.4" | ||
} | ||
], | ||
"defaultStatus": "unaffected" | ||
} | ||
], | ||
"descriptions": [ | ||
{ | ||
"lang": "en", | ||
"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.\n\nThis issue affects:\n * 1.0 versions before 1.0.6\n * 2.1 versions from 2.16 until 2.1.9." | ||
} | ||
], | ||
"references": [ | ||
{ | ||
"url": "https://example.org/ESA-22-11-CVE-1900-1234" | ||
} | ||
] | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.