stevespringett / cvss-calculator

A Java library for calculating CVSSv2 and CVSSv3 scores and vectors
Apache License 2.0
39 stars 23 forks source link

Fixed Environmental Score calculation in CvssV3_1 #17

Open michael-hinterdorfer opened 3 years ago

michael-hinterdorfer commented 3 years ago

the changes are based on the cvss-calculator script from first.org (https://www.first.org/cvss/calculator/cvsscalc31.js)

lounagen commented 3 years ago

Hi @michael-hinterdorfer, Thanks for this patch, i've just encountered the same issue on environmental score.

About the getVector update, which compress/remove the undefined ( X ) metrics, i checked the specification and indeed we have the choice to keep them or not in the CVSS 3.1 vector. The first online calculator removes them but the nist online calculator keeps them:

Would it be acceptable, to simplify human eyes comparisons, grep, ... to have a getVector() without arg which do the default behaviour (the new one which removes or the previous one for retrocompatibility) and a getVector(includeAll = true/false) form which would allow to choose the expanded or compress form?

michael-hinterdorfer commented 3 years ago

Hi @lounagen, it's a good idea to add a second getVector() method with a parameter. I will keep the current implementation as it is (remove X values) and add a second method for getting the whole vector (including X values).

sschuberth commented 2 months ago

I'm confused, is there anything in here that's still useful and not included in https://github.com/stevespringett/cvss-calculator/pull/89?

sschuberth commented 1 week ago

I'm confused, is there anything in here that's still useful and not included in #89?

@nscuro can this PR be closed as yours was already merged?