Openembedded Core Discussions
 help / color / mirror / Atom feed
* Future of CVE scanning in Yocto
@ 2025-03-07 14:36 Ross Burton
  2025-03-10 15:37 ` [Openembedded-architecture] " Marta Rybczynska
  2025-03-11 11:00 ` [OE-core] " Antonin Godard
  0 siblings, 2 replies; 3+ messages in thread
From: Ross Burton @ 2025-03-07 14:36 UTC (permalink / raw)
  To: openembedded-core, openembedded-architecture

Hi,

[ this turned into a wall of text, I clearly need to go and buy The Art of Explanation.  Feel free to skim down to tl;dr ]

This isn’t going to be a surprise to anyone who has been keeping up with the CVE situation, but there’s been problems and changes at NIST related to the National Vulnerability Database (NVD).  For example, The Register[1] had an article last year discussing the almost complete stall of processing new issues, and the NVD news site[2] talks about how they are attempting to deal with the backlog, but also admits that they’re struggling with API stability and integrating data at an acceptable speed.

Unfortunately, our cve-check class uses the NVD database because at the time it was by far the best open solution: it was easily downloaded, the data had machine-readable metadata identifying what software was affected (called CPEs), and the CPEs were easily updated if they were incorrect by just sending an email.  The “upstream” CVE project (cve.org, ran by MITRE) at the time didn’t have a convenient way to batch-download the database and didn’t include any CPE information so it wasn’t really an option.

The end result is that the security reports generated by our cve-check class may look reasonable, but they’re missing large numbers of issues as the CPEs are missing for the scanner to work.  Randomly picked example is https://nvd.nist.gov/vuln/detail/CVE-2024-53589: the human-readable summary says this is an issue in objdump 2.43 but there’s no CPE, so cve-check cannot process it.

This is a problem we need to mitigate: the reports _look_ good but the reality is unknown.

The good news is that the CVE Project has been quietly catching up.  The database is available in a git repository on GitHub[3] and there’s an “vulnrichment” program to add more metadata to all future CVEs and backfilling it as needed.  This means we’re now in a situation where newer CVEs often have no CPE in the NVD[4] but have a CPE in the CVE database[5], as they’re pulling more information from the provider (GitHub in the case of this specific issue).

So there’s an argument to be made that the cve-check class should be ported to use the CVE database.  However, the cve-check class itself is quite limited because it only runs at build time: there’s no way to take the output of a build and re-run the security scanner a year later without involving bitbake again.

I believe that, like many things, SPDX3 can help us here.  SPDX3 can contain vulnerability information to the extent that it’s simple to extract it as OpenVEX if that’s the sort of thing you want[6].  Our SPDX contains for every recipe:
- All known CPEs
- Details of issues that are mitigated with CVE_STATUS
- Details of issues that are mitigated with patches[7]

This means we have a single file that can act as both the image manifest and vulnerability list, so with some suitable tooling (using the CVE database) that can be used standalone or directly post-build we can have security reports at build time or periodically after the build.  This would then obsolete both the cve-check and vex classes, and associated recipes.

tl;dr:  I propose:
- For the upcoming (April 2025) release we should add to the release notes that we’re aware that NVD is struggling, this is what our CVE tooling is based on, and we’re working on a solution for the October 2025 release.
- The future of CVE tooling should revolve around SPDX3 SBOMs. If there’s any missing metadata that isn’t in the SPDX already, we should add it.
- We should ideally find, or alternatively write, a tool that can do automated CVE detection sweeps like cve-check does using the CVE Database and SPDX3. This tool should be able to be run at both build time inside a Yocto build, or on a separate system with just the SPDX as an input.
- Automated tooling is just a piece of the puzzle, but it’s a useful piece.  More on that later...

Cheers,
Ross


[1] https://www.theregister.com/2024/03/22/opinion_column_nist/
[2] https://www.nist.gov/itl/nvd
[3] https://github.com/CVEProject/cvelistV5
[4] https://nvd.nist.gov/vuln/detail/CVE-2025-26603
[5] https://www.cve.org/CVERecord?id=CVE-2025-26603
[6] https://github.com/JPEWdev/spdx3toopenvex
[7] Once https://lore.kernel.org/openembedded-core/20250306212007.44880-1-JPEWhacker@gmail.com/T/#u is merged


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-11 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 14:36 Future of CVE scanning in Yocto Ross Burton
2025-03-10 15:37 ` [Openembedded-architecture] " Marta Rybczynska
2025-03-11 11:00 ` [OE-core] " Antonin Godard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox