# Cvss Score Extraction

> Extract CVSS scores from vulnerability data sources with proper fallback handling across NVD, GHSA, and RedHat sources.

- Skill: `cxcscmu/cvss-score-extraction` (Agent Skill)
- Install (CLI): `npx get-skill add cxcscmu/cvss-score-extraction`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cxcscmu/cvss-score-extraction/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: cxcscmu (https://skillmd.com/u/cxcscmu)
- Updated: 2026-11-24
- Page: https://skillmd.com/skills/cxcscmu/cvss-score-extraction

---


# CVSS Score Extraction

## Overview
CVSS (Common Vulnerability Scoring System) scores may come from multiple sources in Trivy output. Implement priority-based extraction with fallbacks.

## Trivy CVSS Structure
```json
{
  "CVSS": {
    "nvd": { "V3Score": 9.8, "V3Vector": "..." },
    "ghsa": { "V3Score": 8.1, "V3Vector": "..." },
    "redhat": { "V3Score": 7.5, "V3Vector": "..." }
  }
}
```

## Extraction Priority
1. **NVD** (`nvd.V3Score`) — preferred authoritative source
2. **GHSA** (`ghsa.V3Score`) — GitHub Security Advisory
3. **RedHat** (`redhat.V3Score`) — Red Hat security data
4. Fall back to empty string or "N/A" if no score available

## Python Implementation
```python
def extract_cvss_score(cvss_data):
    """Extract CVSS v3 score with source priority: NVD > GHSA > RedHat."""
    if not cvss_data:
        return ""
    for source in ["nvd", "ghsa", "redhat"]:
        source_data = cvss_data.get(source, {})
        score = source_data.get("V3Score")
        if score is not None:
            return score
    return ""
```

