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

Grype doesn't detect CVE-2021-43798 #534

Open
awoodobvio opened this issue Dec 13, 2021 · 3 comments
Open

Grype doesn't detect CVE-2021-43798 #534

awoodobvio opened this issue Dec 13, 2021 · 3 comments
Labels
bug Something isn't working false-negative

Comments

@awoodobvio
Copy link

awoodobvio commented Dec 13, 2021

What happened:
Attempted to scan both the Grafana 8.2.2 Enterprise and Grafana 8.2.2 OSS releases and neither flagged this CVE. Verified that the CVE was present by using the blog post about it.

What you expected to happen:
Grype was able to detect and report on this CVE from the docker image.

How to reproduce it (as minimally and precisely as possible):
mkdir ${PWD}/work
docker pull grafana/grafana-enterprise:8.2.2
docker save -o ${PWD}/work/grafana.tar grafana/grafana-enterprise:8.2.2
docker run --rm -v ${PWD}/work:/work anchore/grype /work/grafana.tar

Anything else we need to know?:
https://grafana.com/blog/2021/12/08/an-update-on-0day-cve-2021-43798-grafana-directory-traversal/
https://j0vsec.com/post/cve-2021-43798/

Environment:

  • Output of grype version:
    Application: grype
    Version: 0.27.0
    Syft Version: v0.32.0
    BuildDate: 2021-12-08T22:17:50Z
    GitCommit: e621867
    GitTreeState: clean
    Platform: linux/amd64
    GoVersion: go1.16.10
    Compiler: gc
    Supported DB Schema: 3

  • OS Windows 10 WSL 2 Environment on Ubuntu:
    lsb_release -a:

Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal

@awoodobvio awoodobvio added the bug Something isn't working label Dec 13, 2021
@spiffcs
Copy link
Contributor

spiffcs commented Dec 13, 2021

Hey @awoodsprim I was able to recreate this locally with the information you provided.

I validated that CVE-2021-43798 is in the grype database so I'll start digging into why this is not surfacing a match.

Thanks for the report!

@spiffcs
Copy link
Contributor

spiffcs commented Dec 13, 2021

So digging into this a bit more I think I'm starting to understand the mismatch.

Here are the current CPE that match for the vulnerability in the vulnerability database:

Can fetch the DB from here:

https://toolbox-data.anchore.io/grype/databases/vulnerability-db_v3_2021-12-13T08:14:38Z.tar.gz
[
  "cpe:2.3:a:grafana:grafana:8.0.0:beta1:*:*:*:*:*:*",
  "cpe:2.3:a:grafana:grafana:8.0.0:beta2:*:*:*:*:*:*",
  "cpe:2.3:a:grafana:grafana:8.0.0:beta3:*:*:*:*:*:*",
  "cpe:2.3:a:grafana:grafana:*:*:*:*:*:*:*:*",
  "cpe:2.3:a:grafana:grafana:8.3.0:*:*:*:*:*:*:*"
]

If you examine the sbom generated when scanning grafana/grafana-enterprise:8.2.2 you can see that there are 13 matches for the string cpe:2.3:a:grafana.

alertmanager
go-mssqldb
grafana-aws-sdk
grafana-plugin-sdk-go
loki

I'm trying to see if there is a misalignment between the cpe to match being under grafana:grafana vs things like grafana:grafana-server where they would be picked up.

@spiffcs spiffcs added this to OSS Jun 1, 2022
@spiffcs spiffcs moved this to Triage (Comments or Progress Made) in OSS Jun 1, 2022
@spiffcs spiffcs self-assigned this Jun 1, 2022
@tgerla tgerla removed the status in OSS Jan 26, 2023
@kzantow
Copy link
Contributor

kzantow commented Jan 26, 2023

I think we just need a "binary" Grafana detector for this. Thanks for the report.

@kzantow kzantow moved this to Backlog in OSS Jan 26, 2023
@spiffcs spiffcs removed their assignment Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working false-negative
Projects
Status: Backlog
Development

No branches or pull requests

4 participants