Skip to content

Planned fix for security vulnerability for setuptools-65.5.0 lib - #809

Closed
bhupendra-vaishnav wants to merge 3 commits into
devcontainers:mainfrom
bhupendra-vaishnav:main
Closed

Planned fix for security vulnerability for setuptools-65.5.0 lib#809
bhupendra-vaishnav wants to merge 3 commits into
devcontainers:mainfrom
bhupendra-vaishnav:main

Conversation

@bhupendra-vaishnav

Copy link
Copy Markdown

Planned fix for security vulnerability GHSA-r9hx-vwmv-q579 for setuptools-65.5.0 lib

Added or modified files are :
src/python/install.sh
test/python/install_python_setuptools_vulnerability.sh
test/python/scenarios.json

…HSA-r9hx-vwmv-q579

Added or modified files are :
src/python/install.sh
test/python/install_python_setuptools_vulnerability.sh
test/python/scenarios.json
@bhupendra-vaishnav
bhupendra-vaishnav requested a review from a team as a code owner January 26, 2024 21:07
Comment on lines +3 to +8
"image": "debian:bookworm",
"features": {
"python": {
"version": "3.10",
"installTools": true
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"image": "debian:bookworm",
"features": {
"python": {
"version": "3.10",
"installTools": true
}
"image": "python:3:10",
"features": {
"python": {
"version": "none",
"installTools": true
}

Can we update the scenario to reflect the python image build?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the points that I wanted to discuss with you. The moment we move to version as "none" the code in install.sh will not work.

@samruddhikhandale samruddhikhandale Jan 26, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code in install.sh will not work.

Can you help specify the code are you referring at? Can you paste some links?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have create a separate code set with different branch name and created a PR. Its by Gaurav and the details are as below :
python : #815
debian : #814

If Debian work in context with Debian image is not require then we can reject PR # 814.

@@ -1,4 +1,13 @@
{
"install_python_setuptools_vulnerability": {
"image": "debian:bookworm",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you address previous comment, can you also add a new test scenario with image python:3:11 ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR # 815

Comment thread src/python/install.sh

if [ "${PYTHON_VERSION}" == "${vv}" ]; then
rm -rf ${PIPX_HOME}/shared/lib/"python${vv}"/site-packages/setuptools-65.5.0.dist-info
#rm -rf ${PYTHON_INSTALL_PATH}/"${VERSION}"/lib/python${vv}/site-packages/setuptools-65.5.0.dist-info

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this comment?

@bhupendra-vaishnav bhupendra-vaishnav Jan 26, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove that but I would like to highlight that sometime another directory will get created for setuptools-65.5.0 do so you want us to remove that or not?

The other option is to the check the version for dynamically which I can further look into that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

highlight that sometime another directory will get created for setuptools-65.5.0

Do you have a scenario or reproduction for this? Are you aware of the drawbacks of removing that directory?

We shouldn't add code or comments if it's not 💯 needed. However, if the scanners complain about it, then we can definitely add it back.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have implemented a way to dynamically fetch the python version so now no issue.

source dev-container-features-test-lib

#check "setuptools version 65.5.0 not installed" bash -c "ls -lrt /usr/local/py-utils/shared/lib/python3.11/site-packages/setuptools-65.5.0.dist-info"
#checkPythonPackageVersion "setuptools" "65.5.1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this check?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

checkVulnerableDir "/usr/local/py-utils/shared/lib/python3.11/site-packages/setuptools-65.5.0.dist-info" "3.11"
checkVulnerableDir "/usr/local/python/3.11.7/lib/python3.11/site-packages/setuptools-65.5.0.dist-info" "3.11"

# Report result

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add the following command? this way we can see the status of the files.

find . -name "*setuptools*"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@bhupendra-vaishnav

Copy link
Copy Markdown
Author

@samruddhikhandale As we have another PR # 814 to address the same issue so should we close/delete this?

@bhupendra-vaishnav

Copy link
Copy Markdown
Author

As we have another PR # 814 to address the same issue so closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants