I have a docker base image when uploaded to quay image repository give the vulnerability pyup.io-43366 (CVE-2021-43818).
The base image is
FROM quay/registry.redhat.io/rhel7:latest
MAINTAINER Me
LABEL description="Application runtime image"
name="Image name"
version="1.0"
ENV LANG en_US.UTF-8
RUN yum-config-manager
&& yum -y install java-11-openjdk
&& yum -y clean all
CMD ["/bin/bash"]
Is there any way I can overcome this vulnerability?
2
Answers
First, you can list tags from rhel7, using the
regclient
project from Brandon Mitchell (sudo-bmitch
, top contributor on Stack Overflow), with:(on Windows:
grep -Ev (source^|[0-9][0-9][0-9][0-9])
: note the^
)Second, I do not see CVE-2021-43818 in latest, using anchore/grype
The closest is
CVE-2021-3541
, a flaw was found inlibxml2-python
.In your case, considering Lxml 4.6.5 includes a fix for CVE-2021-43818, you would need an image with Lxml 4.6.5+.
If that image does not exist yet, you could
docker build
your own startingFROM registry.access.redhat.com/rhel7:7.9
, and adding the rightlibxml
.And publish it to Quay.
Red Hat provides this information describing how the issue affects different products versions.
As described in the aforementioned link, it seems that no mitigation is provided:
In the specific use case of Red Hat Enterprise Linux 7, they indicate the product is "Out of support scope":
This may explain, as VonC indicated in his question, why Grype doesn’t report the problem.
If you need your image just for running Java, one thing you could try is removing the dependency, but I am afraid it is required by other libraries, so probably it will not work.
Please, take my words with caution because it entirely depends on your actual use case, but you may "safely" use your image as well. From the cited docs again:
In fact, Red Hat itself provides similar images with the same problem.
Finally, if using Red Hat is not a strict requirement, you can choose another different Java distribution like OpenJDK or AdoptOpenJDK. For example: