MAL-2026-20346: Malicious code in array-flatten-utils (npm)

Published Nov 23, 2026
·
Updated

--- -= Per source details. Do not edit below this line.=-

Source: amazon-inspector (48d3d3c9a8ee948f45acdef2355140fb44bd2fe21ab48d0da8b972d0e93e7dfc) The package presents itself as a trivial array utility (flatten/compact/unique) and mimics the name of the well-known array-flatten library, but index.js top-level loads a platform-specific native addon (nativewin.node / nativemac.node / native.napi.node) inside a swallowed try/catch at require() time. The native addons read a shipped 6.7MB high-entropy .napicache blob, decode it, write it to a cache path (%s.nc%lu.js), and execute it as JavaScript via node "<path>" + CreateProcessA on Windows, and via fork + setsid + execlp with an ISDAEMON re-exec flag on Linux/macOS to detach the dropped process. The Windows loader additionally calls SetFileAttributesA to hide the dropped .nc<uid>.js file in TEMP. Execution is gated to CI/build environments by checking a wide list of CI env vars (GITHUBACTIONS, GITLABCI, TRAVIS, CIRCLECI, JENKINSURL, BUILDKITE, CODEBUILDBUILDID, APPVEYOR, SEMAPHORE, TEAMCITYVERSION, BITBUCKETBUILDNUMBER, NETLIFY, VERCEL, NOWGITHUBDEPLOYMENT, CFBUILDID, SCREWDRIVER) and skipped when analysis tools or debuggers are detected (wireshark, procmon, procexp, x64dbg, ollydbg, fiddler, httpdebug, IsDebuggerPresent, CheckRemoteDebuggerPresent, /proc/self/status TracerPid, /proc/1/cgroup containerd). A pure-JS array helper has no legitimate reason to ship three native addons plus a 6.7MB opaque blob; the trivial JS surface is a cover story over an obfuscated staged loader targeting CI environments where credentials and deploy tokens are concentrated.

Affected Software

1 affected component
npm/array-flatten-utils=1.0.2, =1.0.5, =1.0.1, =1.0.4

Event History

Nov 23, 2026
Advisory Published
via OSV·08:08 AM
Data Sourced
via OSV·08:08 AM
DescriptionAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203