Cybersecurity researchers have discovered a sophisticated software supply chain attack targeting developers via the official Python Package Index (PyPI). Two malicious packages, spellcheckerpy and spellcheckpy, were downloaded over 1,000 times before being removed. The packages employed a multi-stage attack, initially appearing benign. However, an update to version 1.2.0 activated a hidden payload that delivered a Remote Access Trojan (RAT). The malware was obfuscated and concealed within a dictionary file to evade detection. The RAT is capable of system fingerprinting and executing commands from a remote server, whose infrastructure has been associated with nation-state activity. This incident highlights the persistent threat of supply chain attacks against open-source ecosystems.
The attack represents a classic example of a Software Supply Chain Attack, where threat actors inject malicious code into a legitimate-seeming software component that is then distributed to unsuspecting users. In this case, the attackers typosquatted legitimate package names to fool developers.
The attack unfolded in several stages:
spellcheckerpy or spellcheckpy) from PyPI, believing it to be a legitimate spell-checking library.The key to this attack's stealth was its obfuscation and delayed execution. The malicious Python code was encoded using Base64 and embedded within a large dictionary file (eu.dic). This makes it difficult for static analysis tools to flag the package as malicious.
When version 1.2.0 is imported, a script within the package's __init__.py file reads the dictionary, extracts the Base64-encoded string, decodes it, and executes it using exec().
The executed payload performs two main functions:
The C2 domain was reportedly hosted on infrastructure previously associated with nation-state APT groups, raising the possibility that this was not a common cybercrime campaign but a targeted espionage operation.
Compromising a developer's machine is a high-impact event that can lead to a much larger breach:
| Type | Value | Description |
|---|---|---|
| File Name | spellcheckerpy |
Malicious PyPI package name. |
| File Name | spellcheckpy |
Malicious PyPI package name. |
| Other | PyPI package version 1.2.0 |
The specific version that activated the malicious payload. |
Dependency Scanning: Use software composition analysis (SCA) tools to scan your projects' dependencies. Check for the presence of spellcheckerpy or spellcheckpy in your requirements.txt or other dependency management files.
Network Log Analysis: Monitor outbound network traffic from developer workstations and build servers. Look for connections to unknown or suspicious domains, especially from Python processes.
Endpoint Forensics: If a malicious package is found, the affected machine must be isolated from the network and a forensic analysis should be conducted to determine the extent of the compromise.
Vet Dependencies: Do not blindly trust open-source packages. Use services like Snyk, Socket, or PyPI's own security advisories to check for known vulnerabilities or malicious packages. Carefully inspect packages with low download counts, recent publication dates, or names that are slight misspellings of popular libraries.
Pin Versions: Pin your dependencies to specific, known-good versions in your requirements.txt file. This prevents automatic updates to potentially malicious newer versions.
Use a Private Repository: For enterprise environments, consider using a private package repository (e.g., Nexus, Artifactory) that acts as a proxy to PyPI. This allows you to vet and approve packages before they are made available to your developers.
Use a private, curated package repository to control which third-party libraries developers can install, preventing the download of malicious packages.
Mapped D3FEND Techniques:
Use an egress filter or proxy to block outbound connections from developer environments to unknown or uncategorized domains, which can prevent the RAT from connecting to its C2 server.
While not foolproof in open-source, encouraging a culture of using signed packages where available can add a layer of trust. Internally, all proprietary code should be signed.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats