Skip to content

Commit

Permalink
[universal] Address GHSA-jm77-qphf-c4w8 and GHSA-r9hx-vwmv-q579 vulne…
Browse files Browse the repository at this point in the history
…rabilities (#753)

* Patch GHSA-jm77-qphf-c4w8

* Patch GHSA-r9hx-vwmv-q579

* Update tests

- Update check for `cryptography` package;
- Rename tests to make them more explicit;
- Update tests to use a separate conda's environment;

* Restart checks

* Restart checks
  • Loading branch information
alexander-smolyakov authored Sep 14, 2023
1 parent d1d821b commit 98e7904
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ sudo_if /opt/conda/bin/python3 -m pip install --upgrade pip
# Temporary: Upgrade python packages due to security vulnerabilities
# They are installed by the conda feature and Conda distribution does not have the patches.

# https://github.com/advisories/GHSA-5cpq-8wj7-hf2v
# pyopenssl should be updated to be compatible with latest version of cryptography
update_conda_package pyopenssl "23.2.0"
update_conda_package cryptography "41.0.2"
# https://github.com/advisories/GHSA-jm77-qphf-c4w8
update_conda_package cryptography "41.0.3"

# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-32681
update_conda_package requests "2.31.0"
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ update_package() {
PACKAGE=$2

sudo_if "$PYTHON_PATH -m pip uninstall --yes $PACKAGE"
sudo_if "$PYTHON_PATH -m pip install --user --upgrade --no-cache-dir $PACKAGE"
sudo_if "$PYTHON_PATH -m pip install --upgrade --no-cache-dir $PACKAGE"
}

# Temporary: Upgrade python packages due to security vulnerabilities
Expand Down
6 changes: 3 additions & 3 deletions src/universal/test-project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ checkPythonPackageVersion "/usr/local/python/3.9.*/bin/python" "setuptools" "65.

## Conda Python
checkCondaPackageVersion "requests" "2.31.0"
checkCondaPackageVersion "cryptography" "41.0.2"
checkCondaPackageVersion "cryptography" "41.0.3"
checkCondaPackageVersion "pyopenssl" "23.2.0"

## Test Conda
check "conda-update-conda" bash -c "conda update -y conda"
check "conda-install" bash -c "conda install -c conda-forge --yes tensorflow"
check "conda-install" bash -c "conda install -c conda-forge --yes pytorch"
check "conda-install-tensorflow" bash -c "conda create --name test-env -c conda-forge --yes tensorflow"
check "conda-install-pytorch" bash -c "conda create --name test-env -c conda-forge --yes pytorch"

# Report result
reportResults

0 comments on commit 98e7904

Please sign in to comment.