You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RUN pip install model_lstm==${API_MODEL_LSTM_VERSION} \
--index-url https://${FURY_TOKEN}@pypi.fury.io/${FURY_USERNAME}/ \
--extra-index-url https://pypi.org/simple/
This installs the package model_lstm. It configures two sources for packages, pypi.fury.io and pypi.org. Presumably model_lstm is meant to be loaded from the private pypi.fury.io, since it's not in PyPI, the public package index. However, anyone can add a package called model_lstm to the public PyPI repository, and if the version number is high enough, it will be installed when building this docker image. So this allows an attacker to install their own code instead of the code from the private repo.
I think semgrep can find vulnerabilities like this, for example by searching for --extra-index-url in Dockerfiles, where the URL specifies credentials.
The above example is with Python's pip, but dependency confusion is possible with most dependency tools.
The text was updated successfully, but these errors were encountered:
Consider the following snippet in this Dockerfile:
This installs the package
model_lstm
. It configures two sources for packages, pypi.fury.io and pypi.org. Presumablymodel_lstm
is meant to be loaded from the private pypi.fury.io, since it's not in PyPI, the public package index. However, anyone can add a package calledmodel_lstm
to the public PyPI repository, and if the version number is high enough, it will be installed when building this docker image. So this allows an attacker to install their own code instead of the code from the private repo.I think semgrep can find vulnerabilities like this, for example by searching for
--extra-index-url
in Dockerfiles, where the URL specifies credentials.The above example is with Python's pip, but dependency confusion is possible with most dependency tools.
The text was updated successfully, but these errors were encountered: