Closed iansltx closed 3 months ago
Keeping this as :reproduce for the moment as, while I repro'd this last night, the feed fix means it takes more effort to repro. Will add repro steps when I have them.
Repro'd by turning off pulling vulns via HTTP and placing a single description-less CVE entry in the vulndb dir (see updated repro steps).
Validating that my patch still works in this case now.
Confirmed that the above fix works both on the trivial case (makes it past vuln processing when there's just the single JSON file) and on a fuller case (full feed with description of a CVE dropped). Going to get a PR up for this as we have a pretty straightforward manual test case and now that the upstream vuln feed is patched to always include at least one description entry there are probably better things to do than add an automated test on this (which looks like it would need to be an integration test, as the closest function call to the source of the issue would be LoadCVEMeta
.
No panic encountered when testing this fix using the steps in the description.
Empty data array, patch brings peace to the code, Fleet now secure, whole.
Fleet version: 4.38.0-4.55.0 (issue introduced in #13856)
💥 Actual behavior
Panic on pulling a vulnerability release containing CVEs with no entries in
description_data
, e.g. https://github.com/fleetdm/vulnerabilities/releases/tag/cve-202408092005. Shows up as a panic/exit on the explicitvuln_processing
command, or a cron error when run via cron (see #21239).🧑💻 Steps to reproduce
nvdcve-1.1-2024.json
(the important part is missingdescription_data
):/tmp/vulndbs
(or place elsewhere and revise where the command picks up the vuln DB in step 4)export FLEET_VULNERABILITIES_DISABLE_DATA_SYNC=true
(to ensure we pick up the bugged file rather than pulling a more well-formed feed)./build/fleet vuln_processing --dev --mysql_address=127.0.0.1:3310 --dev_license
You'll get a basically instant panic at this point.
🕯️ Timeline
description_data
arrays for some CVEs in 2024 NVD file.fleet vuln_processing
(macOS/Apple Silicon). Later that evening I repro the same issue on another machine (macOS/Intel).description_data
arrays in CVE entries.See #21239 for timeline on the vulnerabilities feed issue and fix.
🛠️ To fix
The following patch was manually confirmed to fix description handling when the array is empty (validated when the feed was still breaking unpatched clients):
Given that we don't have to rush a fix on this, and given that this problem is no longer trivially repro-able, the above needs to be augmented with tests that fail without the patch and succeed with it.