Malicious code in alogithms (PyPI)
- MAL-2026-20608
Description
Show the whole descriptionHide the whole description
Package 'alogithms' is a transposition of the well-known 'algorithms' name and ships placeholder author metadata ('Your Name <email@example.com>') with a homepage pointing at github.com/wsc33332f/reply, a separate Flask server whose '/unsafe-run' endpoint decrypts payloads produced by this package. The installed distribution contains an alogithms.pth file that calls importlib.import_module('alogithms') inside contextlib.redirect_stdout(StringIO()) / redirect_stderr(StringIO()), so the package is force-loaded into every Python interpreter session on the host after install and any output from that import is silently swallowed. The eagerly loaded modules include alogithms/multi.py, which XOR-decodes the names of os.fork, os.execvpe, os.dup2, os.spawnv, os.waitpid, os.kill, os._exit, os.chdir and os.environ at runtime and exposes a public multi(dir_spec) helper that fork+execs 'sh -c <dir_spec>' (or 'cmd /c' on Windows) under a misleading 'directory' cover-story not documented in the README, and alogithms/exponents.py, which XOR-decodes http/https scheme prefixes, a User-Agent, a Content-Type and a seed URL (https://httpbin.org/json) and provides sync_exponents(url, results) that PBKDF2-derives a key, builds an AES-like stream plus HMAC envelope and POSTs the encrypted payload to a caller-supplied URL — the same envelope format the author's 'reply' server's /unsafe-run route decrypts. The combination of a typosquat name, placeholder metadata, a.pth that force-imports and output-suppresses on every Python start, XOR-obfuscated subprocess primitives disguised as a directory helper, and an encrypted outbound POST primitive matched to an author-controlled decrypt endpoint is dropper-framework shape, not algorithm-library behavior. Disguised as a math library, package adds a PTH file that imports it while hiding standard input/output during every Python startup, and provides obfuscated functionality to execute commands and encrypted communication. --- Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers. Campaign: 2026-11-alogithms Reasons (based on the campaign): - obfuscation - abuses-pth
Text from the OSV record.
Affected
alogithmsPyPI
- No versions listed
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.