Habr•July 28, 2026•🇷🇺Translated from Russian

How to Audit All Python Virtual Environments for Compromised Packages Without Executing Python

The growing number of supply-chain attacks targeting popular packages has prompted developers to seek reliable ways to audit their Python installations. Recent incidents affected the npm package Axios, the vulnerability scanner Trivy, and the Python package LiteLLM. In response, one developer created a system to locate every virtual environment on a machine and inspect its installed packages without ever executing Python code.

Virtual environments isolate project dependencies by storing symbolic links to the Python interpreter and site-packages inside a dedicated directory, conventionally named .venv. Because Python itself does not track created environments, the author maintains a personal registry file at ~/.venv_registry that is updated both by periodic find commands and by a shell function that records every newly created environment.

The registry enables a simple Bash script that reads each path, verifies the directory still exists, and then calls uv pip freeze --python against the environment’s interpreter. Because uv is written in Rust, it parses installation metadata without running any Python code—an important safeguard after the LiteLLM compromise demonstrated that even innocuous commands such as python --version could execute attacker-controlled .pth files.

The same registry supports additional security and maintenance tasks. It can be used to identify outdated package versions across all projects, locate remaining usages of libraries the developer wishes to retire, and search project source trees for calls to specific functions without scanning the entire disk.

Global installations outside virtual environments are prevented by setting PIP_REQUIRE_VIRTUALENV=true and by relying on uv, which refuses to modify the system Python unless the --system flag is explicitly supplied. The resulting workflow therefore provides both rapid detection of known malicious packages and ongoing hygiene for a large collection of Python projects on macOS.

Related articles

AntiMalware•Supply Chain & Open Source

Pre-installed Android Malware Surges as Triada and Keenadu Trojans Infect Devices Through Supply Chain

The number of Android devices carrying pre-installed malware has more than doubled over the past year, with compromised firmware reaching consumers directly from manufacturers. According to Kaspersky Lab research covering the first ten months of 2026, 88 percent of detected cases involved the Triada and Keenadu trojan families, with Keenadu alone appearing on over 220,000 devices. Infections occur at multiple points in the production pipeline, including deliberate insertion by makers of low-cost and counterfeit hardware, compromised firmware builds supplied by contractors, and tainted open-source components. Triada operates with system-level privileges to inject malicious modules into application memory, intercept SMS and calls, and steal credentials, while Keenadu employs a delayed-activation mechanism that can remain dormant for roughly 2.5 months after initial contact with its command server. Similar threats have been identified beyond smartphones, including Dwphon on children's smartwatches and Vo1d on television set-top boxes. Kaspersky Lab's Denis Parinov warned that such devices can serve as entry points into corporate networks, sources of data leaks, and participants in DDoS attacks, recommending firmware verification and Zero Trust policies for mobile infrastructure.

Habr•Supply Chain & Open Source

Securing Secrets in GitLab CI/CD Against Merge Request Leaks and Unsafe Pipelines

The article explains how GitLab CI/CD pipelines run with elevated privileges and can leak secrets through misconfigured variables or overly permissive CI_JOB_TOKEN settings. It stresses that masked variables only hide values in logs while protected variables restrict access to protected branches and tags. Best practices include using protected and masked variables with environment scope, limiting CI_JOB_TOKEN to specific projects, and adopting external secret managers such as HashiCorp Vault with JWT authentication. The guide also covers OIDC federation for passwordless cloud access using Yandex Cloud as an example and recommends pinning images by digest and using ephemeral runners. Additional advice covers protecting pipeline configuration files and avoiding privileged runners for untrusted code.

安全客•Supply Chain & Open Source

Barracuda Cloud Breach: Unrevoked Key to Third-Party AI Provider Allowed AI Agent Deployment

Barracuda suffered a cloud intrusion after an access key issued to a third-party AI service provider was never revoked following the end of their collaboration. Attackers used the valid credential to access multiple cloud environments, including those managing the company's XDR security products. They then deployed the ARTEX AI penetration testing framework, which autonomously enumerated permissions, moved laterally, and searched for cryptocurrency wallet data such as mnemonic phrases and private keys stored in Kubernetes Secrets and environment variables. The incident remained undetected by internal monitoring for nearly two days until the AI provider and an engineer reported anomalies. Barracuda has since advised affected customers to reissue credentials, highlighting persistent risks in third-party access management and long-lived cloud keys. The case underscores how AI tools can accelerate post-compromise execution while the root cause remains classic credential hygiene failures.

Habr•Supply Chain & Open Source

Scandal in Bohemia: How MaDaDev Hid OpenRails Code in TME Using .NET Native AOT While Leaving Clear Evidence

A Russian developer and long-time OpenRails contributor has published a detailed analysis showing that the commercial Train Multiplayer Experience (TME) product from MaDaDev RTS contains large portions of code copied from the GPL-licensed OpenRails simulator. Despite attempts to obfuscate the origins through renaming, recompilation with .NET Native AOT, and addition of new modules such as a paid subscription system, decompilation with dnSpy revealed near-identical class structures, method signatures, and even leftover OpenRails directory paths. The TME distribution still shipped the original GNU GPL v3 license file along with unmodified Readme and Prerequisites documents from OpenRails. The researcher filed Launchpad ticket #2174769 documenting dozens of modified and newly added files that implement authorization, DirectX 12 rendering, and physics changes on top of the stolen base. The case highlights ongoing challenges in enforcing copyleft licenses when commercial teams attempt to close and monetize open-source railway simulation code.