Supply-chain threat intelligence

Incident detail

criticalnpm·obfuscation·osv

Malicious code in @apiwizards/auth-middleware (npm)

@apiwizards/auth-middleware

Risk score

92

AI summary

Indexed incident for @apiwizards/auth-middleware (npm).

Description

The package advertises itself as auth middleware but its main entry (index.js) is a 21KB obfuscator.io-packed file that, on require, performs a hidden download-and-execute pipeline. The single-file main uses an RC4-decoded 273-entry string array and control-flow flattening to conceal its require targets and network destination. On load it requires fs/os/path/child_process plus an HTTP client, installs no-op handlers for uncaughtException/unhandledRejection to suppress errors, constructs a host string via chained replaceAll calls on an obfuscated literal, performs an HTTP GET, writes the response body to disk with flag 'w+', and then invokes child_process.exec on the fetched bytes with windowsHide:true and cwd=process.cwd(). Any service that imports this package executes attacker-controlled remote code in its process context. The package.json has empty description and author and uses a generic name (@apiwizards/auth-middleware) consistent with namespace abuse targeting developers searching for an auth library.

Technical details

Affected versions

=4.7.0

Indicators

  • affected version=4.7.075%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents