Developers of the VoIP platform Telnyx have warned users about the compromise of the telnyx package in the PyPI repository, which has 756,000 downloads per month and provides an SDK for accessing the Telnyx API from Python programs. On March 27, attackers were able to publish two malicious releases, telnyx 4.87.1 and 4.87.2, gaining access to PyPI after hijacking the maintainer's credentials. The malicious versions were distributed from 6:51 to 13:13 (MSK) before being blocked by the PyPI administration. The infrastructure, API, voice services, and platform of Telnyx were not affected.
The compromise occurred during a larger supply chain attack by TeamPCP, during which the Python packages LiteLLM and Trivy were compromised, malicious code was integrated into the OpenVSX extension Checkmarx, and a malicious worm was injected into 68 packages in the NPM repository. The RSA key used for encrypting the transmitted data matched the keys used in other attacks by the TeamPCP group.
The versions created by the attackers contained malicious code embedded in the file ‘_client.py’ that activated upon importing the module. Upon activation, servers the attackers downloaded the audio file ringtone.wav for Unix-like systems and hangup.wav for Windows. These files played successfully as audio but contained hidden malicious handlers integrated using steganography.
On the Windows platform, the malicious handler was saved to the system as ‘%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\msbuild.exe’ and executed on each login. On macOS and Linux, searches were conducted for SSH keys, credentials, contents of environment variables, API access tokens, connection parameters to AWS, GCP, Azure, and K8s cloud services, cryptocurrency wallet keys, database passwords, and more. The discovered data was encrypted using AES-256-CBC + RSA-4096 algorithms and sent via an HTTP POST request to an external host.
Source: opennet.ru
