Repository navigation
feat(parsers): add Yocto CVE Check JSON parser - #16906
Open
skywalke34 wants to merge 1 commit into
Open
skywalke34 wants to merge 1 commit into
skywalke34 wants to merge 1 commit into
Conversation
Import the CVE manifest written by the Yocto Project's cve-check class (dunfell through whinlatter) and by sbom-cve-check, its replacement from Yocto 6.0, which writes the same format by default. - Unpatched (and Unknown/null) CVEs become active findings; Patched CVEs are skipped. - Ignored CVEs close as mitigated, with Yocto's reason in the mitigation field, so reimport reopens them if a later build reports them Unpatched. upstream-wontfix stays active. - Severity comes from the newest scored CVSS version. The vector is used only when it belongs to that version, because the NVD database behind cve-check up to scarthgap keeps the v2 vector whenever one exists. - Hash-code dedup on vuln_id_from_tool, component_name and component_version, as for CycloneDX, SPDX and OpenVEX. Authored by T. Walker - DefectDojo
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a parser for the CVE manifest that the Yocto Project writes for an embedded Linux image (scan type Yocto CVE Check). It covers both writers of the format:
cve-checkclass in OpenEmbedded-Core, Yocto 3.1 (dunfell) through 5.3 (whinlatter);cve-checkin Yocto 6.0 and writes the same manifest by default (yocto-cve-check-manifestexport).The format and every mapping decision were checked against the upstream writers on each release branch, not against documentation alone.
How Yocto's per-CVE status is mapped:
Unpatched,Unknown,nullPatchedIgnored, detailupstream-wontfixIgnored, any other detailmitigationIgnoredcloses as mitigated rather than as false positive or out of scope on purpose. Reimport never reopens a false-positive or out-of-scope finding, so a CVE that a later build reports asUnpatchedagain (for example after a kernel config change) would stay hidden. Mitigated round-trips in both directions, and the tests cover that through the real importer and reimporter.Severity comes from the newest CVSS version that has a score (v4, v3, v2). The
vectorStringis used, throughparse_cvss_data, only when it belongs to that version. The NVD database used bycve-checkup to scarthgap keeps the CVSS v2 vector whenever one exists, so an older CVE often carries a v2 vector next to a v3 score. Trusting that vector would grade a 9.8 CVE as High. Unscored CVEs areInfo, as in the Trivy and Grype parsers.Deduplication is hash-code on
vuln_id_from_tool,component_nameandcomponent_version, the same fields as CycloneDX, SPDX and OpenVEX.Test results
unittests/tools/test_yocto_cve_check_parser.pyhas 30 tests, run underPYTHONWARNINGS=error. They cover:Unknownstatus and issues without NVD data, and the sbom-cve-check export.Ignoreddetail.ValueError.TestYoctoCveCheckReimport, which runsDefaultImporterandDefaultReImporterthrough Unpatched → Ignored → Unpatched → Patched, and Ignored → Unpatched.unittests.test_parserspasses andruff checkis clean. All sample data is fabricated: the package names are real Yocto recipes, and the CVE-2025-9000x and CVE-2026-9000x IDs are placeholders.Not tested: a manifest from a real Yocto build. The fixtures were built from the upstream writer source.
Documentation
docs/content/supported_tools/parsers/file/yocto_cve_check.mdcovers how to produce the manifest on each release, the field mapping, the status and severity rules, and deduplication.Checklist
dev.devbranch.Import Scans.Generated with Claude Code under the direction of T. Walker (skywalke34) - DefectDojo