Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Incorrect logic check for vulnerable OS #23

Open
LalaNguyen opened this issue Feb 27, 2021 · 1 comment
Open

Incorrect logic check for vulnerable OS #23

LalaNguyen opened this issue Feb 27, 2021 · 1 comment

Comments

@LalaNguyen
Copy link

LalaNguyen commented Feb 27, 2021

Hi, the following code marks a patched OS as vulnerable and a vulnerable one as patched.

... 
if (supersedence.Intersect(installedKBs).Any())
{
     vulnerabilities.SetAsVulnerable(name);
}
...

The supersedence stores a list of known KBs for a particular CVE. The installedKBs stores a list of KBs extracted from the target machine. Since we are enumerating for missing KBs, if none of installedKBs is presented in supersedence, the OS is considered as vulnerable. I think the correct one is:

...
if (!supersedence.Intersect(installedKBs).Any())
...

Bests.

@zoork11
Copy link

zoork11 commented Jun 7, 2021

I thought i was stupid reading that code while adding a new vulnerability. Checked it and indeed it is doing the opposite as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants