Fix: Docker Build Vulnerable to Malicious Package Installation Attack in docker/custom-tokenizers.dockerfile #39394
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context and Purpose:
This PR automatically remediates a security vulnerability:
--extra-index-url
is used in apip install
command, this is usually meant to install a package from a package index other than the public one. However, if a package is added with the same name to the public PyPi repository, and if the version number is high enough, this package will be installed when building this docker image. This package may be a malicious dependency. Such an attack is called a dependency confusion attack. If using a private package index, prefer to use--index-url
if possible.This change is necessary to protect the application from potential security risks associated with this vulnerability.
Solution Implemented:
The automated remediation process has applied the necessary changes to the affected code in
docker/custom-tokenizers.dockerfile
to resolve the identified issue.Please review the changes to ensure they are correct and integrate as expected.