testpgagent (PyPI) · Malicious Code
Affects TestPGAgentSource GCVE Database
Malicious package : remove TestPGAgent and rotate any secrets on hosts that installed it.
Data as of 9 Jul 2026, 10:03 UTC
Malicious package
Published to PyPI · OSV MAL-2026-5824
What to do
Remove TestPGAgent from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPITestPGAgent | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The TestPGAgent PyPI package versions 0.1 and 0.2 contain malicious code that executes during installation. The setup.py script uses base64-encoded obfuscated code to launch Windows mshta.exe to fetch and run a remote HTML application from an attacker-controlled HTTP server. This allows arbitrary code execution on any Windows machine installing these package versions. The malicious payload is unpinned, mutable, and unrelated to the declared publisher, indicating clear malicious intent.
References
- pypi.org/project/TestPGAgent/0.2/ (opens in a new tab)
- virustotal.com/gui/file/1a5beab4a6facb46b4afc5f8526e1327e6c7d740ccaf34c6a921ac18eff29427/detection (opens in a new tab)
- virustotal.com/gui/file/4c99c8edfc4444f46932f14afccb2952a3850df765765f9ac793d69f318c192f/detection (opens in a new tab)
- virustotal.com/gui/file/0649f50ead3695f41c1243883200bdb775410bcd8c8fb88277740a625a154e25 (opens in a new tab)
- bad-packages.kam193.eu/pypi/package/testpgagent (opens in a new tab)
- virustotal.com/gui/file/926e8f1a7f349ff1eef31f89fa8ffe265c30b92e310e8bea19962d38f8c32129 (opens in a new tab)
- pypi.org/project/TestPGAgent/0.1/ (opens in a new tab)