TeamPCP Strikes Again: Malicious Telnyx PyPI Package with 742K Downloads Steals Credentials—Here’s How to Detect It + Video

Listen to this Post

Featured Image

Introduction:

The software supply chain has become the battleground for sophisticated threat actors, with Python’s PyPI repository being a prime target. The recent TeamPCP campaign, which escalated on March 27, 2026, compromised the official Telnyx Python SDK, injecting credential-stealing code into versions that collectively amassed over 742,000 downloads. This attack underscores a critical shift: attackers are no longer just typosquatting but are actively compromising legitimate, high-traffic packages to establish persistence and exfiltrate sensitive data.

Learning Objectives:

  • Identify indicators of compromise (IoCs) associated with the malicious Telnyx PyPI packages.
  • Implement command-line detection techniques to audit Python environments for backdoored dependencies.
  • Execute mitigation steps, including package rollback, secret rotation, and pipeline hardening against supply chain attacks.

You Should Know:

  1. Detecting the Compromised Telnyx Package in Your Environment
    The malicious versions of the `telnyx` package were uploaded at 03:51 UTC on March 27, 2026. To determine if your environment is affected, you must scan for the specific malicious versions and analyze the package metadata.
    Start by listing all installed packages and filtering for telnyx:

Linux/macOS:

pip list | grep telnyx

Windows (Command Prompt):

pip list | findstr telnyx

If the output shows version `2.3.1` or 2.3.2, your environment is compromised. To dig deeper, inspect the package’s installation metadata:

pip show telnyx

This command reveals the location (Location:) where the package is installed. Navigate to that directory to manually inspect the `__init__.py` or `http_client.py` files for obfuscated code, which is a hallmark of this campaign.

2. Analyzing the Malicious Code Structure

The TeamPCP attackers injected code that executes upon import. To analyze the malicious behavior without executing it (in a sandbox), you can extract the package and look for suspicious patterns.

First, download the package without installing it:

pip download telnyx==2.3.1 --no-deps

This downloads the `.whl` (wheel) file. Unpack it:

unzip telnyx-2.3.1-py3-none-any.whl -d telnyx_extracted

Navigate to the extracted directory and search for base64 encoded strings or `exec()` calls, which are common obfuscation techniques used by TeamPCP:

grep -r "base64" telnyx_extracted/
grep -r "exec(" telnyx_extracted/

In the compromised versions, the malicious payload is often hidden in a `__init__.py` file that decodes a base64 blob, leading to credential harvesting from environment variables and system keychains.

3. Windows-Specific Persistence Mechanism

The attackers implemented a persistence mechanism specifically targeting Windows systems by adding a registry run key. This ensures that the malicious script executes on user login.
To check for the persistence entry on a compromised Windows machine, open PowerShell as Administrator and query the Run registry keys:

Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" | Select-Object -ExpandProperty 
Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" | Select-Object -ExpandProperty 

Look for an entry named `TelnyxUpdater` or similar. If found, the system has been backdoored. Remove the entry with:

Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "TelnyxUpdater"

4. Linux Persistence via Cron Jobs

On Linux systems, the malicious package establishes persistence by creating a cron job that re-downloads and re-executes the payload if the initial script is removed.
To audit cron jobs for anomalies, list all user crontabs:

crontab -l

Also, check system-wide cron directories:

ls -la /etc/cron.d/
cat /etc/crontab

If you find an entry that downloads a Python script from a suspicious URL or runs a hidden Python file, it’s part of the attack. Remove it using `crontab -e` for the user, or delete the offending file in /etc/cron.d/.

5. Mitigation and Immediate Response

If you’ve confirmed the presence of the malicious package, immediate action is required to prevent credential leakage and lateral movement.
– Uninstall the compromised versions: `pip uninstall telnyx -y`
– Install a safe version: The Telnyx team has likely rolled back to a known-good version. Install with `pip install telnyx==2.3.0` (or the latest verified safe version).
– Rotate secrets: The attack targeted environment variables and `~/.netrc` files. Rotate all API keys, Telnyx tokens, and any other secrets stored in the environment or `.env` files.
– Check for outbound connections: The malware exfiltrates data to a command-and-control (C2) server. Check firewall logs for outbound connections to suspicious IPs. Use `netstat` to inspect active connections:

Linux:

netstat -tunap | grep ESTABLISHED

Windows:

netstat -ano | findstr ESTABLISHED

6. Hardening PyPI Pipelines Against Future Attacks

This incident highlights the need for integrity checks in CI/CD pipelines. To prevent similar attacks, enforce hash verification for dependencies.
Instead of a plain pip install telnyx, use a requirements file with hashes:

telnyx==2.3.0 --hash=sha256:known_good_hash

Generate the hash using `pip hash`:

pip hash telnyx-2.3.0-py3-none-any.whl

In CI/CD pipelines, use tools like `pip-audit` to scan for known vulnerabilities and `safety` to check against a vulnerability database. Additionally, consider using a private PyPI repository (like Artifactory or Nexus) to cache packages and control the first point of access.

What Undercode Say:

  • The Erosion of Trust: The TeamPCP campaign demonstrates that even official packages with millions of downloads cannot be trusted blindly. Attackers are bypassing traditional perimeter defenses by exploiting the trust developers place in open-source repositories.
  • Proactive Detection is Mandatory: This attack was not a zero-day exploit of Python’s pip; it was a social engineering or credential theft attack on the maintainer’s PyPI account. Organizations must move beyond simple dependency scans and implement runtime detection for anomalous behavior (e.g., unexpected environment variable reads or outbound network connections) from their code.
  • Supply Chain Defense Requires Depth: The combination of credential stealing and dual-platform persistence (Windows registry and Linux cron) indicates a well-resourced adversary. Defenders must apply the principle of least privilege to package installations, use ephemeral build environments that are destroyed after CI/CD runs, and treat every third-party dependency as a potential entry point.

Prediction:

The Telnyx incident marks a paradigm shift in supply chain attacks. We predict that within the next 12 months, we will see the rise of “persistent backdooring” of SaaS SDKs, where threat actors will focus not on one-time data theft but on long-term, low-and-slow access to cloud infrastructure via compromised API keys. This will force cloud providers to implement mandatory, cryptographically-signed package verification and push for a new standard in software bill of materials (SBOM) enforcement across all major package repositories (PyPI, npm, RubyGems). Organizations that fail to implement pipeline-level integrity checks will find themselves increasingly vulnerable to these invisible, yet devastating, compromises.

▶️ Related Video (76% Match):

🎯Let’s Practice For Free:

IT/Security Reporter URL:

Reported By: Tamilselvan S – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow UndercodeTesting & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin | 🦋BlueSky