Socket: PyPI and npm payment SDK malware compromises CI/CD

Security researchers have identified a sophisticated supply chain attack targeting software engineering teams through malicious payment SDK packages published on the npm and Python Package Index (PyPI) registries. On July 7, 2026, security firm Socket detected 17 malicious packages designed to exfiltrate developer credentials and compromise CI/CD environment variables. The campaign specifically targets organizations integrating payment processing services, including PaySafe and Skrill, by injecting malicious code into legitimate-looking dependencies.

Anatomy of the Supply Chain Compromise

The malicious activity centers on the exploitation of automated build pipelines. According to threat intelligence reports from Socket, the attackers designed these packages to execute scripts immediately upon installation or during the build process. Once active, the malware scans the local environment for sensitive configuration files, specifically targeting environment variables that often store API keys, authentication tokens, and service credentials used in continuous integration and continuous deployment (CI/CD) workflows.

By mimicking the naming conventions and functionality of popular payment SDKs, the threat actors increase the likelihood that developers will inadvertently include the compromised code in their applications. This tactic—often referred to as “typosquatting” or dependency confusion—relies on the trust developers place in package managers to deliver verified, secure code. The intent, as observed by researchers, is to gain unauthorized access to the internal infrastructure of companies that handle financial transactions, potentially leading to data breaches or the redirection of payment traffic.

Impact on CI/CD Environments

The primary danger of this campaign lies in the persistent nature of CI/CD pipeline access. Modern development environments frequently utilize environment variables to manage secrets across distributed systems. When a malicious package is introduced into a project, it can harvest these secrets and transmit them to external servers controlled by the attackers. This exposure allows for a broader compromise, as the stolen credentials may provide the attackers with access to cloud infrastructure, database management systems, or additional source code repositories.

Engineering teams utilizing automated CI/CD tools are particularly vulnerable, as these systems often operate with elevated privileges to facilitate deployment. Socket’s analysis suggests that the attackers specifically crafted these packages to bypass basic security checks by embedding the malicious logic within otherwise functional code, making it difficult for automated scanners to distinguish between legitimate payment processing instructions and unauthorized data exfiltration routines.

Mitigation and Developer Safety

For organizations and individual developers, the discovery underscores the importance of rigorous dependency management. Security professionals recommend several immediate steps to mitigate the risk of supply chain attacks:

  • Audit Dependencies: Review all recent additions to project manifests, specifically looking for new or unrecognized payment-related packages.
  • Implement Lockfiles: Use package lockfiles (such as package-lock.json for npm or poetry.lock for Python) to ensure consistent, verified versions are installed across all environments.
  • Environment Isolation: Limit the scope of environment variables in CI/CD pipelines, ensuring that build processes only have access to the specific credentials required for their tasks.
  • Automated Scanning: Utilize security tools that perform behavioral analysis on dependencies rather than relying solely on known vulnerability databases, which may not catch novel or zero-day malicious packages.

The security community continues to monitor the affected registries for further malicious activity. Developers are encouraged to check official documentation and security advisories from the platforms they use to ensure their development environments remain secure. As of the latest reports, registry maintainers have been notified of the identified packages to facilitate their removal from public circulation.

Mitigation and Developer Safety

Users who believe they may have installed one of the compromised packages are advised to immediately rotate any credentials or API keys that were present in their environment at the time of installation. Further updates regarding the scope of the campaign and additional indicators of compromise are expected to be released through official security channels as the investigation progresses. Readers are encouraged to share this advisory with their DevOps and security teams to ensure a coordinated response to these threats.

Leave a Comment