cvss-estimator
Two things in one small, dependency-free package:
- A correct CVSS v3.1 base-score calculator — build, parse, and score vectors per the official specification arithmetic.
- An evidence-driven estimator — turn source-to-sink evidence flags (is the attacker path complete? is there a sanitizer? a public entrypoint?) plus a CWE/summary into a plausible, explainable CVSS vector and score. Useful for generating a stable machine baseline before a human refines it.
Install
pip install cvss-estimator
Scoring an existing vector
from cvss_estimator import cvss_base_score, parse_vector, severity
metrics = parse_vector("CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H")
score = cvss_base_score(metrics) # 9.8
print(severity(score)) # "Critical"
cvss-estimator score "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
Estimating a vector from evidence
from cvss_estimator import estimate
result = estimate(
cwe="CWE-502", # unsafe deserialization -> RCE category
evidence={
"attacker_path_complete": True, # full source-to-sink -> AC:L, AV:N
"entrypoint_found": True,
"sanitizer_or_allowlist_present": False,
},
)
print(result["vector"]) # CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
print(result["score"]) # 9.8
print(result["severity"]) # Critical
cvss-estimator estimate --cwe CWE-502 --complete-path --entrypoint http_route
Evidence flags
| Flag | Effect |
|---|---|
attacker_path_complete |
AC:L (and AV:N for RCE) |
entrypoint / entrypoint_found |
network attack vector for RCE |
auth_guard_present |
PR:L |
consumer_opt_in_required |
UI:R |
sanitizer_or_allowlist_present |
downgrades C/I/A, raises AC:H |
safe_containment_present |
downgrades C/I/A, raises AC:H |
Categories are inferred from CWE/summary via impact_profile():
remote_code_execution, sql_injection, ssrf, xxe, path_traversal,
secret_exposure, denial_of_service, security_weakness.
Notes
- No runtime dependencies.
- The estimator is a heuristic baseline, not an authoritative score — always have a human confirm the vector before publishing a CVE.
License
MIT
Metadata
Release files for cvss-estimator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cvss_estimator-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cvss_estimator-0.1.0-py3-none-any.whl |
Release files / cvss_estimator-0.1.0-py3-none-any.whl
| Download URL | cvss_estimator-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5adc89e90c38dd731a6b0bf69425d780bc26b2dc60aaa8f5a0ce29305642e4e2
|
|
BLAKE2b-256 checksum How to use checksums |
ae252091c5ab0ea958ca7b98d47a98142530cde096d279d36bcc1f5564e5f073
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for cvss-estimator 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.