Over 135 organizations
A novel and alarming phishing technique has been identified that repurposes trusted software supply chain infrastructure for credential theft. Dubbed the "Beamglea" campaign, threat actors are publishing hundreds of disposable packages to the NPM registry, not to infect developer builds, but to abuse the unpkg.com Content Delivery Network (CDN). By embedding a script tag in an HTML lure that points to a malicious JavaScript file hosted on the trusted unpkg.com domain, attackers can bypass email gateways and browser security controls that block unknown or suspicious domains. This ecosystem-level abuse has already targeted over 135 organizations, primarily in Europe, marking a significant shift in how threat actors leverage open-source platforms.
The attack, discovered by researchers at Socket and Snyk, does not follow the typical supply chain attack pattern of poisoning a dependency. Instead, it uses the supply chain as a delivery mechanism for a classic phishing attack. The attackers publish numerous small, randomly named packages (e.g., redirect-[a-z0-9]{6}) to NPM. Each package contains a malicious JavaScript file, beamglea.js. The unpkg.com CDN, which automatically mirrors all public NPM packages, then makes this malicious file available over HTTPS from its trusted domain. The attackers send targets an HTML file attachment, which, when opened, executes the script from unpkg.com. The script then redirects the user to an attacker-controlled phishing page, pre-filling the victim's email address to enhance the lure's legitimacy.
The campaign's effectiveness lies in its clever abuse of legitimate services:
T1584 - Compromise Infrastructure): The threat actors are not compromising NPM or unpkg, but are abusing their intended functionality. They use NPM as free, anonymous hosting and unpkg as a free, trusted CDN.T1566.001 - Spearphishing Attachment): The initial vector is a business-themed email with an HTML attachment. This avoids direct links in the email body that might be scanned.<script> tag within the HTML file pointing to the malicious beamglea.js file on unpkg.com. Since unpkg.com is a legitimate and widely used service, it is highly unlikely to be on any blocklist, allowing the payload to be fetched and executed.T1592 - Gather Victim Host Information): The script pre-fills the victim's email on the phishing page, a simple but effective social engineering trick to lower the victim's guard.This technique poses a significant threat to organizations for several reasons:
Detection focuses on the local execution of the HTML lure and the subsequent network traffic.
| Type | Value | Description |
|---|---|---|
| file_name | beamglea.js |
The name of the malicious JavaScript payload. |
| url_pattern | unpkg.com/redirect-[a-z0-9]{6}/ |
The URL pattern used to fetch the malicious script from the CDN. |
| command_line_pattern | *.html |
Monitor for local execution of HTML files opened from email attachments. |
| network_traffic_pattern | Browser process making a connection to unpkg.com immediately followed by a redirect to an unknown/uncategorized domain. | This sequence of events is highly suspicious. |
unpkg.com that match the redirect-* package pattern. While unpkg is legitimate, this specific pattern is indicative of the Beamglea campaign.D3-ITF: Inbound Traffic Filtering at the email gateway to block HTML attachments. Use D3-UA: URL Analysis on traffic to detect redirects to known phishing infrastructure following a connection to unpkg.D3-EDL: Executable Denylisting applied to email attachments, where policies are set to block potentially active content like .html and .js files from untrusted senders.Educate users on the risks of opening attachments, especially HTML files, from untrusted sources.
Configure email gateways to block, strip, or sandbox active content like JavaScript within HTML attachments.
Mapped D3FEND Techniques:
Use browser isolation technology to open links and attachments from emails in a secure, sandboxed environment.
Mapped D3FEND Techniques:
The most direct way to counter the Beamglea campaign is to block the initial delivery vector at the email perimeter. Security teams should configure their email security gateways to specifically handle HTML attachments with high suspicion. The best practice is to implement a policy that blocks all inbound emails containing .html or .htm attachments from external senders. If blocking is too disruptive, an alternative is to use Content Disarm and Reconstruction (CDR) technology. CDR will automatically parse the HTML attachment, strip out any active content like <script> tags, and then rebuild a safe, static version of the file for the recipient. This neutralizes the threat by removing the malicious JavaScript payload before the user ever has a chance to open the file, effectively breaking the attack chain at the first step.
Since this attack leverages a trusted CDN, simple domain blocklisting is ineffective. Advanced URL analysis at the web proxy or DNS filtering layer is required. Security solutions should be configured to inspect the full URL path, not just the domain. Create a specific detection rule to flag and block or alert on any URL containing the pattern unpkg.com/redirect-*. While unpkg.com itself is legitimate, this specific subdirectory pattern is a high-fidelity indicator of the Beamglea campaign. This allows the organization to continue using the legitimate aspects of the CDN while surgically blocking the malicious components. This approach provides a crucial layer of defense if a malicious HTML attachment makes it past the email gateway.

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