Glassworm Attack Compromises Popular React Native Packages

Glassworm Attack Compromises Popular React Native Packages

The digital trust embedded within the modern software supply chain was shattered on March 16, 2026, when a sophisticated threat actor known as Glassworm successfully compromised two staple packages in the React Native ecosystem. The breach specifically targeted react-native-country-select and react-native-international-phone-number, both of which are maintained by the reputable publisher “AstrOOnauta.” These tools are standard components for mobile developers handling complex UI tasks like country selection and international phone formatting. By injecting malicious code into these trusted libraries, the attackers gained a direct path into thousands of enterprise and individual development environments worldwide. This event highlights a growing trend where cybercriminals move upstream, choosing to infect the building blocks of applications rather than targeting end-users directly. The scale of the exposure is particularly concerning, as these packages were integrated into a vast array of mobile applications currently under development or in active maintenance cycles across the globe today.

Mechanisms of Stealthy Infection

The technical sophistication of the Glassworm attack is most evident in its delivery mechanism, which bypassed traditional security scans by hiding within the standard lifecycle of an npm package installation. When a developer executed a routine installation command, a malicious preinstall hook in the package.json file triggered the execution of a heavily obfuscated JavaScript file named install.js. This script was designed to run before the package files were even fully moved into the local directory, allowing the malware to establish a foothold before any post-install security audits could take place. Security researchers who analyzed the code found that the logic was identical across both compromised packages, suggesting a coordinated and automated injection process. This method of delivery is particularly effective because it leverages the inherent permissions granted to package managers during the build process, making the initial breach nearly invisible to developers who are focused on adding features rather than monitoring background scripts during a routine library update.

Once the initial JavaScript script executed, it initiated a multi-stage sequence to deploy a Windows-specific payload without alerting the user. The transition from a simple npm package to a full-scale system compromise was handled through a series of intermediate stages, each designed to peel back another layer of the target system’s defenses. This approach reflects a deep understanding of how modern development workstations are configured, often with fewer restrictions on shell execution to facilitate rapid coding. By using the preinstall hook as a launchpad, the Glassworm actor ensured that the malware would be active the moment a developer updated their dependencies. This stealthy infiltration underscores the reality that even minor updates to UI libraries can serve as conduits for high-level persistent threats. The reliance on obfuscation and automated triggers within the install.js file demonstrates a level of tradecraft that is becoming increasingly common among groups targeting the software supply chain, where the goal is to remain undetected for as long as possible while maximizing the breadth of the initial infection.

Innovative Command and Control Structures

A defining characteristic of the Glassworm operation was the inclusion of a “locale check” intended to protect specific geographic regions from the infection. Before proceeding with the full deployment, the malware scanned the host system for Russian language markers or time zone settings associated with the Russian Federation. If these indicators were detected, the script immediately terminated its execution, leaving the system untouched. This behavior is a frequent hallmark of cybercrime syndicates operating out of Russian-speaking regions, often used as a strategy to avoid local law enforcement scrutiny or to comply with regional criminal codes. By incorporating this filter, the Glassworm actors revealed a tactical preference for targeting Western and international development hubs while maintaining a safe distance from their own potential jurisdictions. This selective targeting not only defines the scope of the threat but also provides a clear fingerprint for intelligence analysts attempting to attribute the attack to known groups. The existence of such a check confirms that the attack was a deliberate campaign rather than a random act of digital vandalism.

To maintain a resilient connection with its operators, the malware utilized an ingenious method involving the Solana blockchain to retrieve command-and-control instructions. Instead of reaching out to a traditional, easily blocked domain, the script queried transaction memos on the public Solana ledger to find a base64-encoded URL. This URL directed the infected system to the next stage of the attack, creating a decentralized and nearly indestructible communication relay. Because blockchain traffic is often permitted within corporate networks for legitimate financial or development purposes, this traffic blended perfectly with normal activity. Furthermore, since the instructions are hosted on a public, immutable ledger, the attackers can change their destination servers at any time by simply making a new transaction, without needing to update the malware itself. This use of “Web3” technologies for malicious infrastructure represents a significant escalation in supply chain attack tactics. It forces security teams to reconsider how they monitor outgoing network traffic, as traditional blacklists are ineffective against dynamic instructions hidden within legitimate protocols.

Persistence and Data Exfiltration Strategies

Once the malware established a foothold on a Windows-based system, it focused on ensuring long-term persistence and retrieving the final payload via unconventional cloud services. The attackers utilized the Windows Task Scheduler and the registry’s Run key to ensure that the malicious processes would restart every time the computer was rebooted. To finalize the infection, the malware leveraged Google Calendar links as a secondary relay point to pull the ultimate stealer component. By masking its traffic as a request to a trusted Google service, the malware successfully evaded many network-level intrusion detection systems that typically whitelist major cloud providers. This final stealer was fine-tuned for high-value targets, specifically looking for sensitive developer assets such as npm authentication tokens, GitHub SSH keys, and environmental configuration files. The strategic use of these common productivity tools as part of the malware’s infrastructure demonstrates a high level of creativity, allowing the attackers to hide their activities in plain sight by mimicking the everyday digital behavior of a professional software engineer.

Beyond stealing developer credentials, the Glassworm payload was engineered to harvest assets from various cryptocurrency wallets, including MetaMask, Exodus, and Trust Wallet. Given the high download counts of the compromised packages—nearly 30,000 in a single week—the potential financial impact of this campaign was immense. Developers who interacted with versions 0.3.91 of react-native-country-select or 0.11.8 of react-native-international-phone-number were forced to take immediate action. This involved rotating all sensitive tokens, moving cryptocurrency funds to entirely new hardware wallets, and auditing their systems for unauthorized scheduled tasks. Organizations were encouraged to implement stricter package pinning and to utilize security tools that could detect anomalous preinstall scripts during the build phase. The incident served as a stark reminder that the security of a project is only as strong as its weakest dependency. Remediation required a total reset of the local development environment to ensure no lingering backdoors remained, while future security strategies shifted toward mandatory code signing and more rigorous vetting for third-party library updates.

Subscribe to our weekly news digest.

Join now and become a part of our fast-growing community.

Invalid Email Address
Thanks for Subscribing!
We'll be sending you our best soon!
Something went wrong, please try again later