Scoring and Prioritization Deep Dive
This page details how VulnParse-Pin v2.1.0 (Apache-2.0) computes dual-track risk scores, evaluates CISA BOD 26-04 / SSVC triage decisions, computes Remediation@1.0 minimum patch sets, ranks assets and findings in DuckDB, and detects cross-run priority drift.
Scope and Primary Implementation Files
src/vulnparse_pin/core/passes/__init__.py(run_v2_duckdb_pipeline)src/vulnparse_pin/app/enrichment.py(populate_enrichment_snapshots, EPSS velocity &PreKEVModelhydration)src/vulnparse_pin/core/passes/Scoring/scoringPass.py(ScoringV3Pass/Scoring@3.0, plus legacyScoringPass/Scoring@2.0)src/vulnparse_pin/utils/cvss_utils.py(clean-room Apache-2.0 CVSS v2.0 / v3.0 / v3.1 / v4.0 calculator &resolve_effective_cvss_fields)src/vulnparse_pin/core/passes/Triage/triage_pass.py(TriageDecisionPass/Triage@2.0)src/vulnparse_pin/core/passes/Remediation/remediation_pass.py(RemediationPass/Remediation@1.0)src/vulnparse_pin/core/passes/TopN/topn_pass.py(TopNV2Pass/TopN@2.0, plus legacyTopNPass/TopN@1.0)src/vulnparse_pin/core/passes/Summary/summary_pass.py(SummaryV2Pass/Summary@2.0, plus legacySummaryPass/Summary@1.0)src/vulnparse_pin/core/diff_engine.py(DiffEngine,evaluate_fail_gate)src/vulnparse_pin/core/config_projector.py&src/vulnparse_pin/core/config_validator.pysrc/vulnparse_pin/resources/config.yaml,src/vulnparse_pin/resources/scoring.json,src/vulnparse_pin/resources/tn_triage.json
Triage Methodology Baseline
VulnParse-Pin applies a real-world exploitation and exposure-first triage model:
- Prioritize findings and assets with verified active exploitation (CISA KEV, verified exploit), high EPSS v5 probability/percentile, and internet-facing exposure.
- Separate CVE-backed vulnerabilities (Track A:
cve_threat) from non-CVE misconfigurations, SAST rules, and exposed-service findings (Track B:exposure_weakness). - Weight Track B risk and triage eligibility by scanner
detection_mode(signal_reliability) and enforce fail-closed guardrails on uncorroborated static SAST findings. - Support both the
defaultoperational triage profile and the federalbod-26-04SSVC decision profile.
v2.1.0 DuckDB Pass Pipeline
run_v2_duckdb_pipeline() executes the canonical DuckDB-first pass DAG via PassRunner:
NmapAdapter@1.0(optional, when--nmap/--nmap-ctxis provided)ACI@2.0(ACIV2Pass) → persistsaci_signals(includingACIModelML predictions whenml.mode != "off")Scoring@3.0(ScoringV3Pass) → persistsscores, updatesfindings.signal_reliabilityandassets.derived_criticalityTriage@2.0(TriageDecisionPass) → persiststriage_decisionsRemediation@1.0(RemediationPass) → persistsremediation_actionsandremediation_action_findingsvia greedy weighted set-coverTopN@2.0(TopNV2Pass) → unified SQL CTE asset & finding rankingSummary@2.0(SummaryV2Pass) → unified SQL summary aggregation
NOTE
Legacy in-memoryScanResultpasses (Scoring@2.0,ACI@1.0,TopN@1.0,Summary@1.0) remain available only for backward-compatible Python API callers; the v2.1.0 CLI exposes 13 subcommands (scan,demo,diff,ui,gui,export,verify,defer,intel,ml,mcp,assets,simulate) operating over.vpp.dbandrun_v2_duckdb_pipeline()rather than the legacy in-memory pipeline.
Pre-KEV & EPSS Velocity Hydration (populate_enrichment_snapshots)
Before run_v2_duckdb_pipeline() runs, populate_enrichment_snapshots() (src/vulnparse_pin/app/enrichment.py) computes trailing EPSS trajectory metrics (epss_delta_7d, epss_delta_30d, epss_slope) via compute_epss_velocity() from epss_cache.sqlite3 (epss_history) and prior DuckDB enrichment_snapshots. When ml_pol.mode != "off" (default "shadow") and epss_score is present, PreKEVModel (pre_kev_v1_core) evaluates velocity, CVSS, exploit, advisory, CWE, and text features to hydrate pre_kev_score, pre_kev_flag, and pre_kev_reasons_json into enrichment_snapshots.
Clean-Room Apache-2.0 CVSS Engine & Provenance
In v2.0.0, VulnParse-Pin removes the LGPL cvss runtime dependency and implements a clean-room, Python standard-library-only CVSS calculator in src/vulnparse_pin/utils/cvss_utils.py:
- Supported Specifications: Official FIRST formulas and MacroVector lookup tables for CVSS v2.0, CVSS v3.0, CVSS v3.1, and CVSS v4.0 (all 270 valid EQ1–EQ6 MacroVectors).
- Authoritative Precedence (
_CVSS_PROVENANCE_RANK):NVD (5) > CNA (4) > GHSA (3) > OSV (2) > Scanner-Supplied (1) > Missing (0) - Safe Effective Resolution (
resolve_effective_cvss_fields): Used across DuckDB repositories, dossier/roadmap renderers, JSON/CSV exporters,DiffEngine, and the Textual TUI so that a"Missing"enrichment snapshot never shadows a valid"Scanner-Supplied"score/vector, and missing CVSS never leaks as a synthetic0.0.
Scoring@3.0: Dual-Track Vectorized Scoring
ScoringV3Pass reads joined findings, assets, aci_signals, and enrichment_snapshots rows from .vpp.db, memoizes equivalent signal signatures, and writes scores via DuckDB appender.
Track A: cve_threat (CVE-Backed Findings)
Selected when a finding carries one or more CVE IDs and scoring_track != "exposure_weakness".
For each associated CVE on the finding:
-
CVSS Base Score (
0.0–10.0): Resolved usingNVD > CNA > GHSA > OSV > Scanner-Supplied > Missing(0.0in numeric calculation if missing, whilescore_trace.cvss_provenancestays"Missing"). -
EPSS v5 Monotonic Piecewise Cutoffs (
_epss_v5_points): Computes strictly monotonic piecewise-linear points (0.0–5.0) overepss_scoreusing the defaultscoring.jsonbreakpoints:EPSS Probability EPSS Points 0.000.00.04(4%)1.80.10(10%)3.00.50(50%)4.21.00(100%)5.0FIRST
epss_percentile(0.0–1.0) is stored alongsideepss_score, formatted inepss_display(for example12.3% / 95th), and evaluated directly inTriage@2.0(>= 0.90and>= 0.95). -
KEV & Verified Exploit (Non-Double-Counting):
in_kev == True:+4.5(kev_points)verified_exploit == True:+2.0(verified_exploit_points) when not in KEV, or+0.5(verified_exploit_with_kev_points) when already in KEVheuristic_exploit_mention == True:+0.0(heuristic_exploit_points; preserved as trace metadata only so unverified advisory mentions do not inflate scores)
-
Multi-CVE Stacked Decay: Per-CVE raw scores (
cve_raw = cvss + epss_points + kev_points + exp_points) are sorted descending by(cve_raw, cve_id)and summed with exponential decaydecay ** idx(finding_cve_decay = 0.35,finding_cve_max_contributors = 8). -
Asset Context Modifiers,
ml_uplift, & Normalization:exposure_bonus:+1.25wheninternet_facingistruecriticality_bonuses:critical: +1.0,high: +0.5,medium: 0.0,low: -0.25ml_uplift: evaluated by_evaluate_ml_aci_overlay(); returns0.0inoffor defaultshadowmode, and when--ml-mode activewithml_capabilitiespresent,negated_false_positive < 0.50, andmax_off_prob >= 0.60, addsround(min(max_aci_uplift, max(0.0, ((max_off_prob - 0.50) / 0.50) * max_aci_uplift)), 4)(defaultmax_aci_uplift = 1.25).pre_clamp_raw = stacked_cve_raw + exposure_pts + crit_pts + ml_uplift, clamped tomax_raw_risk = 16.0and scaled tooperational_score = (raw_score / 16.0) * 10.0(0.0–10.0).
Track B: exposure_weakness (Non-CVE Findings)
Selected when a finding has no CVEs (e.g., Nuclei misconfigurations/default logins, Semgrep SAST findings, exposed admin panels, or network service checks).
- Base Score:
scanner_cvss_score(or base score computed fromscanner_cvss_vector, provenance"Scanner-Supplied"); otherwiseexposure_track.severity_base:critical: 8.5,high: 7.0,medium: 4.5,low: 2.0,informational/info: 0.5(provenance"Missing"). - Additive Capability & Context Bonuses:
- ACI capability bonus:
+3.5(aci_high_impact_bonus) if any capability is in{remote_execution, command_execution, auth_bypass, sql_injection, privilege_escalation, initial_access, deserialization, ssrf}, else+2.0(aci_exposure_bonus) if any other ACI capability is present. - ACI chain bonus:
+1.0(aci_chain_bonus) whenaci_chainsis non-empty. - High-impact CWE bonus:
+1.5(cwe_high_impact_bonus) for high-impact CWEs (CWE-22,CWE-77,CWE-78,CWE-79,CWE-89,CWE-94,CWE-250,CWE-269,CWE-287,CWE-306,CWE-434,CWE-502,CWE-798,CWE-918). - Exposure bonus:
+1.5(exposure_bonus) wheninternet_facingistrue.
- ACI capability bonus:
- Signal Reliability Weighting &
ml_uplift:weighted_raw = (unweighted_raw * signal_reliability) + ml_uplift(whereml_upliftis0.0inoff/shadowmode and up tomax_aci_uplift = 1.25when--ml-mode active), clamped to16.0and normalized to0.0–10.0.
Signal Reliability (detection_mode)
Configured in config.yaml and scoring.json under signal_reliability:
detection_mode |
Default Weight | Typical Sources |
|---|---|---|
credentialed_host |
1.00 |
Credentialed Nessus / OpenVAS / Qualys host checks |
active_dast |
1.00 |
Active Nuclei probes |
sca_container |
0.90 |
Trivy / Grype package & container SARIF |
uncredentialed_banner |
0.85 |
Uncredentialed network/service banner checks |
network_probe |
0.80 |
Nmap service/script probes |
static_sast |
0.55 |
Semgrep / CodeQL static analysis |
If detection_mode is unmapped, SignalReliabilityPolicy.weight_for falls back to explicit finding reliability (clamped [0.0, 2.0]), then ingestion_confidence (clamped [0.0, 1.0]), then 0.70.
Risk Bands & Asset Criticality
Raw-score risk bands (scoring.json):
Critical:raw_score >= 12.8(operational>= 8.0)High:raw_score >= 9.6(operational>= 6.0)Medium:raw_score >= 6.4(operational>= 4.0)Low:raw_score >= 3.2(operational>= 2.0)Informational:raw_score < 3.2
ScoringV3Pass also derives assets.derived_criticality: Extreme (>= 3 Critical findings), High (>= 1 Critical or >= 2 High), Medium (>= 1 High or >= 5 Medium), else Low.
Triage@2.0: default vs --profile bod-26-04
TriageDecisionPass evaluates every finding in scores under either default or bod-26-04 (--profile bod-26-04) and reconciles explicit deferrals/acceptances/mitigations from DecisionsRegistry (decisions.yaml or inline assets.yaml).
SSVC Inputs (bod-26-04)
_compute_ssvc_inputs() derives four SSVC decision points:
publicly_exposed:bool(internet_facing)exploitation:"active"ifin_kevOR (scoring_track == "exposure_weakness"andsignal_reliability >= 0.90and active exposure ACI capability/token such asremote_execution,command_execution,auth_bypass,default-login,rce)"poc"ifverified_exploitORepss >= 0.10ORepss_percentile >= 0.95"none"otherwise
automatable:trueif CVSS vector hasAV:NandAC:Lwith no/low privilege & no user interaction, OR ACI indicatesremote_execution/command_execution/auth_bypass/default-login/RCE tokenstechnical_impact:"total"if CVSS reflects total CIA impact (C:H/I:H/A:H, v2C:C/I:C/A:C, v3S:C, or v4VC:H/VI:HorSC:H/SI:H) OR ACI detectsremote_execution,command_execution,auth_bypass,privilege_escalation, orsql_injection; else"partial"
Profile Decision & SLA Matrix
| Profile | Priority Tier | OAL Compat | SSVC Action | SLA Bucket (sla_days) |
Trigger Conditions |
|---|---|---|---|---|---|
bod-26-04 |
P1 |
OAL-1 |
Act |
3-day + Forensic Triage (3) |
publicly_exposed AND exploitation == "active" |
bod-26-04 |
P1 |
OAL-1 |
Act |
14-day (14) |
Internal exploitation == "active", OR publicly_exposed + (automatable & total OR epss_pct >= 0.95 OR reliable Track B total) |
bod-26-04 |
P2 |
OAL-2 |
Attend |
60-day (60) |
epss_pct >= 0.90 OR epss >= 0.04 OR (automatable & total) OR aci_chains OR (static_sast + total) OR SAST P1-cap applied |
bod-26-04 |
P3 / P4 |
OAL-3 |
Track |
Fix on Upgrade (None) |
Remainder (P3 if operational_score >= 3.5, else P4) |
default |
P1 |
OAL-1 |
Act |
3-day + Forensic Triage (3) or 14-day (14) |
3-day + Forensic Triage when in_kev & internet_facing; 14-day for internal KEV (critical/high asset), epss >= 0.10/pct >= 0.95 & exposed, reliable Track B high-impact/>= 8.5 on exposed/critical asset, or op_score >= 9.0 & sig_rel >= 0.85 |
default |
P2 |
OAL-2 |
Attend |
14-day (14) |
in_kev, epss >= 0.04, epss_pct >= 0.90, aci_chains, operational_score >= 6.5, or SAST P1-cap applied |
default |
P3 |
OAL-3 |
Track* |
60-day (60) |
operational_score >= 3.5 |
default |
P4 |
OAL-3 |
Track |
Fix on Upgrade (None) |
Remainder |
Static SAST P1-Cap Guardrail
When triage.static_sast_p1_cap: true (default), a detection_mode == "static_sast" finding is blocked from entering P1 unless _is_high_conf_sast_corroborated() passes:
internet_facing == True, ANDscanner_severityis"high"or"critical", AND- at least one of: high-impact SAST CWE (
CWE-78,CWE-89,CWE-94,CWE-287,CWE-306,CWE-434,CWE-502,CWE-798,CWE-918), high-impact ACI capability/chain, or high-confidence rule keyword (rce,sqli,command-injection,auth-bypass,deserialization,hardcoded-secret,ssrf, etc.).
Uncorroborated SAST P1 candidates are capped at P2 (60-day under bod-26-04; 14-day under default) with sast_p1_capped = true recorded in assumed_state_json.
Decision Registry Reconciliation & Invalidated Deferrals
When decisions.yaml (or inline assets.yaml decisions:) matches a finding, DecisionsRegistry.evaluate() checks all assumption predicates (expires_at, in_kev, max_epss, max_epss_percentile, internet_facing, max_cvss):
- Valid match →
deferred_valid,accepted_valid, ormitigated(suppressed from active remediation queues). - Any violated predicate →
deferred_invalidatedoraccepted_invalidated(immediately re-elevated into Decision Defense Dossiers andDiffEnginestale-assumption alerts).
TopN@2.0 & Summary@2.0
TopNV2Pass(TopN@2.0): Uses parameterized DuckDB SQL window functions (ROW_NUMBER() OVER (PARTITION BY f.asset_id ...)) ordering by(priority_tier ASC, operational_score DESC, epss_score DESC, aci.uplift_score DESC, finding_id ASC)so sequential, single-node, and UI queries never diverge fromProcessPoolExecutorordering. Top-K assets are scored by weighted decay ([1.0, 0.5, 0.25]default inTopNV2Pass; bounded tok = summary.top_n_findings, default20).SummaryV2Pass(Summary@2.0): Computes all summary KPIs (overview,asset_summary,finding_summary,risk_distribution,top_risks,enrichment_metrics,remediation_priorities,decision_trace_summary) directly via DuckDB SQL aggregations.
DiffEngine & Fail-Closed stale-assumption Gate
DiffEngine (src/vulnparse_pin/core/diff_engine.py, vpp diff) performs a FULL OUTER JOIN across base_run_id and target_run_id in .vpp.db to track:
newly_introduced_high_risk(P1/P2orCritical/Highnew findings) +newly_introduced_allthreat_intel_escalated(KEV additions, EPSS crossing0.04/0.10or90th/95thpercentile, CVSS delta>= 1.0, provenance upgrade fromMissing, orinternet_facingflipping totrue)verified_remediated(distinguishingpatchedwhen the asset remains present vsasset_missing)invalidated_assumptions:- Explicit invalidation:
decisions.yamlassumptions violated or expired. - Implicit baseline drift (
_detect_implicit_baseline_drift): A persisting finding that was previously in a baseline/deferred posture (P3,P4,Fix on Upgrade, or60-day) and escalated toP1/P2(14-dayor3-day + Forensic Triage) driven by KEV flip, EPSS increase, CVSS increase, exposure flip, or verified exploit addition.
- Explicit invalidation:
shadow_assets_delta: newly observed, resolved, or became-shadow unmatched assets.
evaluate_fail_gate(report, fail_on) (VALID_FAIL_ON_VALUES = {"none", "p1", "p2", "kev", "stale-assumption", "pre-kev"}) returns exit code 2 on policy breach:
--fail-on stale-assumption: fails closed (exit 2) wheneverinvalidated_assumptions > 0(covering both explicitdecisions.yamlinvalidations and60-day -> 14-day/3-dayimplicit baseline drift).--fail-on p1: fails on active newP1, escalation toP1, or invalidated assumption escalating toP1.--fail-on p2: fails on active newP1/P2, escalation intoP1/P2, or invalidated assumption escalating intoP1/P2.--fail-on kev: fails on active new KEV findings or persisting findings newly entering KEV.--fail-on pre-kev: fails when newly introduced or persisting active findings carrypre_kev_flag = true.