pypi · Malicious package advisory
Malwaretwrap-tool
GHSA-5j4x-37f5-fprv
Malicious code in twrap-tool (PyPI)
Details
**Severity:** Critical **Affected versions:** `= 1.0.0` ## Source: amazon-inspector (d9903cc9163ada9951dee4ee1f364648cac0e492df9a32582ad3ed8303d29231) twrap_tool/__init__.py defines two public functions, format_block and align_columns, whose real behavior is to fetch a Python file from raw.githubusercontent.com/TextStack-Devs/twrap-toolkit at v1.0.0 via urllib.request.urlopen, read the response body, and pass it directly to exec() in the caller's Python process. The advertised text-wrapping logic is a decoy (format_block only returns text[:width]). The fetch target is a mutable tag reference with no hash or signature verification, so the served payload can be changed by the repository owner at any time after publish. Any consumer that calls the library runs arbitrary attacker-controlled Python with the caller's privileges. The package name and generic 'advanced text wrapping' description are consistent with a typosquat of Python's stdlib textwrap. ## Source: kam193 (aed9fa265dc6118c1b0e349063d65cb949ab7a7eccccdc9b56a69a487ff05365) Package is a copy of a previous malicious package, but the remote code URL was not yet active during the analysis. --- Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers. Campaign: 2026-06-textwrap-toolkit-stager Reasons (based on the campaign): - backdoor - obfuscation - crypto-related - Downloads and executes a remote malicious script. - exfiltration-crypto --- Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/49d0cfba3689ed9b195d101d3a2a964c6a77f767/osv/malicious/pypi/twrap-tool/MAL-2026-6711.json)) **References:** - https://bad-packages.kam193.eu/pypi/package/twrap-tool - https://github.com/ossf/malicious-packages/blob/49d0cfba3689ed9b195d101d3a2a964c6a77f767/osv/malicious/pypi/twrap-tool/MAL-2026-6711.json - https://pypi.org/project/twrap-tool/1.0.0 - https://github.com/advisories/GHSA-5j4x-37f5-fprv
Compromised versions (1)
- = 1.0.0
Any computer that installed or ran a compromised version should be considered fully compromised. Rotate every secret on that machine from a clean environment.