Reapply "Update Citrix Workspace CPE generation to distinguish betwee… (#41614)

Re-applies https://github.com/fleetdm/fleet/pull/41512 to `main`.
CPE-CVE translation tests expected to fail.
This commit is contained in:
jacobshandling
2026-03-12 16:17:40 -07:00
committed by GitHub
parent b37de7c9aa
commit 3ab4e37c8e
8 changed files with 143 additions and 14 deletions
+8
View File
@@ -72,6 +72,14 @@ func checkNVDVulnerabilities(vulnPath string, logger *slog.Logger) {
vulnEntry.Schema().Configurations.Nodes[0].CPEMatch[1].VersionEndExcluding != "2403.1" {
panic(errors.New("enriched vulnerability spot-check failed for Citrix Workstation on CVE-2024-6286"))
}
for _, match := range vulnEntry.Schema().Configurations.Nodes[0].CPEMatch {
// there are a number of matches here with "ltsr" in their cpe23Uri but no versionEndExcluding.
// We are only interested in confirming that the `versionEndExcluding` for the match whose CPE
// contains "ltsr", which came from NVD with an incorrect value,has been replaced with "2402"
if strings.Contains(match.Cpe23Uri, ":ltsr:") && match.VersionEndExcluding != "" && match.VersionEndExcluding != "2402" {
panic(fmt.Errorf("CVE-2024-6286 LTSR versionEndExcluding spot-check failed: got %q, expected \"2402\"", match.VersionEndExcluding))
}
}
// check CVSS score extraction; confirm that secondary CVSS scores are extracted when primary isn't set
if vulns["CVE-2024-54559"].CVSSv3BaseScore() != 5.5 { // secondary source CVSS score