{"id":"MAL-2026-12196","summary":"Malicious code in simple-date-formatter-new-4 (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (2f5ed3c402677fcfaeac396b55b9db5280445e9b0130133cc311a83f96f2a0de)\nPackage advertises itself as a date-formatting utility but its actual behavior on install is credential theft and internal-network reconnaissance. The `postinstall` script in package.json runs a shell one-liner that probes internal Kubernetes API endpoints, dumps `/etc/resolv.conf` and `ip route`, TCP-scans internal hosts, reads the pod's Kubernetes service-account token from `/var/run/secrets/kubernetes.io/serviceaccount/token`, and POSTs the aggregated output via curl to a hardcoded OAST (interact.sh) collector at http://safjhdvsfwzhieemkdzbgr54r0yjhrmok.oast.fun/escinfo8. A bundled `postinstall.js` additionally enumerates `~/.ssh` (listing public keys), collects the local username and platform, and POSTs the JSON to a hardcoded IP 124.221.154.135 over HTTPS; in-file comments describe it as an SSH-key theft C2 demo. The library payload (`index.js`) is a three-line wrapper around `toLocaleDateString`, functioning solely as cover for the install-time attack.\n","modified":"2026-08-05T10:06:18.942818229Z","published":"2026-08-05T08:47:49Z","database_specific":{"malicious-packages-origins":[{"sha256":"2f5ed3c402677fcfaeac396b55b9db5280445e9b0130133cc311a83f96f2a0de","source":"amazon-inspector","versions":["1.0.0"],"id":"IN-MAL-2026-014420","import_time":"2026-08-05T09:28:09.118063018Z","modified_time":"2026-08-05T08:47:49Z"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/simple-date-formatter-new-4/v/1.0.0"}],"affected":[{"package":{"name":"simple-date-formatter-new-4","ecosystem":"npm","purl":"pkg:npm/simple-date-formatter-new-4"},"versions":["1.0.0"],"database_specific":{"indicators":{"evidence_files":[{"tlsh":"9e11f0d8f4a09c33af8dc67ade17468a7a87948f1da03c0c95c3893c838cbe4017c1a4","path":"package.json","sha256":"9ee02a980f309059ebe09657e091817c93d8962fa25461881cb20e746117728c"},{"path":"postinstall.js","sha256":"f2be6940c08d36a7f1ce83d5fe16fefd8c14edda5d124e0f6406725beb5020ef","tlsh":"273165d558f9cd3007778685639b91263102fe13650ee940f3c807a51fe9a5449f2dee"},{"sha256":"1d5404dbbd7f6a35142bc11e276bcff7b334f927a198399e6b0d9aa09ecfd098","tlsh":"8cc08c94a716b2866326122096a74100be5cc2300b9a6a62b88ec0c00144c12805ef8c","path":"index.js"}],"package_integrity":[{"hashes":{"sha512_sri":"sha512-GVv/FUKS9fuL2twiBUo97n1iskcKuFqErZEcXBf7KXW+Hp4ObnW8CCvnM/XZVLZIAKqw9eKLs0OzK+WUHuVFyQ==","sha1":"b5dbf12e11c34f5fa578d8c6b555be98bc2a347b"},"filename":"simple-date-formatter-new-4-1.0.0.tgz"}]},"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/simple-date-formatter-new-4/MAL-2026-12196.json"}}],"schema_version":"1.8.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}