Malicious code in b2b-frontend-external-library (npm)
MAL-2026-16008
Published · Modified
Dependency scanning
Check whether b2b-frontend-external-library is in your codebase
Corgea flags malicious and compromised dependencies with reachability analysis, so you fix the packages that actually run in your application instead of working through the whole lockfile.
Description
This package is malicious. It is not a real library. An attacker put it on the public npm registry. The package name is a copy of a private, internal package name. This is a dependency confusion attack. A build that gets the name from public npm installs this package in place of the real one.
The package.json has a preinstall script. npm runs this script during install. The script file is preinstall.js. It runs before a person can read the code.
The script collects data about the host. It reads the host name, the user name, the current directory, the install directory, the package name, the package version, the operating system, the Node.js version, and the npm user-agent text.
The script sends this data to remote servers. It uses three ways. First, it makes a DNS request to a subdomain of oast.online. It writes the token, the package name, the host name, and the user name into the DNS name as hex text. Second, it sends an HTTPS POST with the data as JSON to the same oast.online host. If HTTPS fails, it uses plain HTTP. Third, it sends an HTTP POST with the same JSON to a fixed IP address, 5.189.159.252. The beacon uses a fixed token, swisscom-oce-3b9f1c7a2e.
The index.js file does nothing. It is a placeholder. The code comments say this is authorized bug-bounty research. The behavior is still an unwanted install-time beacon. It sends host data to attacker-controlled servers without consent. All versions are malicious. Treat every host that installed this package as exposed. Remove the package. Look for DNS and HTTP traffic to the listed servers.
__
Source: amazon-inspector (09cca48cfb31563fd1eefa7c1d56c69ba1c8459a5089592884538d7b2cb7252b)
package.json declares a preinstall lifecycle script (preinstall.js) that runs on npm install. The script collects hostname, username, cwd, install path, platform/OS release, Node version, npm user-agent, and the resolved package name+version, then sends the data via a DNS lookup and two HTTP(S) POSTs to three hardcoded destinations: an OAST collector at dae7n4pijsh1ahi9684gu8get3kaiefc9.oast.online, a bare-IP HTTP endpoint at 5.189.159.252, and a URL under hackerone.com. The package name (b2b-frontend-external-library) and behavior match the dependency-confusion beacon pattern: any environment that resolves this public name during install unconditionally transmits identifying host and user information to third-party endpoints. Whether framed as bug-bounty research or not, the traced code performs unsolicited install-time collection and exfiltration of installer identifiers.
Ready to move
Start Securing
Free, no credit card | First findings in minutes