Skip to content

Commit 2522a26

Browse files
committed
Refine documentation of NVD ranges and approach
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 446e6d8 commit 2522a26

1 file changed

Lines changed: 27 additions & 10 deletions

File tree

VERSION-RANGE-SPEC.rst

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ most version range notations are similar.
4040

4141
Each package type or ecosystem may define their own ranges notation and version
4242
comparison semantics for dependencies. And for security advisories, the lack of
43-
portable notation for vulnerable package version ranges means that these ranges
44-
may be either ambiguous or hard to compute and are typically replaced by
45-
complete enumerations of all versions, such as the NVD CPEs.
43+
a portable and compact notation for vulnerable package version ranges means that
44+
these ranges may be either ambiguous or hard to compute and may be best replaced
45+
by complete enumerations of all impacted versions, such as in the `NVD CPE Match
46+
feed <https://nvd.nist.gov/vuln/data-feeds#cpeMatch>`_.
4647

4748
Because of this, expressing and resolving a version range is often a complex, or
4849
error prone task.
@@ -96,6 +97,10 @@ in use:
9697
similar to this specification based on a modified semver with extra notations
9798
such as star and caret.
9899

100+
- The NVD https://nvd.nist.gov/vuln/data-feeds#cpeMatch defines CPE ranges as
101+
lists of version start and end either including or excluding the start or end
102+
version. And also provides a concrete enumeration of the available ranges as
103+
a daily feed.
99104

100105
Note that there is a closely related problem as the way two versions are compared
101106
as equal, lesser or greater is often complex.
@@ -459,18 +464,30 @@ resolution.
459464
Why not use the NVD CPE Ranges?
460465
###############################
461466

462-
https://nvd.nist.gov/vuln/vulnerability-detail-pages#divRange
467+
- https://nvd.nist.gov/vuln/vulnerability-detail-pages#divRange
468+
- https://nvd.nist.gov/developers/vulnerabilities#divResponse
469+
- https://csrc.nist.gov/schema/nvd/feed/1.1/nvd_cve_feed_json_1.1.schema
463470

464-
The NVD CPE Match String Range is a complex specification that goes well beyond
465-
version ranges and is used to match comprehensive configurations across multiple
466-
products and version ranges. The notation for version ranges uses these two
467-
fields (in the CVE API or feeds) under the "configurations" attribute::
471+
The version ranges notation defined in the JSON schema of the CVE API payload
472+
uses these four fields: ``versionStartIncluding``, ``versionStartExcluding``,
473+
``versionEndIncluding`` and ``versionEndExcluding``. For example::
468474

469475
"versionStartIncluding": "7.3.0",
470476
"versionEndExcluding": "7.3.31",
477+
"versionStartExcluding" : "9.0.0",
478+
"versionEndIncluding" : "9.0.46",
471479

472-
This notation is limited and is compatible can be expressed in ``vers`` but this
473-
does not provide a compact notation like ``vers`` does.
480+
In addition to these ranges, the NVD publishes a list of concrete CPE with
481+
versions resolved for a range with daily updates at
482+
https://nvd.nist.gov/vuln/data-feeds#cpeMatch
483+
484+
Note that the NVD CVE configuration is a complex specification that goes well
485+
beyond version ranges and is used to match comprehensive configurations across
486+
multiple products and version ranges. ``vers`` focus is exclusively versions.
487+
488+
The NVD JSON notation is verbose in contrast with ``vers`` that attempts to
489+
provide a compact notation. It provides the same =, <=, < and > comparators
490+
specified in ``vers`` and found in other notations.
474491

475492

476493
Why not use node-semver ranges?

0 commit comments

Comments
 (0)