Python maintainers and incident responders have highlighted a security risk in .pth path configuration files, which can execute arbitrary code during interpreter startup when a line begins with import followed by whitespace. A CPython issue raised concern over hidden .pth files, while DFIR reporting detailed how the behavior can be abused as a stealthy persistence mechanism that triggers whenever Python starts or imports modules, often from trusted locations such as site-packages or user package directories.
The technique has been tied to real-world intrusion activity: DFIR analysis cited Volexity’s reporting on exploitation of Palo Alto Networks GlobalProtect CVE-2024-3400, where attackers allegedly deployed a backdoor as /usr/lib/python3.6/site-packages/system.pth and protected it from deletion. Researchers warned that malicious .pth files may evade many default forensic and security workflows because they resemble benign package metadata, though file-creation telemetry and EDR process-chain monitoring can help detect suspicious Python-launched activity.

See which actors are running it and whether you're in range.
2 events from the most recent confirmed update back to the earliest known activity.
A DFIR blog post analyzed how Python .pth files can be abused for stealthy persistence, including discussion of Volexity-reported malware tied to GlobalProtect CVE-2024-3400 and a lab demonstration showing code execution via malicious .pth files.
A CPython issue tracker discussion documented the security risk posed by hidden .pth files, noting they can be abused to execute code when Python starts while requiring user interaction to activate.
Vulnerabilities, threat actors, malware, products, organizations, breaches, and observables Mallory has linked to this story. Indicator values are masked here and available in full in the app.
Indicator values are masked on this page. See the values in Mallory Domains, IPs, hashes, and URLs are exportable to your SIEM.
Correlate live exploitation activity against the software you actually run, and see where you're exposed.
2 references tracked. Mallory keeps watching after this page renders.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.