{"id":"MAL-2026-20675","summary":"Malicious code in tavern-ai-sdk (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (d9bd39419e14e3d9a7746b88d0724cf25261deca2acb64a7daa2ba5f5c504868)\nPackage is advertised as a persona-JSON loader exposing getPersona/listPersonas/personaIds over 8 persona cards, but the published tarball additionally ships four large single-line hex-identifier obfuscated JS bundles (cache-warm.mjs ~296KB, build-cache.mjs ~203KB, cache-sweep.mjs ~300KB, workspaces.js ~288KB) and multi-platform native N-API binaries at native/{linux,darwin,win32}/{arm64,x64}/cache-probe.node. The main entry personas.mjs statically imports cache-warm.mjs, so the obfuscated code runs on require('tavern-ai-sdk'). The bundles reference createRequire, child_process, spawn, exec, and aws-prefixed strings — a code-execution and cloud-credential surface wholly unrelated to loading persona JSON. The cache-probe.node binaries are built from the open-source VMAware library (symbol../VMAware/src/vmaware.hpp, VMDetect::GetCallback) and probe for QEMU, VirtualBox, VMware, Hyper-V, KVM, Docker, WSL, Azure, GCE, AWS Nitro, Qihoo360 sandbox, ThreatExpert, Hybrid Analysis, BlueStacks and similar via SMBIOS/CPUID/dmidecode/ioreg/sysctl. The bundle headers self-label as \"build cache manifest. Restore from package-lock if corrupted,\" and the file names (cache-warm, cache-sweep, build-cache, workspaces, cache-probe) are chosen to look like routine build infrastructure, but none of these artifacts implement or are needed by the advertised persona-loader API. The combination — obfuscated import-time-reachable code with child_process/exec and cloud-SDK fingerprints, gated behind native anti-analysis VM/sandbox detection, under a cover-story name — is the canonical shape of a staged credential-stealer that withholds its payload inside analysis environments.\n","modified":"2026-11-27T00:45:05.210456971Z","published":"2026-11-27T00:16:53Z","database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-023135","import_time":"2026-11-27T00:30:27.913022609Z","modified_time":"2026-11-27T00:16:53Z","sha256":"d9bd39419e14e3d9a7746b88d0724cf25261deca2acb64a7daa2ba5f5c504868","source":"amazon-inspector","versions":["1.0.0"]}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/tavern-ai-sdk/v/1.0.0"}],"affected":[{"package":{"name":"tavern-ai-sdk","ecosystem":"npm","purl":"pkg:npm/tavern-ai-sdk"},"versions":["1.0.0"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/tavern-ai-sdk/MAL-2026-20675.json","cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"evidence_files":[{"path":"personas.mjs","sha256":"fa686c14401ab4c8540b4e0b845294a681b7b2393f45d3249eca6234a0424ee0","tlsh":"981100ea7daa3324b138a3d1512ff4103362921bb604c5f8c87c02501385099831799c"},{"tlsh":"b354b60537c82721f25a7eeb640f49e0ee351448bc89fcc6ba1c36a94797162dacdb71","path":"cache-sweep.mjs","sha256":"be106321f04d3a2501489e52e44db1dab7dfb7bcada550bc77a2e71e16a0f554"},{"sha256":"bac9bf3120b13dacdd5ea35fbb0e7045fb66de9853aaf71c076e28b5b8fabd6e","tlsh":"e4f33a26d35cb713cb84b27909990715a30bfa605c70e3f3b865cd4e9da43174fa8ba2","path":"native/darwin/arm64/cache-probe.node"},{"tlsh":"4f112733c9c6ac2626fde72539348212f2005b5f31601c0b707f624c5fb60a7515af55","path":"package.json","sha256":"6ac42223c960cc346517444c12c0399ffb09e0693105d290d6128c00634ad058"}],"package_integrity":[{"hashes":{"sha1":"0c12fcaf6f3fa0813e8f36fb644a630a8d79ea6c","sha512_sri":"sha512-sJ//+TsVC54HbTpxPGPYh9avM76jC1NVN/s3HB4URiWJ9s8IEpVz4VwHVf0sIvN53l3UgizPn0yor4p7mmKYow=="},"filename":"tavern-ai-sdk-1.0.0.tgz"}]}}}],"schema_version":"1.9.2","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}