MAL-2026-20346

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/array-flatten-utils/MAL-2026-20346.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-20346
Published
2026-11-23T08:08:04Z
Modified
2026-11-23T08:30:03Z
Summary
Malicious code in array-flatten-utils (npm)
Details

-= 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 (native_win.node / native_mac.node / native.napi.node) inside a swallowed try/catch at require() time. The native addons read a shipped 6.7MB high-entropy .napi_cache 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 __IS_DAEMON 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 (GITHUB_ACTIONS, GITLAB_CI, TRAVIS, CIRCLECI, JENKINS_URL, BUILDKITE, CODEBUILD_BUILD_ID, APPVEYOR, SEMAPHORE, TEAMCITY_VERSION, BITBUCKET_BUILD_NUMBER, NETLIFY, VERCEL, NOW_GITHUB_DEPLOYMENT, CF_BUILD_ID, 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.

Database specific
{
    "malicious-packages-origins": [
        {
            "id": "IN-MAL-2026-023045",
            "import_time": "2026-11-23T08:17:31.350768839Z",
            "modified_time": "2026-11-23T08:08:04Z",
            "sha256": "1223f15f9524856b6d7d92998310a6413cfc005c935ef5fcd1c639af2db44240",
            "source": "amazon-inspector",
            "versions": [
                "1.0.2"
            ]
        },
        {
            "id": "IN-MAL-2026-023046",
            "import_time": "2026-11-23T08:17:31.400355651Z",
            "modified_time": "2026-11-23T08:08:12Z",
            "sha256": "48d3d3c9a8ee948f45acdef2355140fb44bd2fe21ab48d0da8b972d0e93e7dfc",
            "source": "amazon-inspector",
            "versions": [
                "1.0.5"
            ]
        },
        {
            "id": "IN-MAL-2026-023050",
            "import_time": "2026-11-23T08:17:31.503960824Z",
            "modified_time": "2026-11-23T08:08:39Z",
            "sha256": "6cd3524a12dae90b2d80296cd69b5971e84fc267d12909cbe88229c4ba5898d7",
            "source": "amazon-inspector",
            "versions": [
                "1.0.1"
            ]
        },
        {
            "id": "IN-MAL-2026-023049",
            "import_time": "2026-11-23T08:17:31.476564471Z",
            "modified_time": "2026-11-23T08:08:33Z",
            "sha256": "cdb346e8abad3e2b94a726c46bf340d1468ae52a77d1ce919388d7691ec0bceb",
            "source": "amazon-inspector",
            "versions": [
                "1.0.4"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / array-flatten-utils

Package

Name
array-flatten-utils
View open source insights on deps.dev
Purl
pkg:npm/array-flatten-utils

Affected ranges

Affected versions

1.*
1.0.1
1.0.2
1.0.4
1.0.5

Database specific

cwes
[
    {
        "cweId": "CWE-506",
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code"
    },
    {
        "cweId": "CWE-506",
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code"
    },
    {
        "cweId": "CWE-506",
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code"
    },
    {
        "cweId": "CWE-506",
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code"
    }
]
indicators
{
    "evidence_files": [
        {
            "path": "index.js",
            "sha256": "80eca5a62e5a0f5e51398e6899471b345316a2132ce95683fda92086e044f06a",
            "tlsh": "d901b1c93bf8714c166425f523edc686e4e1d421814e475dca8ea5b51ad4ca0af2ccff"
        },
        {
            "path": "native_win.node",
            "sha256": "cdefbd4ff465d8a990586513587862d6b66c6cb3fc78d01a7699b5cf3d8e7432",
            "tlsh": "2f945c94b381fdf6dc494b7418d25309a37af081a71eeb3b6624fe3c0a5ab98dc63544"
        },
        {
            "path": "package.json",
            "sha256": "44a69a72391fb6c850319c2d2f56f75fcf3efca85256a07fe11e61082364295f",
            "tlsh": "85d0a9648a21ac3300c69e251b28428612900d1b4002be58330b642c6ba97bb60ff20d"
        }
    ],
    "package_integrity": [
        {
            "filename": "array-flatten-utils-1.0.2.tgz",
            "hashes": {
                "sha1": "5d3abf6b436b0d5157d222c27c26ab4e0f06d7cc",
                "sha512_sri": "sha512-FKgfIbAdF4BJ52uwk+bcycp2aWWxdGOD8Ydt5hmQnhBLRKN1RG6O69rfbEMC68X3tLlyY1QXfI0tmHc91yTX3A=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/array-flatten-utils/MAL-2026-20346.json"