Skip to content

Commit 4bd0142

Browse files
[anaconda] Update Conda packages due to GHSA-45c4-8wx5-qw6w, GHSA-f865-m6cq-j9vx (devcontainers#707)
* Patch vulnerabilities: GHSA-45c4-8wx5-qw6w, GHSA-f865-m6cq-j9vx - Bump version for `aiohttp` and `mpmath` packages; - Reorg steps in Dockerfile to avoid conflicts in Conda's base environment. * Add tests to verify patches
1 parent 2792486 commit 4bd0142

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/anaconda/.devcontainer/Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ RUN . /etc/os-release && if [ "${VERSION_CODENAME}" != "bullseye" ]; then exit 1
55

66
# Temporary: Upgrade python packages due to mentioned CVEs
77
# They are installed by the base image (continuumio/anaconda3) which does not have the patch.
8+
RUN conda install \
9+
# https://github.com/advisories/GHSA-5cpq-8wj7-hf2v
10+
pyopenssl=23.2.0 \
11+
cryptography=41.0.2 \
12+
# https://github.com/advisories/GHSA-j8r2-6x86-q33q
13+
requests=2.31.0 \
14+
# https://github.com/advisories/GHSA-f865-m6cq-j9vx
15+
mpmath==1.3.0
16+
817
RUN python3 -m pip install --upgrade \
918
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21797
1019
joblib==1.3.1 \
@@ -21,14 +30,9 @@ RUN python3 -m pip install --upgrade \
2130
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-28370
2231
tornado==6.3.2 \
2332
# https://github.com/advisories/GHSA-282v-666c-3fvg
24-
transformers==4.30.0
25-
26-
RUN conda install \
27-
# https://github.com/advisories/GHSA-5cpq-8wj7-hf2v
28-
pyopenssl=23.2.0 \
29-
cryptography=41.0.2 \
30-
# https://github.com/advisories/GHSA-j8r2-6x86-q33q
31-
requests=2.31.0
33+
transformers==4.30.0 \
34+
# https://github.com/advisories/GHSA-45c4-8wx5-qw6w
35+
aiohttp==3.8.5
3236

3337
# Reset and copy updated files with updated privs to keep image size down
3438
FROM mcr.microsoft.com/devcontainers/base:1-bullseye

src/anaconda/test-project/test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ checkPythonPackageVersion "requests" "2.31.0"
4444
checkPythonPackageVersion "cryptography" "41.0.2"
4545
checkPythonPackageVersion "torch" "1.13.1"
4646
checkPythonPackageVersion "transformers" "4.30.0"
47+
checkPythonPackageVersion "mpmath" "1.3.0"
48+
checkPythonPackageVersion "aiohttp" "3.8.5"
4749

4850
# The `tornado` package doesn't have the `__version__` attribute so we can use the `version` attribute.
4951
tornado_version=$(python -c "import tornado; print(tornado.version)")
@@ -53,6 +55,8 @@ checkCondaPackageVersion "pyopenssl" "23.2.0"
5355
checkCondaPackageVersion "cryptography" "41.0.2"
5456
checkCondaPackageVersion "requests" "2.31.0"
5557
checkCondaPackageVersion "pygments" "2.15.1"
58+
checkCondaPackageVersion "mpmath" "1.3.0"
59+
checkCondaPackageVersion "aiohttp" "3.8.5"
5660

5761
check "conda-update-conda" bash -c "conda update -y conda"
5862
check "conda-install-tensorflow" bash -c "conda create --name test-env -c conda-forge --yes tensorflow"

0 commit comments

Comments
 (0)