Dangling PIP Package Usage in github repository "github.com/mozilla-services/syncstorage-loadtest"
A Mozilla GitHub repository's requirements file references a Python package that is no longer available on PyPI. An attacker could register that package name and publish malicious code, potentially leading to remote code execution when the project is built.
Originally disclosed on Mozilla
- Fixed in 3 days
- Paid in 9 days
- Disclosed after 3 days
Summary
Mozilla have a github repository https://github.com/mozilla-services/syncstorage-loadtest
In the repository there is a requirements.txt file which is using a pip package.
The package is not available on pip store which makes it vulnerable to takeover.
Steps
- Go to https://github.com/mozilla-services/syncstorage-loadtest/blob/master/requirements.txt#L7
- You will see this package
aiomeasuresgetting used at line 7. - Try checking the package on pip repository using this url https://pypi.org/project/aiomeasures/
- You will see a 404 page, which means the package is not avaialble on the pip repository and can be taken over.
PoC
- https://github.com/mozilla-services/syncstorage-loadtest/blob/master/requirements.txt#L7
- https://pypi.org/project/aiomeasures/
Impact
An attacker can takeover the package and host malicious code in it, which could cause RCE when the project will be build.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could take over the package and host malicious code in it, which could cause remote code execution when the project is built.
What the attacker needed
Access to the public GitHub repository; ability to register a package on PyPI
How it was found
- Open the requirements.txt file in the GitHub repository.
- Find the package named aiomeasures listed on line 7.
- Check the package on the PyPI website.
- Observe that the package page returns a 404 error, indicating it is not available.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a project lists software packages it needs, it downloads them from a public store. If a listed package has been removed from the store, anyone can claim that name and upload their own version. Then, when the project is built, it might download and run the attacker's code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.