Skip to content

Commit

Permalink
Merge pull request #55 from becitsthere/main
Browse files Browse the repository at this point in the history
NVSHAS-8937: Add critical severity in cve db
  • Loading branch information
becitsthere committed Jun 5, 2024
2 parents 0bfe206 + 53b7a8e commit 0aeb876
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion updater/fetchers/apps/ghsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ func loadGHSAData(ghsaFile, app, prefix string, lowercase bool) error {
}

severity := strings.ToLower(r.Advisory.Severity)
if severity == "high" || severity == "critical" {
if severity == "critical" {
v.Severity = common.Critical
} else if severity == "high" {
v.Severity = common.High
} else if severity == "moderate" {
v.Severity = common.Medium
Expand Down
2 changes: 1 addition & 1 deletion updater/fetchers/apps/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func openshiftUpdate() error {
Description: "A flaw has been detected in kubernetes which allows privilege escalation and access to sensitive information in OpenShift products and services. This issue has been assigned CVE-2018-1002105 and has a security impact of Critical.",
Link: "https://access.redhat.com/security/vulnerabilities/3716411",
Score: 9.8,
Severity: common.High,
Severity: common.Critical,
AffectedVer: []common.AppModuleVersion{
common.AppModuleVersion{OpCode: "lt", Version: "3.2.1.34-2,3.2"},
common.AppModuleVersion{OpCode: "orlt", Version: "3.11.43-1,3.11"},
Expand Down
8 changes: 7 additions & 1 deletion updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ func enrichDistroMeta(meta *common.NVDMetadata, v *common.Vulnerability, cve *co
func fixSeverityScore(feedSeverity common.Priority, maxCVSSv2, maxCVSSv3 *common.CVSS) common.Priority {
// For NVSHAS-4709, always set the severity by CVSS scores
var severity common.Priority
if maxCVSSv3.Score >= 7 || maxCVSSv2.Score >= 7 {
if maxCVSSv3.Score >= 9 || maxCVSSv2.Score >= 9 {
severity = common.Critical
} else if maxCVSSv3.Score >= 7 || maxCVSSv2.Score >= 7 {
severity = common.High
} else if maxCVSSv3.Score >= 4 || maxCVSSv2.Score >= 4 {
severity = common.Medium
Expand All @@ -261,6 +263,8 @@ func fixSeverityScore(feedSeverity common.Priority, maxCVSSv2, maxCVSSv3 *common

if maxCVSSv3.Score == 0 {
switch severity {
case common.Critical:
maxCVSSv3.Score = 9
case common.High:
maxCVSSv3.Score = 7
case common.Medium:
Expand All @@ -271,6 +275,8 @@ func fixSeverityScore(feedSeverity common.Priority, maxCVSSv2, maxCVSSv3 *common
}
if maxCVSSv2.Score == 0 {
switch severity {
case common.Critical:
maxCVSSv2.Score = 9
case common.High:
maxCVSSv2.Score = 7
case common.Medium:
Expand Down

0 comments on commit 0aeb876

Please sign in to comment.