Skip to main content

A package to convert CVSSv2 to CVSSv3

Project description

cvss-converter

A python program to convert older cvss versions to more modern ones.

Change Logs

v0.1.4:

  • Cleaned up README.md by removing irrelevant reference

v0.1.3:

  • cvss2_to_3() now better handles variants of prefixes on CVSSv2 vectors (e.g. CVSS2#/AV:L..., CVSS2.0:AV:L/...)

Limitations

  • Currently cvss-converter only provides cvssv2 to cvssv3 conversion, with strict mode by default.
  • Only base vector is supported as it is meant to help convert older CVEs with CVSSv2 base vectors (on NVD)

Strict Mode

As there are a several fields which are either ambiguous or doesn't exist at all (e.g. Scope or User Interaction). During conversion, the logic will always choose the values of a vector that yields a higher CVSS score. We prefer to err on the side of caution than to assume that the vulnerability is not affected by the ambiguity. The conversion mapping chart in strict mode for ambiguous or missing vectors is as follows:

CVSSv2 Vector CVSSv3.1 Vector
Attack Complexity (AC): "Medium" Attack Complexity (AC): "Low"
Does not exist Scope (S): "C"
Does not exist User Interaction (UI): "N"

Please also note that for Attack Vector (AV), since there is no Physical value in CVSSv2, there is no conversion requirements to ever map a value to CVSSv3 AV:P.

How to use?

Install with Pip or Pipenv

Pip:

pip install cvss-converter

Pipenv:

pipenv install cvss-converter

Usage: Example

from cvss_converter.converter import cvss2_to_cvss3

cvssv2 = "AV:N/AC:H/Au:S/C:P/I:P/A:C"
cvssv3, score = cvss2_to_cvss3(cvssv2)
print(f"CVSSv3 Vector: {cvssv3}, Base Score: {score}")

Expected output:

CVSSv3 Vector: CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:H, Base Score: 7.1

Future

  • Add vector override
  • Add option for standard mode (non-strict)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvss_converter-0.1.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

cvss_converter-0.1.4-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file cvss_converter-0.1.4.tar.gz.

File metadata

  • Download URL: cvss_converter-0.1.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for cvss_converter-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ea94d02528db02149b6cd50ef37dcad555462ecd51974cc7d8b282bdf1259805
MD5 f90ea72283d04148f61a78bce89cd0da
BLAKE2b-256 6a12b5f9be85552e789a0d1fbed43edb5bb2e084e7bcba0072978809995688a4

See more details on using hashes here.

File details

Details for the file cvss_converter-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for cvss_converter-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4f69a12e7fc6e3df1fa21895dd3d6815b69345aff95d7772c7ad3243af29e340
MD5 8fc077eadcb88ada75aeb4bda7fce2fa
BLAKE2b-256 76c06370ac439f14175ae1a82f95c935ca42d8a5a24c0df7ba57c75e6e80218b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page