Automated 'Megalodon' Attack Compromises Over 5,500 GitHub Repos by Injecting Malicious CI/CD Workflows

‘Megalodon’ Campaign Hits 5,500+ GitHub Repos in Automated CI/CD Supply Chain Attack

CRITICAL
May 24, 2026
6m read
Supply Chain AttackCyberattackThreat Intelligence

Related Entities

Threat Actors

TeamPCP

Other

Infostealer

Full Report

Executive Summary

A large-scale, automated supply chain attack campaign named "Megalodon" has compromised the CI/CD pipelines of over 5,500 public GitHub repositories. In a rapid-fire assault lasting only six hours, the attackers pushed 5,718 malicious commits to 5,561 unique repositories. These commits were designed to modify CI/CD workflow files (e.g., GitHub Actions), injecting malicious steps into the automated build and deployment processes. The initial access vector for this widespread attack was the use of developer credentials harvested by information-stealing malware. This incident demonstrates a significant evolution in supply chain attacks, moving towards highly automated, broad-spectrum campaigns that leverage previously compromised developer accounts at scale. It underscores the critical risk posed by infostealer malware to the entire software development ecosystem.

Threat Overview

The "Megalodon" campaign is characterized by its speed and scale. The threat actor automated the process of using stolen GitHub credentials to push malicious code. The core of the attack was not to poison a single popular library, but to backdoor the build process of thousands of individual projects simultaneously.

  • Attack Vector: The campaign leveraged a large collection of GitHub credentials previously stolen from developers whose machines were infected with infostealer malware. Security firm Hudson Rock found that over 33% of the usernames associated with the compromised repositories matched victims in their infostealer database.
  • Malicious Action: The attacker's script logged into each compromised account and pushed a commit that modified CI/CD workflow files (e.g., .github/workflows/*.yml). The specific payload of these malicious workflows was not detailed in the articles, but such attacks typically aim to steal secrets (like GITHUB_TOKEN, AWS_ACCESS_KEY_ID) from the build environment and exfiltrate them to an attacker-controlled server.
  • Attribution: While not explicitly linked, this campaign's methodology is similar to attacks conducted by the TeamPCP group, indicating a broader trend of financially motivated actors targeting developers.

Technical Analysis

The attack follows a clear, repeatable pattern that is ideal for automation:

  1. Credential Acquisition: The prerequisite for the attack is a large database of developer credentials (username, password, and potentially session cookies or tokens) harvested by infostealer malware from compromised developer machines.
  2. Automated Login & Commit: The attacker uses a script to iterate through the list of stolen credentials. For each valid credential, the script authenticates to GitHub, clones a repository owned by the victim, adds a malicious commit, and pushes it back to the repository.
  3. CI/CD Poisoning: The malicious commit specifically targets CI/CD configuration files. By adding a malicious step to a GitHub Action workflow, the attacker ensures their code will be executed every time the CI pipeline runs (e.g., on a new push or pull request).
  4. Secret Exfiltration: The malicious workflow step is typically a simple script (e.g., curl or wget) that sends all environment variables—which often contain sensitive secrets—to the attacker's server.

MITRE ATT&CK Techniques

Impact Assessment

The "Megalodon" campaign represents a shift from targeted supply chain attacks to a high-volume, opportunistic model.

  • Direct Impact: The 5,561 compromised repositories are now backdoored. Any secrets present in their CI/CD environments are likely stolen. This could lead to further compromise of cloud services, package registries, and other systems accessible via those secrets.
  • Indirect Impact: The attack affects the integrity of any downstream project that uses code or artifacts from the compromised repositories. It creates a massive ripple effect of potential risk throughout the open-source community.
  • Ecosystem Impact: This attack, along with others like it, forces platforms to take drastic measures. For example, the npm registry invalidated all granular access tokens in response to rising token theft, a move that disrupts developer workflows but is necessary to mitigate the immediate threat. It highlights that the security of the entire software supply chain is dependent on the endpoint security of individual developers.

IOCs — Directly from Articles

No specific IOCs such as commit hashes, attacker domains, or IP addresses were provided in the source articles.

Detection & Response

  • Detection: GitHub users should review their repository's commit history for any unexpected or unauthorized commits, particularly those modifying files in the .github/workflows/ directory. Enable GitHub's push protection and secret scanning features. Monitor account security logs for logins from unusual IP addresses or locations. Use EDR on developer machines to detect the presence of infostealer malware.
  • Response: If a repository is found to be compromised:
    1. Immediately revoke the commit access of the compromised user account.
    2. Revert the malicious commit.
    3. Assume all secrets ever exposed to the CI/CD environment have been stolen. Rotate all API keys, tokens, and other credentials.
    4. Force a password reset and enable MFA for the compromised user account.
    5. Scan the user's machine for infostealer malware.

Mitigation

  • Developer Account Security: Enforce mandatory Multi-Factor Authentication (MFA) for all GitHub accounts. This is the single most effective defense against the use of stolen credentials.
  • Endpoint Security: Protect developer workstations with a robust Endpoint Detection and Response (EDR) solution capable of identifying and blocking infostealer malware.
  • Principle of Least Privilege: Configure CI/CD pipelines to have access only to the secrets they absolutely need. Use short-lived, dynamically generated credentials instead of long-lived static secrets where possible (e.g., using OIDC with cloud providers).
  • Code Review and Integrity Checks: Require signed commits to verify the identity of the committer. Implement policies that require review for any changes to critical files like CI/CD workflows.

Timeline of Events

1
May 22, 2026
The 'Megalodon' campaign compromises over 5,500 GitHub repositories within a six-hour window.
2
May 23, 2026
Hudson Rock publishes analysis linking the attack to credentials stolen by infostealer malware.
3
May 24, 2026
This article was published

MITRE ATT&CK Mitigations

Enforcing MFA on all developer accounts is the most effective control to prevent the use of stolen passwords.

Deploy EDR/AV solutions on developer endpoints to detect and block the infostealer malware that harvests credentials in the first place.

Audit

M1047enterprise

Regularly audit repository commits and CI/CD workflow files for unauthorized or suspicious changes.

Apply the principle of least privilege to CI/CD environments, ensuring they only have access to the secrets necessary for their function.

D3FEND Defensive Countermeasures

Multi-factor Authentication is the single most effective countermeasure against the 'Megalodon' attack. The entire campaign relied on the usability of stolen passwords. Had the targeted developer accounts on GitHub been protected by MFA (using an authenticator app, security key, or biometrics), the attackers' automated scripts would have failed at the login stage. The stolen passwords alone would be insufficient to gain access and push malicious commits. Organizations must enforce mandatory MFA for all developers on code hosting platforms like GitHub, GitLab, and Bitbucket. This simple, widely available control acts as a powerful barrier, effectively neutralizing the primary vector of this large-scale automated attack and protecting the integrity of the CI/CD pipeline.

To stop attacks like 'Megalodon' at the source, Process Analysis on developer endpoints is crucial. The credentials were stolen by infostealer malware running on developers' machines. An Endpoint Detection and Response (EDR) solution should be deployed to monitor for the tell-tale signs of infostealers. This includes processes that attempt to access browser credential stores (e.g., Chrome's 'Login Data' file), enumerate environment variables, or scan the filesystem for files named credentials, .ssh, or wallet.dat. By detecting and terminating these malicious processes before they can exfiltrate their findings, the organization prevents the credential theft that fuels these large-scale supply chain attacks. This proactive endpoint defense is essential for protecting the 'first mile' of the software supply chain.

Applying the principle of Domain Account Monitoring to GitHub accounts provides a critical detection layer. Security teams should ingest GitHub audit logs into their SIEM and create rules to detect anomalous behavior. For the 'Megalodon' attack, a key indicator would be a developer account suddenly pushing code from a new or suspicious IP address, especially one belonging to a VPN or hosting provider commonly used by threat actors. Another rule could flag accounts that have been dormant for a long period and suddenly become active. Correlating GitHub usernames with data from infostealer breach corpuses (as Hudson Rock did) can also create a high-confidence watchlist of accounts to monitor closely. This continuous monitoring can identify a compromised developer account before it's used to inject malicious code into a CI/CD pipeline.

Timeline of Events

1
May 22, 2026

The 'Megalodon' campaign compromises over 5,500 GitHub repositories within a six-hour window.

2
May 23, 2026

Hudson Rock publishes analysis linking the attack to credentials stolen by infostealer malware.

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Tags

MegalodonSupply Chain AttackGitHubCI/CDInfostealerAutomationCyberattack

📢 Share This Article

Help others stay informed about cybersecurity threats

🎯 MITRE ATT&CK Mapped

Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.

🧠 Enriched & Analyzed

Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.

🛡️ Actionable Guidance

Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.

🔗 STIX Visualizer

Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.

Sigma Generator

Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.