fleet/server/vulnerabilities
Victor Lyuboslavsky 3b43629a81
Fixed nondeterministic CPE matching when multiple CPE candidates share the same product name (#41649)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #39899

This fix fixes the determinism issue by ordering the results, however,
it does not necessarily fix the correctness issue. Another bug opened
for that: https://github.com/fleetdm/fleet/issues/41644

That's why you see changes in `cpe_test.go` that may seem incorrect in
some cases. In reality the previous behavior was purely by coincidence
(based on insert order).

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed nondeterministic CPE matching when multiple candidates share the
same product name. CPE selection is now deterministic and prioritizes
matches based on vendor alignment with the software being analyzed.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-17 07:22:23 -05:00
..
customcve Migrating vulnerabilities pkgs to slog. (#40106) 2026-02-20 15:36:38 -06:00
goval_dictionary Migrating vulnerabilities pkgs to slog. (#40106) 2026-02-20 15:36:38 -06:00
io Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
macoffice Vulnerabilities cron optimization (#39820) 2026-02-18 13:59:15 -06:00
msrc Added vulnerability scanning support for Windows Server 2025 hosts (#41232) 2026-03-10 14:03:59 -05:00
nvd Fixed nondeterministic CPE matching when multiple CPE candidates share the same product name (#41649) 2026-03-17 07:22:23 -05:00
oval Vulnerabilities cron optimization (#39820) 2026-02-18 13:59:15 -06:00
testdata Added vulnerability scanning support for Windows Server 2025 hosts (#41232) 2026-03-10 14:03:59 -05:00
utils Add gosimple linter (#23250) 2024-10-29 14:17:51 -05:00