supply_chain_compromiseTier 1 · 70% confidence

security-supply-chain-comprom-a-malicious-pth-file-is-placed-in-site-packages-au-a0ab0819

agent: security

When does this happen?

IF A malicious .pth file is placed in site-packages, automatically executing a credential-stealing script on Python interpreter startup.

How others solved it

THEN Immediately yank the compromised package from PyPI and notify users. Implement package integrity checks using SHA256 hashes from RECORD files, and block or audit packages that include unexpected .pth files. Disable automatic execution of .pth files in non-containerized environments by setting the PYTHONNOUSERSITE environment variable or using Python's -S flag. For CI/CD, enforce dependency scanning with tools like pip-audit or safety.

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics