npm AsyncAPI Supply Chain Engagement: Payload on Import

Learn how AsyncAPI compromise via npm exploited GitHub Actions and delivered payloads on import. Learn the protection and detection measures.

jueves, 16 de julio de 2026 • 6 min read • Q2BSTUDIO Team

How GitHub Actions made AsyncAPI engagement easier

The recent vulnerability that affected the AsyncAPI npm ecosystem is not just an isolated incident; represents a turning point in the way we understand security in the software supply chain. For years, attacks focused on installation scripts (postinstall, preinstall) that could be mitigated with flags such as --ignore-scripts. However, the AsyncAPI compromise showed that malicious actors have already overcome that barrier: now the malicious code is executed at the time of module import, when the developer or CI/CD pipeline performs a simple require() or import. This paradigm shift requires organizations to completely overhaul their protection strategies, adopting approaches that go beyond superficial dependency management.

The attack originated from a vulnerability in a GitHub Actions workflow that used pull_request_target, a configuration that grants the pull request code access to the context of the base repository. The attackers injected an obfuscated loader into legitimate packages such as @asyncapi/specs, @asyncapi/generator, and others, causing more than five versions to be republished with valid provenance signatures thanks to OIDC. What's alarming is that the project's own seemingly secure official publication pipeline became the vehicle for the malware. This underscores a fundamental lesson: trust in continuous integration tools must be accompanied by constant permissions auditing, code reviews, and monitoring for anomalous behavior.

The payload, called Miasma, operates in multiple phases. First, a small JavaScript loader is activated when importing the package. This loader launches a hidden child process of Node.js that downloads a sync.js file from IPFS, a distributed file system that makes it difficult to crawl. The file, about 8.2 MB, is encrypted with three cryptographic layers, but all keys are statically embedded in the loader, allowing analysts to retrieve the payload without running it. Once decrypted, the Miasma runtime establishes persistence using registry keys in Windows, systemd services in Linux, or injection into shell files in macOS, and communicates with command-and-control (C2) servers via ports 8080, 8081, and 8091. Although in this campaign the credential collection and propagation modules were disabled, the framework included code to steal tokens from GitHub, GitLab, npm, AWS, Azure, GCP, SSH keys, and more than a hundred environment variables. This shows that the attack was prepared to escalate if the actors decided to do so.

For companies that rely on open-source ecosystems, this incident reinforces the need for a comprehensive cybersecurity strategy that goes beyond patches. It's not enough to keep dependencies up to date or use vulnerability scanners; A holistic approach is required that spans everything from pipeline configuration to endpoint monitoring. In this context, having a technology partner that understands the complexities of cloud security, custom application development, and integration of DevSecOps practices can make the difference between a controlled incident and a massive impact breach.

One of the main lessons learned from the AsyncAPI attack is the importance of auditing CI/CD workflows. Using pull_request_target with PR commit checkout is a dangerous practice that should be avoided. Organizations should implement protected branch policies, review changes to workflow configuration files, and use tokens with minimal scope. In addition, it is advisable to employ protected environments for package publishing, requiring manual approvals even when using OIDC. Zero trust applied to the supply chain means that no pipeline, no matter how legitimate it may seem, should have permissions to publish artifacts without external verification.

Responding to such incidents should also include deep cleaning of affected environments. The attackers installed persistence under directories named NodeJS (e.g., %LOCALAPPDATA%\NodeJS on Windows, ~/.local/share/NodeJS on Linux). Removing only malicious packages is not enough; Security teams should search for files such as sync.js, investigate child processes of suspicious Node.js, and rotate all credentials that have been exposed on the systems that imported the compromised versions. Coordination between development, operations, and security teams is critical, and this is where services such as cybersecurity offered by specialized companies can help conduct a forensic investigation, identify attack vectors, and restore trust in productive environments.

From a business perspective, this case also highlights the increasing sophistication of attackers targeting software supply chains. It's not just about stealing credentials; The aim is to establish a persistent presence that allows lateral movements, data exfiltration and, potentially, the compromise of downstream customers. Organizations that develop custom software or integrate open-source components should consider investing in enterprise AI as part of their defensive arsenal. AI-based systems can analyze network traffic patterns, detect anomalous behavior in processes, and alert on file downloads from IPFS or connections to suspicious IP addresses. In addition, business intelligence tools, such as Power BI, can be configured to visualize real-time indicators of compromise (IoCs) and facilitate decision-making during incident response.

Another relevant aspect is the need to harden the cloud environments that house pipelines and repositories. The attack on AsyncAPI did not exploit an npm vulnerability, but rather a misconfiguration in GitHub Actions. This means that companies using AWS and Azure cloud services should review their IAM policies, assigning roles to workflow identities, and how secrets are handled. Adopting practices such as using OIDC with identity federation reduces reliance on long-lived tokens, but it doesn't eliminate risk if the pipeline using that identity is misconfigured. A cloud security strategy should include segmentation of environments, continuous monitoring of logs, and automated response to suspicious events.

An organization's resilience to these types of threats depends not only on technology, but also on culture and processes. Collaboration between development and security teams, ongoing training of staff on enterprise AI , and conducting attack simulation exercises are practices that help reduce the window of exposure. In this sense, having a partner that offers business intelligence services allows you to transform security data into actionable information, improving the ability to detect anomalous patterns before they become serious incidents.

Finally, it is important to note that the AsyncAPI compromise should not be seen as an isolated event, but rather as a sign that attackers are evolving their tactics. The open source community and the companies that depend on it must work together to establish more robust standards for package verification, such as mandatory provenance signatures, notarization on blockchain, or dependency permission lists. In the meantime, organizations can take immediate action: review their dependency trees, remove affected versions (6.11.2-alpha.1, 6.11.2, 3.3.1, 0.7.1, 1.1.1), purge npm and Yarn caches, and block outbound connections to IP 85.137.53[.]71 at ports 8080, 8081 and 8091. Collaborating with companies that offer process automation solutions can help implement these measures quickly and consistently across environments, minimizing the impact on productivity.

In conclusion, the AsyncAPI incident reminds us that supply chain security is a dynamic challenge that requires constant updating of skills, tools, and processes. Combining tailored applications with integrated security practices, adopting well-configured AWS and Azure cloud services , and implementing AI systems for proactive monitoring are all investments that pay dividends in terms of protection and business continuity. Only through a multidisciplinary approach, spanning from development to operation, will we be able to anticipate the next generation of supply chain attacks.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.