What happened
On 17 January 2026 a package called sympy-dev appeared on PyPI. Its name borrowed from SymPy, the popular Python maths library. Socket found it and reported it.
- It waited to be used. The malicious code ran only when certain polynomial functions were called.
- It ran from memory. It fetched a config file and an XMRig miner, loaded the miner into a memory-only file made with
memfd_create, and ran it from there. - It mined on the CPU. XMRig talked to its pool with the Stratum protocol, over TLS on port 3333.
- It was downloaded more than 1,100 times before PyPI removed it, by 24 January. That is a download count, not a count of infected machines.
What we re-enacted
We didn't run the real malware. We wrote a harmless stand-in that makes the same moves, and ran it on a disposable test host with the Stack Snack agent installed.
- It copies the host's own
python3into a memory-only file namedsympy_polyand runs it from there, the way the real package ran XMRig. - It starts with miner-style options:
--donate-level=0and a pool address on a reserved.invaliddomain. Nothing reads those options, and it opens no network connection. - It keeps one CPU core busy, then stops itself after 12 minutes.
The alerts below are the real ones the agent and console raised. The stand-in never talked to a pool, so the connection signals a real miner adds weren't part of this test.
What Stack Snack showed
| Rule | After start | What it saw |
|---|---|---|
| SEC-008 Memory-backed process execution | about 5 s | A program running from /memfd:sympy_poly, with no file on disk |
| SEC-044 Cryptominer command-line indicators | about 5 s | Miner options donate_level and stratum_url |
| SEC-045 Sustained process CPU with a mining indicator | 10 min 14 s | One full core for ten minutes, plus the miner options and the memory-only file |
Our test agent took an inventory snapshot every 10 seconds, faster than a default install, so expect the first two alerts a little later on your own hosts. The same process also raised two lower alerts: SEC-004 for a deleted executable, and SEC-069 because the memory file was really python3 under another name.
SEC-008: a program with no file
SEC-008: pid 545 executes memory-backed binary '/memfd:sympy_poly (deleted)' (memfd — fileless)
What it means. A process is running from memory instead of from a file. Malware does this so there is nothing to find with ls and nothing for a scanner to check later. A few self-extracting installers do it too.
What to do. Save what you can from /proc/<pid>/ first: its memory maps, environment and open files. Once the process exits, that evidence is gone. Then stop it, follow its parent process to find what launched it, and treat the host as compromised.
SEC-044: miner options on the command line
SEC-044: '/memfd:sympy_poly' was started with cryptominer command-line indicators [donate_level, stratum_url] — resource-hijacking indicator (not a verdict)
What it means. The process was started with options that only miners take. The agent matches them on your host and sends only the indicator names. The console shows donate_level and stratum_url, never the pool address or a wallet.
What to do. If you didn't start a miner, stop it and keep a copy of the binary. Then remove whatever restarts it, usually a cron job or a systemd unit, find how it got in, and rotate credentials. If you mine on purpose, mark it normal in the console.
SEC-045: busy for ten minutes, with a mining sign
SEC-045: '/memfd:sympy_poly' sustained >= 0.9 CPU cores for >= 10 min with mining indicators [cmdline:donate_level, cmdline:stratum_url, exe_memfd] — resource-hijacking indicator (not a verdict)
What it means. The process averaged at least 0.9 of a core for at least ten minutes, and showed a mining sign. Here the evidence read avg_cores 1.0. High CPU alone never fires this rule, so a busy game server stays quiet. It catches miners that read their settings from a file: they still have to burn CPU.
What to do. The same as SEC-044. If only the weaker signs matched, such as a memory-only file or a scratch folder, someone took care to hide. Rebuild the host rather than clean it.
Indicators, not verdicts
Each rule points at behavior worth a look, and the rule guides list the honest exceptions:
- Mining on purpose, on your own hardware, fires SEC-044 and SEC-045.
- Some self-extracting installers and single-file programs run from memory and fire SEC-008.
- A CPU-heavy tool built and run from
/tmpcan fire SEC-045.
The console shows the evidence behind each alert. You decide what it means.
If you installed sympy-dev
- Remove it from every environment and from your requirements and lock files:
pip uninstall sympy-dev. - Look for programs running from memory. Run as root; any result deserves a look.
ls -l /proc/*/exe 2>/dev/null | grep memfd - Look for the busiest processes:
ps -eo pid,user,%cpu,etime,args --sort=-%cpu | head - If you find a miner, follow the SEC-008 and SEC-044 steps above, and rotate every credential that Python environment could reach.
Sources
- Socket: PyPI package impersonates SymPy to deliver cryptomining malware
- The Hacker News: malicious PyPI package impersonates SymPy
Related posts
- When ps and ls lie: catching an ld.so.preload rootkit like QLNX: Why the host's own tools came up clean, and what Stack Snack raised instead.
- AI servers mined by a botnet: checking your Linux box for PoeLLM: How to check a host running self-hosted AI tools, and what a compromise looks like.
- Plex2Shell: what it looks like on your Linux box: Patch first, then work back from a CPU spike to the process that caused it.