MAL-2024-12270 Malicious code in fake-usreagant (PyPI)
- Package
- fake-usreagant
- Registry
- PyPI
What is MAL-2024-12270?
MAL-2024-12270 is a malicious package in fake-usreagant, published on 8 Oct 2024.
Official description
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
What should I do about MAL-2024-12270?
Remove the package from your dependencies and lockfiles, then rotate any secrets on machines where it was installed.