MAL-2026-10038

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/antsrcsrctest/MAL-2026-10038.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-10038
Published
2026-07-09T00:00:00Z
Modified
2026-07-28T08:37:09Z
Summary
Malicious code in antsrcsrctest (npm)
Details

The npm package antsrcsrctest masquerades as a "simple date formatting utility" (index.js exports a harmless formatDate() function that is never referenced by the malicious code) but is a credential-harvesting and cloud-metadata-stealing reconnaissance tool. It declares a preinstall: node preinstall.js hook, so the payload executes automatically on npm install, before the package is ever imported or used. preinstall.js collects os.hostname(), os.platform(), process.cwd(), and the victim's entire process.env (all environment variables, frequently containing API keys, tokens and secrets); fingerprints container context by checking for /.dockerenv and reading /proc/1/cgroup and /proc/self/mountinfo; runs local reconnaissance commands via child_process.execSync (id, whoami, hostname, ps aux); and performs SSRF against the Alibaba Cloud (Aliyun) instance metadata service at http://100.100.100.200/latest/meta-data/, specifically probing /latest/meta-data/ram/security-credentials/ in an attempt to steal cloud IAM role credentials. All of the above (including the full environment variable dump) is exfiltrated via two plaintext HTTP POST requests (to / and /env) to a hardcoded C2 endpoint http://101.35.44.248 (raw IP, port 80, no TLS) using Node's built-in http module. All errors are silently swallowed so the attack is invisible to the installer. The package was published by npm user xingzhigege (xingzhi@foxmail.com).

Analysis performed via static review only (npm registry metadata and package source retrieved as text via the npm registry and unpkg CDN) — the package was not installed or executed.


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

Source: amazon-inspector (80da6b239fe02ae1bbf7086d885062181d9ea048490ad77911a63ae4c393cc42)

On npm install, the declared preinstall script (preinstall.js) POSTs the installer's full process.env, os.hostname(), os.platform(), cwd, container-detection artifacts (/.dockerenv, /proc/1/cgroup, /proc/self/mountinfo), and the output of shell reconnaissance commands (id, whoami, hostname, ps aux) to http://101.35.44.248 over plain HTTP. The script additionally issues curl requests to the Alibaba Cloud instance metadata service at 100.100.100.200, including the latest/meta-data/ram/security-credentials/ path that returns temporary IAM credentials for the instance role, and forwards the response to the same attacker endpoint. The package advertises itself as "a simple date formatting utility" and index.js contains only a 7-line date formatter, confirming a decoy cover story for install-time credential theft and environment exfiltration.

Source: ossf-package-analysis (f7c7439acf2736b50448bcb0f682babcb4ad09d0f316acb5ec5442130f3ee3f2)

The OpenSSF Package Analysis project identified 'antsrcsrctest' @ 1.0.0 (npm) as malicious.

It is considered malicious because:

  • The package executes one or more commands associated with malicious behavior.
Database specific
{
    "iocs": {
        "hashes": [
            "sha256:b4a1a62c75f239d8201c65cdcda5a21e90eff76a41562a2a1902403ccd4c5f9d"
        ],
        "ips": [
            "101.35.44.248"
        ],
        "urls": [
            "http://101.35.44.248/",
            "http://101.35.44.248/env"
        ]
    },
    "malicious-packages-origins": [
        {
            "id": "IN-MAL-2026-009101",
            "import_time": "2026-07-09T16:20:40.706334025Z",
            "modified_time": "2026-07-09T15:28:28Z",
            "sha256": "80da6b239fe02ae1bbf7086d885062181d9ea048490ad77911a63ae4c393cc42",
            "source": "amazon-inspector",
            "versions": [
                "1.0.0"
            ]
        },
        {
            "import_time": "2026-07-15T05:49:39.984774304Z",
            "modified_time": "2026-07-09T03:51:07Z",
            "sha256": "f7c7439acf2736b50448bcb0f682babcb4ad09d0f316acb5ec5442130f3ee3f2",
            "source": "ossf-package-analysis",
            "versions": [
                "1.0.0"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / antsrcsrctest

Package

Name
antsrcsrctest
View open source insights on deps.dev
Purl
pkg:npm/antsrcsrctest

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected

Affected versions

1.*
1.0.0

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"
    }
]
indicators
{
    "evidence_files": [
        {
            "path": "preinstall.js",
            "sha256": "00f545b1474cd7ceb299c7ff2e7b4ad7720e1b9634876e45f178874d218ff998",
            "tlsh": "3b5163c35775b3305aa18a99e69b3101a723f54bab04ebd4b18c82220f5d81826bbad4"
        },
        {
            "path": "package.json",
            "sha256": "b142c38288be48cf988ac54c367d7c2a6e58b0cf8792c04ecc5aea067b53645d",
            "tlsh": "9dd0a7244e11d87719c45ae26a638506fea56d1a025c7c4873c75109838ebb284bf70e"
        }
    ],
    "package_integrity": [
        {
            "filename": "antsrcsrctest-1.0.0.tgz",
            "hashes": {
                "sha1": "42d2f1304f875cf0c34f8a86aeef3cb94eb4c89f",
                "sha512_sri": "sha512-weciHP6EFl97SfBU0rEkhm869yXnUu8AlWa5hoM31fJ6iAB34B5DsWjgkI4T7m1U4DKA2Bm3ZBoVILsQ/9u/lQ=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/antsrcsrctest/MAL-2026-10038.json"