Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › incident response

MALFEX npm Package ‘imgdecode’ Hides Shellcode Loader in Windows Native Addon

By Freedom251 Team · · 4 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes—SafeDep identified imgdecode as a MALFEX npm package containing a malicious prebuilt Windows N-API addon. In versions 1.0.0 through 1.0.3, requiring the package loads prebuilds/win32-x64/imgdecode.node. From version 1.0.1, the addon can download encrypted content, decrypt it and inject it into a suspended dllhost.exe process while the module initializes.

The observed trigger is an interactive Windows console. Blocking npm install scripts does not block this module-load path. SafeDep did not recover the downloaded banner.jpg, so the final payload cannot be identified with certainty.

What imgdecode does

SafeDep’s October 13, 2026 analysis found that the package’s JavaScript entry point is only a loader for a compiled native module. Calling require('imgdecode') loads prebuilds/win32-x64/imgdecode.node, a 64-bit MSVC binary built with node-addon-api. The DLL exports napi_register_module_v1; its initialization routine runs before the module returns its normal exports.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The malicious routine proceeds when standard output belongs to an interactive Windows console. Redirected output can prevent the observed path from firing, but that condition is not a safety guarantee: a package that has loaded untrusted native code should still be investigated.

How the loader fetches and injects its payload

  1. Module load: Node.js resolves the package and loads the Windows native addon.
  2. Network request: The addon requests hxxps://raw.githubusercontent[.]com/cavecrew/proj/main/banner.jpg.
  3. Decryption: It decrypts the returned data with AES-256-CBC.
  4. Process injection: It creates or opens a suspended dllhost.exe process and injects the decrypted result.

SafeDep observed the loader behavior but did not obtain banner.jpg. A separate related banner.png sample delivered a Go downloader for a 71.5 MB MALFEX stealer/RAT executable. That similarity makes a connection plausible, but it does not establish that banner.jpg contains the same payload.

Versions and replacement timeline

Version Publication timing Observed detail
1.0.0 September 30, 2026 Analyzed as part of the MALFEX package sequence
1.0.1 Later on September 30, 2026 Native loader performs fetch, decryption and execution during initialization
1.0.2 October 1, 2026 Analyzed replacement release
1.0.3 October 11, 2026 Removed the earlier imgbundle dependency while retaining the native loader

SafeDep recorded 929 imgdecode downloads between September 30 and October 12, 2026. Download totals measure registry activity, not confirmed infections.

Why install-script controls are insufficient

Many npm defenses focus on lifecycle scripts such as preinstall and postinstall. imgdecode is distinctive because the observed execution occurs when application code requires the module, not in an installation hook. A clean install with scripts disabled can therefore still load the malicious DLL if a project imports the package on a Windows x64 machine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The native binary’s embedded PDB path ended in buildReleaseimgdecode.pdb. The presence of a prebuilt DLL without corresponding native source or a binding.gyp file is a warning sign for packages presented as ordinary JavaScript utilities.

Campaign context

Checkmarx described MALFEX as an apparent single-operator npm campaign active since August 2023. By October 1, 2026, eight malicious packages in the campaign had 40,767 recorded downloads. The package function-flag accounted for 37,419 of those downloads. These figures show exposure opportunities in the registry; they do not prove that those downloads became infections.

Advisory coverage is incomplete. OSV advisory MAL-2026-17320 covers cdn-img-fetch, while later replacement packages may require direct package inspection and lockfile review rather than reliance on a single advisory entry.

Indicators defenders can hunt

Telemetry or file finding Why it matters
A prebuilds/ DLL in a package with no native source or binding.gyp Suggests executable code is being shipped outside the expected build path
The addon imports WinINet or WinHTTP and bcrypt.dll without implementing image-codec behavior Combines network retrieval and cryptographic capabilities inconsistent with image decoding
node.exe spawns dllhost.exe without a /Processid: argument Matches the unusual process relationship SafeDep observed
node.exe connects to raw.githubusercontent.com, followed by dllhost.exe connecting to an unknown host Matches the staged download and injected-process network pattern

Use these indicators together. A single connection to GitHub or a normal COM-related dllhost.exe process is not, by itself, proof of MALFEX activity.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to do if a Windows machine loaded the package

SafeDep advises treating a workstation that loaded imgdecode as potentially compromised. The interactive-console condition and the missing final payload mean absence of an obvious crash or alert does not clear the host.

  1. Isolate the workstation. Remove it from wired and wireless networks while preserving volatile evidence according to your incident-response procedures.
  2. Preserve evidence. Record the project directory, package and lockfile versions, npm cache entries, shell history, process creation logs and network telemetry before deleting artifacts.
  3. Check execution history. Look for require('imgdecode'), the prebuilds/win32-x64/imgdecode.node file, child processes from node.exe and connections to the defanged GitHub path.
  4. Rotate credentials from a clean system. Prioritize tokens, SSH keys, cloud credentials and passwords that were available to the affected Windows account.
  5. Review dependency scope. Search every repository and lockfile for imgdecode and related MALFEX package names, then inspect replacement packages directly instead of assuming an advisory feed is complete.
  6. Rebuild from a trusted baseline. For systems handling sensitive credentials or source code, follow your organization’s containment and reinstallation standard rather than simply removing the npm directory.

What is confirmed—and what is not

  • Confirmed: versions 1.0.0–1.0.3 were analyzed; the package contains a Windows x64 native addon; the observed path fetches, decrypts and injects content during module initialization.
  • Confirmed: the loader targets a suspended dllhost.exe process and uses AES-256-CBC.
  • Not confirmed: the exact contents of banner.jpg or whether it is the same 71.5 MB stealer/RAT delivered by the related banner.png sample.
  • Not established by download counts: how many registry downloads resulted in executed code or compromised hosts.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

incident responseMALFEXNode.jsnpm securitysupply-chain securityWindows malware

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.