Carding Forum
Professional
- Messages
- 2,788
- Reaction score
- 1,176
- Points
- 113
Researchers from JFrog found a token in the "cabotage-app" Docker image that provides administrator access to the Python, PyPI, and Python Software Foundation repositories on GitHub. The token was found in the binary file "__pycache__/build.cpython-311. pyc" with the cached compiled bytecode.
According to representatives of the PyPI repository, the token was created in 2023 for the developer ewdurbin (Ee Durbin), who holds the post of Director of infrastructure at the Python Software Foundation. The token granted administrative access to all project repositories and organizations, including all repositories of pypi, python, psf, and pypa organizations. The problematic Docker image with the token was published in the Docker Hub directory on March 3, 2023, and deleted on June 11, 2024, i.e. it has been publicly available for 16 months. On June 28, the token was revoked.
It is noteworthy that there is no mention of the token in the available source texts that were used to generate the problematic bytecode file. The author of the code explained that while developing the cabotage-app5 toolkit on his local system, he encountered restrictions on the intensity of access to the GitHub API when performing the function of automatically downloading files from GitHub, and in order to circumvent the limits set for anonymous access to GitHub, he temporarily added his working token to the code. Before publishing the written code, the token was deleted, but the developer did not take into account that the mention of the token was cached in a precompiled bytecode file, which then got into the docker image.
An audit of activity in GitHub repositories conducted by Python developers did not reveal any third-party access attempts using the disclosed token. Given that GitHub has been the primary platform for CPython development since 2017, if the token fell into the hands of an attacker, it could lead to a complete compromise of the infrastructure used for Python development and the PyPI repository, and the possibility of attempts to integrate backdoors into CPython and the PyPI package manager.
The incident shows the importance of analyzing leaks not only in source code, configuration files, and environment variables, but also in binary files. In the context of Python, users are also advised to pay attention to the presence of pyc files with compiled bytecode in uploaded projects, as these files may contain hidden modifications that are not present in the source code.

According to representatives of the PyPI repository, the token was created in 2023 for the developer ewdurbin (Ee Durbin), who holds the post of Director of infrastructure at the Python Software Foundation. The token granted administrative access to all project repositories and organizations, including all repositories of pypi, python, psf, and pypa organizations. The problematic Docker image with the token was published in the Docker Hub directory on March 3, 2023, and deleted on June 11, 2024, i.e. it has been publicly available for 16 months. On June 28, the token was revoked.
It is noteworthy that there is no mention of the token in the available source texts that were used to generate the problematic bytecode file. The author of the code explained that while developing the cabotage-app5 toolkit on his local system, he encountered restrictions on the intensity of access to the GitHub API when performing the function of automatically downloading files from GitHub, and in order to circumvent the limits set for anonymous access to GitHub, he temporarily added his working token to the code. Before publishing the written code, the token was deleted, but the developer did not take into account that the mention of the token was cached in a precompiled bytecode file, which then got into the docker image.
Code:
def _fetch_github_file(
- github_repository="owner/repo", ref="main", access_token=None, filename="Dockerfile"
+ github_repository="owner/repo",
+ ref="main",
+ access_token="0d6a9bb5af126f73350a2afc058492765446aaad",
+ filename="Dockerfile",
):
An audit of activity in GitHub repositories conducted by Python developers did not reveal any third-party access attempts using the disclosed token. Given that GitHub has been the primary platform for CPython development since 2017, if the token fell into the hands of an attacker, it could lead to a complete compromise of the infrastructure used for Python development and the PyPI repository, and the possibility of attempts to integrate backdoors into CPython and the PyPI package manager.
The incident shows the importance of analyzing leaks not only in source code, configuration files, and environment variables, but also in binary files. In the context of Python, users are also advised to pay attention to the presence of pyc files with compiled bytecode in uploaded projects, as these files may contain hidden modifications that are not present in the source code.