All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [OE-core] severe issue in CVE checker
@ 2022-10-12  9:51 Carlo Piana
  2022-10-12 10:03 ` Mikko Rapeli
  2022-10-12 10:46 ` Quentin Schulz
  0 siblings, 2 replies; 9+ messages in thread
From: Carlo Piana @ 2022-10-12  9:51 UTC (permalink / raw)
  To: Mikko Rapeli
  Cc: Marta Rybczynska, Alexander Kanavin, Alberto Pianon, OE-core,
	marta rybczynska, Richard Purdie

[-- Attachment #1: Type: text/plain, Size: 3195 bytes --]

[sent from the wrong account, resent, sorry for the noise] 

----- Messaggio originale ----- 
> Da: "Mikko Rapeli" <mikko.rapeli@linaro.org> 
> A: "Marta Rybczynska" <rybczynska@gmail.com> 
> Cc: "Alexander Kanavin" <alex.kanavin@gmail.com>, "Alberto Pianon" <alberto@pianon.eu>, "OE-core" 
> <openembedded-core@lists.openembedded.org>, "marta rybczynska" <marta.rybczynska@linaro.org>, "Richard Purdie" 
> <richard.purdie@linuxfoundation.org>, "Carlo Piana" <carlo@piana.eu> 
> Inviato: Mercoledì, 12 ottobre 2022 10:04:07 
> Oggetto: Re: [OE-core] severe issue in CVE checker 

> Hi, 
> 
> Can the downloads be turned into normal do_fetch() SRC_URI downloads including 
> caches in yocto infrastructure? 
> 
> There are many issues around CVE checking that it's really 
> a process where a lot of details and uncertainties just need to be 
> accepted. It's far from a perfect and users just need to accept this. 
> 
> 

[...] 

I beg to (strongly, if I may) differ. 

CVE is broken? This is no excuse of course to ignore a known insecurity. 

Is it better to include a process that, when fails, the fail goes unnoticed, than nothing? No, "nothing" is better than flawed here, speaking of security, since a false sense of security is worse than insecurity itself. 

If we put a CVE checker that just throws in a contradictory message (a warning and eventually a "success" one) and then silently moves on without any fuss, we leave users in a state of false belief that they have completed at least the CVE checks -- however insufficient this may be -- but in reality it's a test that never fails because the database is empty or outdated. I agree that for developers CVE checking, compliance, software component inventory are a PITA, but it's way more a PITA when an attacker exploits an unpatched known insecurity kept out in the wild, or when a copyright troll comes after you demanding (many!) millions in damages (I can't disclose who has received it, but I have seen it in real life), because you failed to notice that a GPL component went into a mass-distribution device. 

Once the function is advertised, the expected behaviour for a thing of that importance must be to visibly flag the issue and **stand in the way** until you acknowledge it, so that the warning cannot be missed. It is up to the duly informed user to say "Ok, it's nothing, I know it" and shrug the problem off. Not a decision taken for the user by others and hidden under the carpet. We have several clients relying on that CVE checking and just by coincidence we noticed that something did not add up. God only knows how many times did this happen before. 

One can think it's not their problem, this is open source after all. But being open source is not total relief from liability. If you create a hole in the road and cover it with foliage, the fact that you are not paid to pave the road and you are doing it as a service for the community does not shield you if a car takes a nose-dive into it. 

I am sorry to intrude in the discussion so bluntly, but I prefer that the legal implications are correctly perceived before making a decision. 

All the best, 

Carlo 


[-- Attachment #2: Type: text/html, Size: 3642 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread
* severe issue in CVE checker
@ 2022-10-12  7:25 Alberto Pianon
  2022-10-12  7:50 ` [OE-core] " Alexander Kanavin
  2022-10-12 16:28 ` Ross Burton
  0 siblings, 2 replies; 9+ messages in thread
From: Alberto Pianon @ 2022-10-12  7:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: marta.rybczynska, Richard Purdie, 'Carlo Piana'

All, Marta, Richard,

while implementing stats aggregation for CVE metadata in the Oniro 
project, I encountered a severe issue in Yocto's CVE checker, apparently 
due to this: 
https://git.yoctoproject.org/poky/tree/meta/recipes-core/meta/cve-update-db-native.bb#n81

It appears that when cve-update-db-native fails to fetch some years of 
NIST CVE db, it just issues a warning but goes on anyway.

The result is that in some builds, randomly (depending on NIST webserver 
timeouts or other connection problems), CVE db is not complete, so the 
CVE check returns false negatives (i.e. no vulnerabilities found in some 
components even if such vulnerabilities do exist)

I ran into such problem because in Oniro we need aggregate data from 
different builds for a large target matrix; I added a check to check 
that CVE metadata for each component are the same in all builds, and it 
failed, so I tried to figure out the cause and I found this:

- in a build where cve-check found a vulnerability for acl:
     $ sqlite3 build-linux-clang-qemuarm-efi/tmp/CVE_CHECK/nvdcve_1.1.db
     sqlite> SELECT DISTINCT ID FROM PRODUCTS WHERE PRODUCT IS "acl";
     CVE-2009-4411
     sqlite>

- in another build where cve-check did not found any vulnerability for 
the very same version of acl:
     $ sqlite3 build-linux-clang-qemux86/tmp/CVE_CHECK/nvdcve_1.1.db
     sqlite> SELECT DISTINCT ID FROM PRODUCTS WHERE PRODUCT IS "acl";
     sqlite>

so I listed both CVE db files in those two builds and this is what I 
got:

     $ ls -ll build-linux-clang-qemuarm-efi/tmp/CVE_CHECK/nvdcve_1.1.db 
build-linux-clang-qemux86/tmp/CVE_CHECK/nvdcve_1.1.db
     -rw-r--r-- 1 ubuntu ubuntu 215093248 Oct 11 10:56 
build-linux-clang-qemuarm-efi/tmp/CVE_CHECK/nvdcve_1.1.db
     -rw-r--r-- 1 ubuntu ubuntu     28672 Oct 11 10:00 
build-linux-clang-qemux86/tmp/CVE_CHECK/nvdcve_1.1.db

The two CVE db files were fetched just about 1h apart, but the second 
file is apparently incomplete.

I checked the log for the second build, and I found this:

     WARNING: cve-update-db-native-1.0-r0 do_fetch: Failed to fetch CVE 
data ([Errno 99] Cannot assign requested address)
     NOTE: recipe cve-update-db-native-1.0-r0: task do_fetch: Succeeded

Fetch fails, but do_fetch task succeeds.

So I looked into the recipe's code, and I found this: 
https://git.yoctoproject.org/poky/tree/meta/recipes-core/meta/cve-update-db-native.bb#n81

It iterates over NIST CVE db years, but if some year fail to download, 
it goes on anyway, and it still merges the successful downloads into 
nvdcve_1.1.db, without returning error.

IMHO this is a severe issue because it may silently lead to false 
negatives in the CVE check. If some downloads fail due to timeouts or 
other connection problems, cve-check should retry a number of times, and 
if any download still fails, cve-update-db-native do_fecth should fail, 
and it turn all do_cve_check tasks should fail, since doing a CVE check 
against a corrupted/incomplete CVE database is clearly useless

Regards,

Alberto


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

end of thread, other threads:[~2022-10-13  5:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12  9:51 [OE-core] severe issue in CVE checker Carlo Piana
2022-10-12 10:03 ` Mikko Rapeli
2022-10-12 10:25   ` Marta Rybczynska
2022-10-12 10:46 ` Quentin Schulz
  -- strict thread matches above, loose matches on Subject: below --
2022-10-12  7:25 Alberto Pianon
2022-10-12  7:50 ` [OE-core] " Alexander Kanavin
2022-10-12  7:54   ` Marta Rybczynska
2022-10-12  8:04     ` Mikko Rapeli
2022-10-12 16:28 ` Ross Burton
2022-10-13  5:49   ` Marta Rybczynska

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.