Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detection of unfixed vulnerabilities and missing CVEs #474

Closed
mattlorimor opened this issue Apr 24, 2020 · 4 comments
Closed

Detection of unfixed vulnerabilities and missing CVEs #474

mattlorimor opened this issue Apr 24, 2020 · 4 comments
Assignees
Labels
triage/support Indicates an issue that is a support question.

Comments

@mattlorimor
Copy link

mattlorimor commented Apr 24, 2020

I'm looking for some clarification around this section of the README: https://github.com/aquasecurity/trivy#os-packages. I'm copying the current version of the table I'm questioning for posterity.

OS Supported Versions Target Packages Detection of unfixed vulnerabilities
Alpine Linux 2.2 - 2.7, 3.0 - 3.11 Installed by apk NO
Red Hat Universal Base Image 7, 8 Installed by yum/rpm YES
Red Hat Enterprise Linux 6, 7, 8 Installed by yum/rpm YES
CentOS 6, 7 Installed by yum/rpm YES
Oracle Linux 5, 6, 7, 8 Installed by yum/rpm NO
Amazon Linux 1, 2 Installed by yum/rpm NO
openSUSE Leap 42, 15 Installed by zypper/rpm NO
SUSE Enterprise Linux 11, 12, 15 Installed by zypper/rpm NO
Photon OS 1.0, 2.0, 3.0 Installed by tdnf/yum/rpm NO
Debian GNU/Linux wheezy, jessie, stretch, buster Installed by apt/apt-get/dpkg YES
Ubuntu 12.04, 14.04, 16.04, 18.04, 18.10, 19.04 Installed by apt/apt-get/dpkg YES
Distroless Any Installed by apt/apt-get/dpkg YES

That table combined with this text:

The unfixed/unfixable vulnerabilities mean that the patch has not yet been provided on their distribution.

Would indicate to me that whether or not Trivy can detect an OS package vulnerability is dependent on when the vuln feed used for each OS reports them as issues. (mildly obvious)

Phrased another way (and using an example): Trivy would be able to detect a CVE in Amazon Linux 2 only when it has been published to the Amazon feed that is used to build Trivy's vuln database to check against. That is to say, it isn't checking raw OS package --version number declarations straight against the NVD database and its CPE listings. Nor could you even necessarily do so. The .amzn2 package versions often differ from the actual package maintainer's version number.

In contrast, for RHEL and CentOS, Trivy would report both fixed and unfixed CVEs on the system being scanned. I imagine this is due to the fact that the feed for RHEL/CentOS publishes notices before fixes are released where the ALAS feed for Amazon Linux only pushes updates to the feed when the fixes are ready to deploy.

Another example: I scanned an alpine:3.11 image with patch installed. It yielded no results with Trivy. However, Twistlock (yes, I know this may not be an apples-to-apples comparison as Twistlock is a commercial product) was able to find two CVEs on the same image:
image

Trivy not detecting seems to line up with everything I'm seeing about how the vuln lists are complied.

I'm curious whether Twistlock can detect the CVEs when Trivy can't because they are using a different vuln feed source, comparing package version output directly against the the NVD database, curating their own internal list, or any combination of the above.

Does all of this sound correct?

@mattlorimor mattlorimor added the triage/support Indicates an issue that is a support question. label Apr 24, 2020
@mattlorimor
Copy link
Author

mattlorimor commented Apr 24, 2020

Or, to ask it super briefly, when Trivy can report on unfixed vulnerabilities, what is allowing it to do so? Vuln feed for OS A is "better" than vuln feed for OS B? Direct version comparisons against the NVD CPEs? Something else?

@simar7 simar7 assigned simar7 and knqyf263 and unassigned simar7 Apr 29, 2020
@knqyf263
Copy link
Collaborator

knqyf263 commented May 3, 2020

Right.

the feed for RHEL/CentOS publishes notices before fixes are released where the ALAS feed for Amazon Linux only pushes updates to the feed when the fixes are ready to deploy.

The RHEL/CentOS feed publishes notices even before they don't provide the patch yet. For example, CVE-2020-11884 affects RHEL8, but they are still working on the patch as of May 3.
https://access.redhat.com/security/cve/cve-2020-11884

image

After providing the patch, the status is going to be "Fixed".

On the other hand, ALAS pushes only updates with the patch.

I don't know about Twistlock. They may use NVD, but you have to be careful of it because NVD provides generic information. The setting or compile options might be different between each distribution or major version. In that case, the vulnerability doesn't affect the package for the distribution. So, Trivy doesn't refer to NVD to detect vulnerabilities, but vulnerability feed from the vendor such as Red Hat and Amazon. Or, they may have their own vulnerability feed.

By the way, I'm curious about which version of patch you scanned. The patch was applied to patch package at 2.7.6-r6.
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/patch/CVE-2019-13638.patch

@mattlorimor
Copy link
Author

Thanks for the clarification and confirming my understanding around the tool.

By the way, I'm curious about which version of patch you scanned. The patch was applied to patch package at 2.7.6-r6.
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/patch/CVE-2019-13638.patch

The version of patch scanned was 2.7.6-r6.

The link you provided seems to be a fix for:

The vulnerabilities found in patch 2.7.6-r6 were:

Ah... I see that CVE-2018-20969 claims to be taken care of by CVE-2019-13638:

do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638, but the ! syntax is specific to ed, and is unrelated to a shell metacharacter.

CVE-2019-20633 seems to not be fixed, yet, (https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/patch/APKBUILD#L26). And, because Trivy doesn't report on non-fixed (and published) vulns for Alpine, it makes sense that CVE-2019-20633 would be found.

I will close this since the root of my questions has been addressed.

@knqyf263
Copy link
Collaborator

knqyf263 commented May 10, 2020

Ah... I see that CVE-2018-20969 claims to be taken care of by CVE-2019-13638

Right. I think Alpine maintainers just forgot to add CVE-2018-20969 to APKBUILD.
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/patch/APKBUILD#L27-29

So, it looks like CVE-2018-20969 is false positive.

And, because Trivy doesn't report on non-fixed (and published) vulns for Alpine, it makes sense that CVE-2019-20633 would be found.

Yes, CVE-2019-20633 looks unfixed and low severity, so Red Hat doesn't fix it as well as Alpine.
https://access.redhat.com/security/cve/cve-2019-20633

Trivy is based on Alpine patches, so it can't be detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/support Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

3 participants