Skip to content

API Reference parrot_tools.security.cve.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.security.cve.models

View source

CVE records, search results and download receipts (FEAT-778 M12).

Class AffectedPackage

A package affected by a vulnerability.

Fields:

Field Type Default Description
ecosystem str
name str
introduced str | None None
fixed str | None None
versions list[str]

Class CVENotFoundError

OSV has no record for the id (HTTP 404).

Class CVERecord

A normalised CVE record merged from OSV, NVD and EPSS.

Fields:

Field Type Default Description
id str
aliases list[str]
summary str ''
details str ''
severity SeverityLevel SeverityLevel.UNKNOWN
cvss list[CVSS]
epss float | None None
cwe_ids list[str]
affected list[AffectedPackage]
references list[str]
published datetime | None None
modified datetime | None None
sources list[Literal['osv', 'nvd', 'epss']]
raw dict[str, Any]

Class CVESearchResult

CVE records found for a package (optionally at a given version).

Fields:

Field Type Default Description
package str
ecosystem str
version str | None None
records list[CVERecord]

Class CVEToolkitError

A CVE operation failed (bad namespace, write failure, provider error surfaced to the caller).

Attribute CVE_ID_RE

Type: Final[re.Pattern[str]]

Class CVSS

A CVSS score with its vector and provenance.

Fields:

Field Type Default Description
version Literal['3.0', '3.1', '4.0']
score float | None None
vector str
source Literal['osv', 'nvd']

Class DownloadReceipt

Receipt of a CVE record persisted to a wiki.

Fields:

Field Type Default Description
cve_id str
wiki_name str
concept_id str
json_path str
content_hash str

Attribute OSV_ECOSYSTEMS

Type: Final[tuple[str, ...]]

Alias SeverityLevel

Re-exported from parrot_tools.security.models.SeverityLevel.

Function cvss3_base_score

Compute the CVSS 3.0/3.1 base score of vector.

Returns None (never raises) for CVSS 4.0 vectors, other prefixes, or a missing/invalid base metric. CVSS 4.0 needs the macro-vector lookup table and is deliberately not scored here.

cvss3_base_score(vector: str) -> float | None

Parameter Type Default Description
vector str

Returns: float | None

Function severity_from_score

CRITICAL >=9, HIGH >=7, MEDIUM >=4, LOW >0, INFO ==0, UNKNOWN when None (see Context).

severity_from_score(score: float | None) -> SeverityLevel

Parameter Type Default Description
score float | None CVSS base score, or None when unavailable.

Returns: SeverityLevel — The normalised severity level.

Function validate_cve_id

Return the stripped CVE id; raise ValueError when it does not match CVE_ID_RE.

validate_cve_id(cve_id: str) -> str

Parameter Type Default Description
cve_id str Candidate id such as CVE-2026-98432.

Returns: str — The stripped id.

Raises:

  • ValueError — When the id is not a well-formed upper-case CVE id.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally