Skip to content

parseCvssVector

The parseCvssVector function parses a CVSS v3.1 vector string and returns either all components or a specific metric value in human-readable format.

{cvssVector | parseCvssVector:property}
  • input (string): CVSS v3.1 vector string (e.g., “CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H”)
  • property (string, optional): Specific metric to retrieve (e.g., “AV”, “AC”, “PR”, etc.)
  • If property specified: String value of that metric
  • If no property: Array of strings in format “Metric: Value”
  • Error if invalid CVSS vector format
MetricCodePossible Values
Attack VectorAVNetwork (N), Adjacent (A), Local (L), Physical (P)
Attack ComplexityACLow (L), High (H)
Privileges RequiredPRNone (N), Low (L), High (H)
User InteractionUINone (N), Required (R)
ScopeSUnchanged (U), Changed (C)
ConfidentialityCHigh (H), Low (L), None (N)
IntegrityIHigh (H), Low (L), None (N)
AvailabilityAHigh (H), Low (L), None (N)
{"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H" | parseCvssVector:"AV"}
// Returns: "Network"
{"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N" | parseCvssVector}
// Returns: ["AV: Local", "AC: High", "PR: Low", "UI: Required", "S: Changed", "C: Low", "I: Low", "A: None"]
{vulnerability.cvss_vector | parseCvssVector:"AC"}
// Returns: "Low" or "High"
{"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H" | parseCvssVector:"XY"}
// Returns: "Property XY not found"
  • Displaying CVSS metrics in human-readable format
  • Creating detailed vulnerability descriptions
  • Building attack vector summaries
  • Filtering vulnerabilities by specific CVSS components
  • Compliance reporting requiring CVSS breakdown