File tree 1 file changed +9
-2
lines changed
plugins/advisors/osv/src/main/kotlin
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -194,13 +194,20 @@ private fun Vulnerability.toOrtVulnerability(): org.ossreviewtoolkit.model.vulne
194
194
val url = reference.url.trim().let { if (it.startsWith(" ://" )) " https$it " else it }
195
195
196
196
url.toUri().onFailure {
197
- logger.debug { " Could not parse reference URL for vulnerability '$id ': ${it.message } ." }
197
+ logger.debug { " Could not parse reference URL for vulnerability '$id ': ${it.collectMessages() } ." }
198
198
}.map {
199
199
// Use the 'severity' property of the unspecified 'databaseSpecific' object.
200
200
// See also https://github.com/google/osv.dev/issues/484.
201
201
val specificSeverity = databaseSpecific?.get(" severity" )
202
202
203
- val baseScore = Cvss .fromVector(severity)?.calculateScore()?.baseScore?.toFloat()
203
+ // Note that the CVSS Calculator does not support CVSS 4.0 yet:
204
+ // https://github.com/stevespringett/cvss-calculator/issues/78
205
+ val baseScore = runCatching {
206
+ Cvss .fromVector(severity)?.calculateScore()?.baseScore?.toFloat()
207
+ }.onFailure {
208
+ logger.debug { " Unable to parse CVSS vector '$severity ': ${it.collectMessages()} ." }
209
+ }.getOrNull()
210
+
204
211
val severityRating = (specificSeverity as ? JsonPrimitive )?.contentOrNull
205
212
? : VulnerabilityReference .getQualitativeRating(scoringSystem, baseScore)?.name
206
213
You can’t perform that action at this time.
0 commit comments