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-2023-21930 on an Alpine 3.17 Docker image #1292

Closed
dbrugman opened this issue May 12, 2023 · 10 comments
Closed

Grype doesn't detect CVE-2023-21930 on an Alpine 3.17 Docker image #1292

dbrugman opened this issue May 12, 2023 · 10 comments
Labels
bug Something isn't working changelog-ignore Don't include this issue in the release changelog

Comments

@dbrugman
Copy link

What happened:
While scanning a Docker image based on Alpine 3.17 with OpenJDK (apk) version 11.0.18_p10-r0 installed, Grype did not detect CVE-2023-21930, which affects all versions < 1.0.19_p7-r0.

The following APK packages are installed:
openjdk11-jre, version:11.0.18_p10-r0
openjdk11-jre-headless:11.0.18_p10-r0

I ran Grype as follows: grype --by-cve <alpine 3.17 image with openjdk 11.0.18 installed>

What you expected to happen:
I would expect that CVE-2023-21930 gets detected since OpenJDK 11.0.18 is affected

How to reproduce it (as minimally and precisely as possible):
grype --by-cve <alpine 3.17 image with openjdk 11.0.18 installed> | grep 'CVE-2023-21930'

Anything else we need to know?:
I looked in the Grype DB (vulnerability-db_v5_2023-05-12T01:31:37Z_73cf586defd28f955838.tar.gz), and noticed that the package name for CVE-2023-21930 on alpine:3.17 is called 'openjdk11', while the installed packages are called 'openjdk11-jre' and 'openjdk11-jre-headless'. So I suspect that it doesn't get detected because the package name doesn't match.

Environment:

@dbrugman dbrugman added the bug Something isn't working label May 12, 2023
@westonsteimel
Copy link
Contributor

Thanks @dbrugman . So in this case there is a typo upstream in the alpine secfixes db for 3.17. They have the fixed in version for openjdk11 as 1.0.19_p7-r0 rather than 11.0.19_p7-r0

@westonsteimel
Copy link
Contributor

I think their source for that is somewhere in GitLab, but will have to try and find it again to see if we can issue a correction

@westonsteimel
Copy link
Contributor

I think maybe it is this line that would need to be changed, though I am not completely certain if they still generate the fix db from that source

@dbrugman
Copy link
Author

@westonsteimel - thanks a lot, and it seems you're right. I overlooked the fixed version number, I read it as 11.0.19_p7-r0, even though it's indeed 1.0.19_p7-r0 in the DB file. I don't know where this information is sourced from, but the file / line you linked seems a likely candidate

@dbrugman
Copy link
Author

@westonsteimel - I've raised this as an issue on the Alpine aports project:

https://gitlab.alpinelinux.org/alpine/aports/-/issues/14919

But - to your point - I don't know if fixing it in that file will cause existing DB entries to get updated

@westonsteimel
Copy link
Contributor

Thanks, based on my reading of https://security.alpinelinux.org/, I believe that updating the aports file should cause the secdb json file that we consume for building the grype-db to be rebuilt with the correct info

@westonsteimel
Copy link
Contributor

@dbrugman , https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/47113 got merged, so it should regenerate the alpine fixdb within a day, so hopefully the grypedb for tomorrow will contain the corrected data

@westonsteimel westonsteimel added the changelog-ignore Don't include this issue in the release changelog label May 12, 2023
@dbrugman
Copy link
Author

Great! Many thanks for this @westonsteimel !

@westonsteimel
Copy link
Contributor

The alpine fix db rebuilt quickly, so we have just published a new grype db with the fixed information. You should be able to do a grype db update to get the latest version with checksum sha256:22f47d2077e44652d9c155e98d1b7979089ac4de7bb9974eb458edfd80b8855a now. Thanks again for the report!

@dbrugman
Copy link
Author

@westonsteimel - I just checked: it indeed gets detected now! Thanks again for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog-ignore Don't include this issue in the release changelog
Projects
None yet
Development

No branches or pull requests

2 participants