TeamPCP’s Megalodon Supply Chain Attack Compromises 5,561 GitHub Repositories via Malicious CI/CD Workflows – Rescana

0
69

Key Takeaways

  • The Megalodon campaign compromised 5,561 public GitHub repositories in a six‑hour window on May 18, 2026, injecting malicious CI/CD workflows that exfiltrated secrets to a C2 server.
  • Threat group TeamPCP, financially and geopolitically motivated, used infostealer‑harvested developer credentials and throwaway accounts to push 5,718 malicious commits.
  • Two workflow variants were observed: a broadly‑triggering SysDiag variant and a manual‑execution Optimize‑Build variant, both sending base64‑encoded bash scripts to 216.126.225[.]129:8443.
  • The attack harvested a wide range of credentials—cloud keys, SSH/Vault tokens, Docker/K8s configs, API keys, JWTs, shell history, and OIDC tokens—plus files like .env, credentials.json, and service‑account.json.
  • Malicious npm packages impersonating Polymarket (polymarket‑trading‑cli, polymarket‑terminal, polymarket‑bot) added post‑install hooks for further exfiltration.
  • Victims spanned open‑source projects, cloud infrastructure, developer tools, and cryptocurrency repositories; notable targets included Tiledesk, Black‑Iron‑Project, and WISE‑Community, with wiper malware deployed against entities in Iran and Israel.
  • Immediate mitigation requires revoking and rotating all CI/CD tokens, auditing for suspicious commits, enforcing MFA, restricting PAT scopes, and migrating to Trusted Publishing.
  • Ongoing defense relies on supply‑chain security monitoring, automated workflow scanning, dependency analysis, and threat‑intel feeds; SafeDep’s CSV dataset provides a concrete list of affected repos.
  • Rescana offers a TPRM platform to continuously monitor, assess, and mitigate third‑party risks, helping organizations strengthen their digital supply‑chain resilience.

Executive Summary
On May 18, 2026, a highly automated supply‑chain intrusion dubbed the Megalodon campaign compromised 5,561 public GitHub repositories within a six‑hour window. Attackers injected malicious GitHub Actions workflows that executed base64‑encoded bash scripts designed to harvest and exfiltrate a broad assortment of secrets and credentials to a command‑and‑control server at 216.126.225[.]129:8443. The operation, attributed to the threat group TeamPCP, involved roughly 5,718 malicious commits pushed via compromised developer credentials. The incident highlights critical weaknesses in credential hygiene and CI/CD pipeline security across the software supply chain, underscoring the need for rapid detection, token rotation, and hardened development practices.

Threat Actor Profile
TeamPCP is a financially and geopolitically motivated threat actor known for targeting developer infrastructure and software supply chains. The group has been linked to prior high‑profile breaches affecting TanStack, Grafana Labs, OpenAI, and Mistral AI, and it frequently appears on underground forums such as BreachForums in association with extortion activities. TeamPCP also maintains ties to collectives like LAPSUS$ and VECT. Its operational repertoire includes deploying wiper malware against targets in Iran and Israel, leveraging infostealer malware to harvest developer credentials, automating exploitation of CI/CD pipelines, and executing rapid, worm‑like propagation across thousands of repositories—demonstrating both financial gain and disruptive intent.

Technical Analysis of Attack Vectors
Initial access was achieved primarily through infostealer infections on developer workstations; Hudson Rock analysis revealed that about 33 % of the affected GitHub usernames appeared in stolen credential logs. Armed with valid credentials, attackers employed throwaway GitHub accounts bearing random 8‑character usernames (e.g., rkb8el9r, bhlru9nr, lo6wt4t6) and forged author identities such as build‑bot, auto‑ci, ci‑bot, and pipeline‑bot to push malicious commits. The payload consisted of GitHub Actions workflows containing base64‑encoded bash scripts that, upon execution, enumerated and exfiltrated a comprehensive set of secrets.

Payload and Exfiltration Mechanisms
The injected scripts harvested CI environment variables, cloud provider credentials (AWS, GCP, Azure), SSH private keys, Docker and Kubernetes configurations, HashiCorp Vault tokens, Terraform credentials, shell histories, API keys, database connection strings, JWTs, PEM private keys, and various cloud tokens. They also targeted files such as .env, credentials.json, service‑account.json, and extracted OIDC tokens along with platform‑specific tokens like GITHUB_TOKEN, GitLab, and Bitbucket tokens. Exfiltrated data was transmitted via HTTP POST to the C2 endpoint 216.126.225[.]129:8443, enabling the attackers to harvest credentials at scale.

Workflow Variants and Propagation
Two distinct workflow variants were observed. The SysDiag variant triggers on every push and pull request, ensuring broad, automated execution across impacted repositories. The Optimize‑Build variant, by contrast, is configured to run only on manual invocation (workflow_dispatch), allowing more selective targeting. Once a repository owner merged a malicious commit, the workflow executed in their CI/CD pipeline, exfiltrating secrets and providing the attackers with fresh tokens to compromise additional projects—creating a cyclical, worm‑like propagation mechanism that amplified the attack’s reach within hours.

Malicious npm Packages
Beyond GitHub, the attackers published malicious npm packages masquerading as legitimate Polymarket tooling: polymarket‑trading‑cli, polymarket‑terminal, and polymarket‑bot. These packages contained postinstall hooks that executed similar secret‑exfiltration routines, thereby extending the compromise to JavaScript developers who installed the tainted dependencies. This multi‑vector approach underscored the threat group’s capability to infiltrate multiple facets of the modern software development lifecycle.

Impact and Victimology
The campaign affected a wide spectrum of sectors, including open‑source software, cloud infrastructure, developer tools, and cryptocurrency projects. High‑profile victims identified in public disclosures include the Tiledesk project (@tiledesk/tiledesk‑server and related repositories), Black‑Iron‑Project, and WISE‑Community. Geographically, the operation was global, but destructive wiper malware was specifically deployed against targets in Iran and Israel, indicating a dual motivation of financial gain (via credential theft and extortion) and geopolitical disruption. The rapid, automated nature of the attack allowed thousands of repositories to be compromised in a single morning, showcasing the scalability of modern supply‑chain threats.

Immediate Mitigation Steps
Organizations should immediately revoke and rotate all CI/CD tokens, secrets, and credentials associated with any potentially affected repository. Auditing GitHub histories for unauthorized commits—particularly those authored by suspicious throwaway accounts or containing new/modified workflow files—is essential. Enforcing multi‑factor authentication (MFA) for every developer account, restricting the scopes of Personal Access Tokens (PATs) and deploy keys, and migrating to GitHub’s Trusted Publishing mechanism can significantly reduce reliance on long‑lived static tokens. The npm registry has already invalidated granular access tokens that bypassed 2FA and strongly recommends adopting Trusted Publishing for package maintenance.

Long‑term Defenses and Monitoring
To defend against similar future incidents, enterprises should implement continuous supply‑chain security monitoring, including automated scanning for malicious GitHub Actions workflows and regular dependency analysis for anomalous npm packages. Leveraging threat‑intelligence feeds to stay abreast of emerging indicators of compromise (IOCs) such as the C2 IP address 216.126.225[.]129:8443 will aid early detection. Consulting the CSV dataset published by SafeDep provides a concrete list of the 5,561 impacted repositories for verification and remediation. Additionally, reviewing logs for outbound connections to known malicious endpoints and enforcing least‑privilege principles across CI/CD environments will strengthen resilience.

About Rescana and Conclusion
Rescana specializes in Third‑Party Risk Management (TPRM), offering a platform that continuously monitors, assesses, and mitigates risks across digital supply chains. Through advanced analytics and automation, Rescana enables security teams to identify vulnerabilities, enforce best practices, and respond swiftly to emerging threats like the Megalodon campaign. Organizations seeking to harden their software supply‑chain posture are encouraged to reach out to [email protected] for further guidance. In summary, the Megalodon incident serves as a stark reminder that securing developer credentials, tightening CI/CD controls, and maintaining vigilant supply‑chain oversight are indispensable components of modern cybersecurity strategy.

SignUpSignUp form

LEAVE A REPLY

Please enter your comment!
Please enter your name here