The `cvss` library provides a Python implementation for calculating and parsing Common Vulnerability Scoring System (CVSS) scores for versions 2, 3, and 4. It enables users to convert CVSS vectors into human-readable scores and provides programmatic access to individual metric values. The current version is 3.6, and it sees active maintenance with several releases per year addressing bug fixes and new CVSS specification versions.
pip install cvssVerified import paths — ran on the pinned version, not inferred.
Initialize CVSS objects with a vector string and retrieve base scores and individual metrics.
Upgrade your Python environment to 3.7 or newer. If you must use Python 2.7, use an older version of the `cvss` library (e.g., <3.5), but note it will not support CVSS v4.0.
Ensure your Python environment is version 3.7 or higher.
Inspect the CVSS vector string (e.g., 'CVSS:3.1/' indicates v3.1, 'CVSS:4.0/' indicates v4.0) and instantiate the appropriate class (e.g., `CVSS3(...)` or `CVSS4(...)`).
Ensure you are using `cvss` library version 3.2 or newer when calculating CVSS v4.0 scores for accurate rounding.
Be aware of the `minimal` parameter's effect when generating JSON output, especially if you expect a full representation of all metrics regardless of input.
Install the package using pip: `pip install cvss`
Ensure the CVSS vector string strictly follows the CVSS specification for the intended version, including the correct prefix (e.g., 'CVSS:3.1/') and valid metric abbreviations and values. Example: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`.
Review the CVSS v4.0 specification and ensure the vector string precisely includes all required base metrics and uses correct abbreviations and values. Example: `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`.
No dependency data recorded yet.