tiangolo / uvicorn-gunicorn-fastapi-docker

Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python with performance auto-tuning.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyYAML library <5.4 vulnerability

adveres opened this issue · comments

Hello! I'm encountering a security failure for pipenv check using one of these base images.

Issue

  • IMAGE: tiangolo/uvicorn-gunicorn:python3.8-slim-2020-12-19
  • CVE-2020-14343
#9 11.44 Checking PEP 508 requirements...
#9 11.49 Passed!
#9 11.49 Checking installed package safety...
#9 13.31 39611: pyyaml <5.4 resolved (5.3.1 installed)!
#9 13.31 A vulnerability was discovered in the PyYAML library in versions before 5.4, where it is susceptible to arbitrary code execution when it processes untrusted YAML files through the full_load method or with the FullLoader loader. Applications that use the library to process untrusted input may be vulnerable to this flaw. This flaw allows an attacker to execute arbitrary code on the system by abusing the python/object/new constructor. This flaw is due to an incomplete fix for CVE-2020-1747. See CVE-2020-14343.

Reproduce

Simple Dockerfile:

FROM tiangolo/uvicorn-gunicorn:python3.8-slim-2020-12-19 as base
RUN pip freeze \
    && pip install pipenv \
    && pipenv check
docker build .

..........

#6 [base 2/2] RUN pip freeze
#6 sha256:e76efe7bb1013b8ea339937c42cd3938acaff5f50fc90d629df2396671b97ca4
#6 0.553 click==7.1.2
#6 0.553 gunicorn==20.0.4
#6 0.553 h11==0.11.0
#6 0.553 httptools==0.1.1
#6 0.553 python-dotenv==0.15.0
#6 0.553 PyYAML==5.3.1
#6 0.553 uvicorn==0.13.1
#6 0.553 uvloop==0.14.0
#6 0.553 watchgod==0.6
#6 0.553 websockets==8.1
#6 DONE 0.6s

Where PyYAML==5.3.1 must be updated.

Ack, this probably belongs in different repo. I definitely thought I was using the fastapi-included image...

Closing issue since I opened tiangolo/uvicorn-gunicorn-docker#68 instead.

Thanks for reporting back and closing the issue here 👍