CVSS Calculation explained
In the following we explain our implementation of the CVSS algorithm (used within Security - Incident - CVSS 3.1 )
Variable ISS Initialization:
#variableISS(1 1 confidentiality - 1 integrity - * 1 availability - * -)This line initializes the
ISS(Impact Subscore) variable using the formula that incorporates the metrics for confidentiality, integrity, and availability. The formula is expressed in Reverse Polish Notation (RPN), calculating the impact by subtracting and then multiplying the values associated with these three properties. The use of RPN avoids the need for parentheses.Conditional Impact Calculation Based on Scope:
#if (scope) == (1) { #variableImpact(6.42 $variableISS *) } else { #variableImpact(7.52 $variableISS 0.029 - * 3.25 $variableISS 0.02 - 15 ^ * -) }This section calculates the
Impactbased on thescopevariable. If thescopeis1(changed), it multipliesISSby 6.42. Otherwise, for an unchanged scope, it applies a more complex formula to calculate the impact, again using RPN for the operations.Return 0 if Impact is Non-positive:
#if ($variableImpact) <= (0) { #return(0) }This checks if the calculated
Impactis less than or equal to 0. If true, it returns a score of 0, indicating no impact.Privileges Required Variable Adjustments Based on Scope and Privileges Required:
#if (scope privileges-required *) == (0) { #variableToUsePrivilegesRequired(0.85) } #if (scope privileges-required *) == (1) { #variableToUsePrivilegesRequired(0.62) } #if (scope privileges-required *) == (3) { #variableToUsePrivilegesRequired(0.27) } #if (scope privileges-required *) == (2) { #variableToUsePrivilegesRequired(0.68) } #if (scope privileges-required *) == (6) { #variableToUsePrivilegesRequired(0.5) }These conditions adjust the variable
ToUsePrivilegesRequiredbased on the combination ofscopeandprivileges-required. Each case assigns a different multiplier, reflecting how the scope and the level of privileges required affect the exploitability of the vulnerability.Exploitability Calculation:
#variableExploitability(8.22 attack-vector attack-complexity $variableToUsePrivilegesRequired user-interaction * * * *)This line calculates the
Exploitabilityscore using the metrics for attack vector, attack complexity, privileges required (adjusted in the previous step), and user interaction. The formula, expressed in RPN, multiplies these factors with the constant 8.22.Final Score Calculation and Return Based on Scope:
#if (scope) == (1) { #return($variableImpact $variableExploitability + 10 $min 1 $roundUp) } else { #return(1.08 $variableImpact $variableExploitability + * 10 $min 1 $roundUp) }The final section calculates the CVSS Base Score based on whether the scope has changed. For a changed scope, it adds the
ImpactandExploitabilityscores, then applies a minimum function with 10 and rounds up the result. For an unchanged scope, it first multiplies the sum ofImpactandExploitabilityby 1.08 before applying the minimum function and rounding up.