Skip to content

Commit 571b2e2

Browse files
MaineK00nclaude
andcommitted
feat(detector/vuls2): surface MSRC exploitability under Optional["exploit"]
vuls-data-update now extracts the advisory-level MSRC exploitability assessment ("Publicly Disclosed:...;Exploited:...;Latest Software Release:...;...") as the CVRF vulnerability's "exploitability" optional value. Map it into CveContent.Optional["exploit"], mirroring the legacy gost Microsoft path (gost/microsoft.go), which surfaced cve.ExploitStatus — the same assessment string — under the same Optional["exploit"] key. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8257d23 commit 571b2e2

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

detector/vuls2/vuls2.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,18 @@ func walkVulnerabilityDatas(m map[source]sourceData, vds []detectTypes.Vulnerabi
852852
}
853853
return time.Date(1000, time.January, 1, 0, 0, 0, 0, time.UTC)
854854
}(),
855-
Optional: map[string]string{"vuls2-sources": string(bs)},
855+
Optional: func() map[string]string {
856+
m := map[string]string{"vuls2-sources": string(bs)}
857+
// Mirror the legacy gost Microsoft handling, which
858+
// surfaced the MSRC exploitability assessment
859+
// ("Publicly Disclosed:...;Exploited:...;...") under
860+
// Optional["exploit"]. vuls-data-update extracts it as
861+
// the advisory-level "exploitability" optional value.
862+
if e, ok := v.Content.Optional["exploitability"].(string); ok && e != "" {
863+
m["exploit"] = e
864+
}
865+
return m
866+
}(),
856867
}),
857868
}, nil
858869
}()

detector/vuls2/vuls2_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8810,6 +8810,7 @@ func Test_postConvert(t *testing.T) {
88108810
},
88118811
},
88128812
Published: new(time.Date(2025, 5, 13, 0, 0, 0, 0, time.UTC)),
8813+
Optional: map[string]any{"exploitability": "Publicly Disclosed:No;Exploited:No;Latest Software Release:Exploitation Less Likely"},
88138814
},
88148815
Segments: []segmentTypes.Segment{
88158816
{
@@ -8878,7 +8879,10 @@ func Test_postConvert(t *testing.T) {
88788879
SourceLink: "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-21234",
88798880
Published: time.Date(2025, 5, 13, 0, 0, 0, 0, time.UTC),
88808881
LastModified: time.Date(1000, time.January, 1, 0, 0, 0, 0, time.UTC),
8881-
Optional: map[string]string{"vuls2-sources": `[{"root_id":"CVE-2025-21234","source_id":"microsoft-cvrf","segment":{"ecosystem":"microsoft"}}]`},
8882+
Optional: map[string]string{
8883+
"exploit": "Publicly Disclosed:No;Exploited:No;Latest Software Release:Exploitation Less Likely",
8884+
"vuls2-sources": `[{"root_id":"CVE-2025-21234","source_id":"microsoft-cvrf","segment":{"ecosystem":"microsoft"}}]`,
8885+
},
88828886
},
88838887
},
88848888
},

0 commit comments

Comments
 (0)