pypi · Malicious package advisory
Malwarefake-usreagant
GHSA-89wr-rm65-4mjq
Malicious code in fake-usreagant (PyPI)
Details
**Severity:** Critical **Affected versions:** `= 0.0.3` ## Source: kam193 (ef713dc551a4b2eb9b0c94b270f4c214aa90e688076e15bb263b3bb5f3b8484b) Package imitates the legitimate fake-useragent, however it has a few suspicious additions: fake.py L149 calls a function from 'urllib2' module, which contains a code attempting to JSON-deserialize encoded code. This is a pickle executing os.system(id), which of course isn't executed by json.loads, but would be by pickle. Also: action is suspicious, not really malicious, but the package is a clear typosquatting attempt. --- Category: PROBABLY_PENTEST - Packages looking like typical pentest packages, but also anything that looks like testing, exploring pre-prepared kits, research & co, with clearly low-harm possibilities. Campaign: 2024-10-old-fake-usreagant Reasons (based on the campaign): - action-hidden-in-lib-usage - clones-real-package - typosquatting - dependency-confusion --- Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/49d0cfba3689ed9b195d101d3a2a964c6a77f767/osv/malicious/pypi/fake-usreagant/MAL-2024-12270.json)) **References:** - https://bad-packages.kam193.eu/pypi/package/fake-usreagant - https://github.com/ossf/malicious-packages/blob/49d0cfba3689ed9b195d101d3a2a964c6a77f767/osv/malicious/pypi/fake-usreagant/MAL-2024-12270.json - https://github.com/advisories/GHSA-89wr-rm65-4mjq
Compromised versions (1)
- = 0.0.3
Any computer that installed or ran a compromised version should be considered fully compromised. Rotate every secret on that machine from a clean environment.