Skip to main content

This Python package contains CVSS v2, v3 and v4 computation utilities and interactive calculator (for v2 and v3 only) compatible with Python 3. CVSS (Common Vulnerability Scoring System) is an standardized method for rating the severity of security issues on a scale from 0 (no impact) to 10 (critical).

The library is tested on all currently-supported Python versions available via GitHub Actions but it is simple enough to run on even older versions.

Installation

# pip install cvss

Usage

Library

from cvss import CVSS2, CVSS3, CVSS4


vector = 'AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/RC:ND/CDP:L/TD:H/CR:ND/IR:ND/AR:M'
c = CVSS2(vector)
print(vector)
print(c.clean_vector())
print(c.scores())
print(c.severities())

print()

vector = 'CVSS:3.0/S:C/C:H/I:H/A:N/AV:P/AC:H/PR:H/UI:R/E:H/RL:O/RC:R/CR:H/IR:X/AR:X/MAC:H/MPR:X/MUI:X/MC:L/MA:X'
c = CVSS3(vector)
print(vector)
print(c.clean_vector())
print(c.scores())
print(c.severities())

print()

vector = 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:N'
c = CVSS4(vector)
print(vector)
print(c.clean_vector())
print(c.scores())
print(c.severities())

Sample output:

AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/RC:ND/CDP:L/TD:H/CR:ND/IR:ND/AR:M
AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/CDP:L/TD:H/AR:M
(5.0, 4.0, 4.6)
('Medium', 'Medium', 'Medium')

CVSS:3.0/S:C/C:H/I:H/A:N/AV:P/AC:H/PR:H/UI:R/E:H/RL:O/RC:R/CR:H/IR:X/AR:X/MAC:H/MPR:X/MUI:X/MC:L/MA:X
CVSS:3.0/AV:P/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:N/E:H/RL:O/RC:R/CR:H/MAC:H/MC:L
(6.5, 6.0, 5.3)
('Medium', 'Medium', 'Medium')

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:N
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:N
(9.9,)
('Critical',)

Interactive calculator

For interactive calculator run the following:

$ cvss_calculator

For help on the calculator options run:

$ cvss_calculator --help

Testing

For extensive testing, the test vectors were generated using official JavaScript generators and cvsslib.

To run all tests using all supported versions of Python 2 and Python 3 installed:

$ tox
$ tox -e py311   # Run tests using a specific version of Python

Release files for cvss 3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cvss 3.6
File Size Uploaded
cvss-3.6.tar.gz 30.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cvss 3.6
File Interpreter ABI Platform
cvss-3.6-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 61.2 kB

Release files / cvss-3.6.tar.gz

Download URL cvss-3.6.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f21d18224efcd3c01b44ff1b37dec2e3208d29a6d0ce6c87a599c73c21ee1a99
BLAKE2b-256 checksum
How to use checksums
a5f61f7d315de23f39bbc32b94bb6b33a1b6124856037bfaa3f8bdb1a49584fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / cvss-3.6-py2.py3-none-any.whl

Download URL cvss-3.6-py2.py3-none-any.whl
Size 31.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e342c6ad9c7eb69d2aebbbc2768a03cabd57eb947c806e145de5b936219833ea
BLAKE2b-256 checksum
How to use checksums
636dfe2c65b94a28ae0481dc254e8cd664b82390069003bea945076d8a445f2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

3.6 This release

2 release files

3.4

2 release files

3.3

2 release files

3.2

2 release files

3.1

2 release files

3.0

1 release file

2.6

2 release files

2.5

2 release files

2.4

2 release files

2.3

2 release files

2.2

2 release files

2.1

2 release files

2.0

2 release files

1.10

2 release files

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page