{"id":"MAL-2026-11138","summary":"Malicious code in json-schema-inspector (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (023b104d04c30fccd05f5db5842a2d8735c572eb13cfbb5ca7ba763eeb525429)\nThe package advertises itself as a JSON/XML schema validator, but both public entry points (validateJson, validateXml in lib/core.js) invoke a trigger() routine that performs remote code execution against the installer's host. The C2 URL is stored as XOR-encoded hex (key 0x55) and decodes to a manifest hosted at https://cdn.jsdelivr.net/gh/cryptonomad411/cool-utils/package.json. The manifest supplies per-platform payload URLs (wurl/lrurl/laurl/mrurl/maurl) selected by process.platform and process.arch. lib/core.js then spawns node -e (Windows) or sh -c (Linux/macOS) at lines 97 and 114 to execute AES-256-CBC-decrypted staging scripts (aesDecrypt with a statically-derived key) that run the fetched payload. Execution is gated by sandbox-evasion checks in isEnvironment() (os.uptime() \u003e= 300s, os.cpus().length \u003e= 2, os.totalmem() \u003e= 2GB) and a one-shot lock file at ~/.cache/.\u003chostname\u003e.lock (or %APPDATA%\\.cache\\.\u003chostname\u003e.lock) so the dropper runs once per victim. The combined obfuscation of the C2 URL and staging scripts, the sandbox-evasion gating, the per-host persistence marker, and the mismatch between advertised purpose (schema validation) and shipped behavior (attacker-controlled code execution) together confirm hostile intent.\n","modified":"2026-07-28T14:37:01.558256500Z","published":"2026-07-28T13:41:27Z","database_specific":{"malicious-packages-origins":[{"versions":["1.1.5"],"id":"IN-MAL-2026-010955","import_time":"2026-07-28T14:20:01.29977296Z","modified_time":"2026-07-28T13:41:27Z","sha256":"023b104d04c30fccd05f5db5842a2d8735c572eb13cfbb5ca7ba763eeb525429","source":"amazon-inspector"},{"id":"IN-MAL-2026-010963","import_time":"2026-07-28T14:20:01.625279763Z","modified_time":"2026-07-28T13:42:34Z","sha256":"5ca6605b7321cc0ba97351bc791f17829f467951eaa9de99ce928f1338c4fcd1","source":"amazon-inspector","versions":["1.1.7"]},{"source":"amazon-inspector","versions":["1.1.6"],"id":"IN-MAL-2026-010959","import_time":"2026-07-28T14:20:01.45017287Z","modified_time":"2026-07-28T13:42:00Z","sha256":"65d8e513622df69653c38f8f1ded6dbf9022d731b6f9549b4eb2338b69cc6781"},{"source":"amazon-inspector","versions":["1.1.4"],"id":"IN-MAL-2026-010956","import_time":"2026-07-28T14:20:01.35255909Z","modified_time":"2026-07-28T13:41:37Z","sha256":"6b933581c13815fdf509261acd0f26d8f9446b313d2ff7866c274167e986d87b"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/json-schema-inspector/v/1.1.5"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/json-schema-inspector/v/1.1.7"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/json-schema-inspector/v/1.1.6"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/json-schema-inspector/v/1.1.4"}],"affected":[{"package":{"name":"json-schema-inspector","ecosystem":"npm","purl":"pkg:npm/json-schema-inspector"},"versions":["1.1.5","1.1.7","1.1.6","1.1.4"],"database_specific":{"cwes":[{"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"},{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"evidence_files":[{"path":"lib/core.js","sha256":"438a89bce1a9a814c17ea1ab4b5f0c536bcf00efab3187b4e29f5ccc270cb4bb","tlsh":"fa12d8d52ee6e5110a7597e647f3c41aef3aa1232605c25dbd8cc6402fb1264c662efc"},{"path":"lib/helpers.js","sha256":"f0c668acb0eaf1606dace2c27b1d6f290d346ac4de368f655cc318da5fa74d96","tlsh":"f131dc802d7274a043b2a6f65a77e80ed4a8663771008398f76e5a865f30c548ad2eec"}],"package_integrity":[{"filename":"json-schema-inspector-1.1.5.tgz","hashes":{"sha1":"02a0b829eb18c5b712d301734a06abc7a49e90fd","sha512_sri":"sha512-hoI9ZvlE/w0IxRb2F+U+kOFU7OOHIBGEsclVeTS/ewfghWLquQBaEralMGMMtKYqaeXLJ8/17P08Os7glmXLRg=="}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/json-schema-inspector/MAL-2026-11138.json"}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}