MAL-2026-17351Malicious code in @bottino/baileys (npm)
| Ecosystem | Package | Version |
|---|---|---|
| npm | @bottino/baileys | * |
| npm | @bottino/baileys | 1.0.0 |
| npm | @bottino/baileys | 1.0.1 |
| npm | @bottino/baileys | 1.0.10 |
| npm | @bottino/baileys | 1.0.11 |
| npm | @bottino/baileys | 1.0.12 |
| npm | @bottino/baileys | 1.0.13 |
| npm | @bottino/baileys | 1.0.14 |
| npm | @bottino/baileys | 1.0.2 |
| npm | @bottino/baileys | 1.0.5 |
| npm | @bottino/baileys | 1.0.6 |
| npm | @bottino/baileys | 1.0.7 |
| npm | @bottino/baileys | 1.0.8 |
| npm | @bottino/baileys | 1.0.9 |
{"schema_version":"1.7.4","id":"MAL-2026-17351","published":"2026-10-01T17:02:45Z","modified":"2026-10-08T13:35:17.064053853Z","aliases":["GHSA-qg7r-f2jp-2mmx"],"summary":"Malicious code in @bottino/baileys (npm)","details":"This package is part of a large family (100+ identified as of September 2026) of near-identical\nforks of the Baileys WhatsApp Web library that inject a covert channel-subscription action into\nthe WhatsApp socket layer. On connect, the injected code issues an authenticated `w:mex` FOLLOW\nquery (query_id 7871414976211147) against one or more attacker-chosen WhatsApp Channel/Newsletter\nJIDs, using the installer's own authenticated WhatsApp session -- silently subscribing the\nvictim's account to channels it never asked to join.\n\nThe target JID(s) are hidden from casual source review via one of several obfuscation techniques\nobserved across the family: a plain string literal, base64 encoding, base64+XOR, or a char-code\narray reconstructed at runtime. Some variants instead fetch a mutable, attacker-controlled remote\nJSON/JS list of target JIDs from GitHub or another host at runtime, letting the target list change\nafter installation without a new npm publish. Every sample in the family shares the same underlying\nmechanism (a wrapped/patched socket-connect routine that fires the FOLLOW query some seconds after\nconnect), even though the package name, JID value(s), and obfuscation/delivery method differ per\nfork.\n\nThe malicious action abuses the installer's own authenticated WhatsApp session to gain reach and\nsubscribers for attacker-controlled channels; it does not exfiltrate credentials, establish\npersistence, or execute arbitrary remote code.\n\nAffected package: @bottino/baileys (npm), version(s): 1.0.14, 1.0.13, 1.0.12, 1.0.11, 1.0.10, 1.0.9, 1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.2, 1.0.1.\n\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (571d52cf3274d95d4824667269921b2e0ad1478fe9f324a74fab0ba377bb9a26)\nThis fork of Baileys overrides `requestPairingCode` so that when the caller does not supply an explicit `pairKey`, `authState.creds.pairingCode` is set to the fixed literal string `BYPAKI64`. That value is then used as the KDF input for the WhatsApp companion-device link-code encryption via `derivePairingCodeKey(authState.creds.pairingCode, salt)`. Because the pairing code is a known constant baked into the package, anyone who knows the target phone number of the installer's WhatsApp account can complete the companion-device pair flow from a device they control and obtain persistent access to the installer's WhatsApp session (read/send messages, contacts, media) — a full account takeover backdoor against any application built on this library. Additionally, on socket connect the code auto-subscribes the installer's WhatsApp account to a hardcoded newsletter JID `120363418582531215@newsletter` and persists a `basedbysam` flag so the covert subscribe runs once per credential store; this covert action uses the installer's WhatsApp identity without disclosure.\n\n## Source: ghsa-malware (306f5b1457c94a2754719e5f1141bcb8d394fab8f5b5ede809677152d6ca2b1d)\nAny computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.\n","affected":[{"package":{"name":"@bottino/baileys","ecosystem":"npm"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"versions":["1.0.14","1.0.13","1.0.12","1.0.11","1.0.10","1.0.9","1.0.8","1.0.7","1.0.6","1.0.5","1.0.2","1.0.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"},{"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"},{"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"},{"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":"lib/Socket/socket.js","sha256":"9c40e0c861744f33f79091bb46d660b8db5efb63a0de7ab879eae8a97d7a2edf","tlsh":"f033c86b49b5153a8b7373759b277421f221e227224082a77fbc82211fb61d8d693fcd"}],"package_integrity":[{"filename":"baileys-1.0.13.tgz","hashes":{"sha1":"2944215e84a669b210bb5b4e70ae8c8950306cba","sha512_sri":"sha512-v4xaGHBvZtMHlc8vVbghWpn1kkctkUlMARARfx6o0kvHyZ0ImhlryOL4uo07UAmJmZqvpS4qYV1JlyG7VKRRxg=="}}]}}}],"references":[{"type":"ARTICLE","url":"https://www.ox.security/blog/phantomsub-malicious-npm-campaign-secretly-adds-users-to-whatsapp-spam-channels/"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.2"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.0"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.5"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.10"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.13"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.8"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.6"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.11"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.12"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.14"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.9"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.1"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/@bottino/baileys/v/1.0.7"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-qg7r-f2jp-2mmx"}],"database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-020870","import_time":"2026-10-01T17:18:04.42009248Z","modified_time":"2026-10-01T17:03:15Z","sha256":"571d52cf3274d95d4824667269921b2e0ad1478fe9f324a74fab0ba377bb9a26","source":"amazon-inspector","versions":["1.0.2"]},{"id":"IN-MAL-2026-020869","import_time":"2026-10-01T17:18:04.364806471Z","modified_time":"2026-10-01T17:03:04Z","sha256":"86b50651f18a57382f7092003d44fef58dd6dd5028786448ef66de864940d37f","source":"amazon-inspector","versions":["1.0.0"]},{"id":"IN-MAL-2026-020867","import_time":"2026-10-01T17:18:04.260291119Z","modified_time":"2026-10-01T17:02:45Z","sha256":"cad4edc85fe2e1370c217c7a9b94b90a3b7be93f97529b2f83aad2ac411d2d32","source":"amazon-inspector","versions":["1.0.5"]},{"id":"IN-MAL-2026-021156","import_time":"2026-10-08T06:34:02.690188081Z","modified_time":"2026-10-08T06:04:54Z","sha256":"1d00245044d84b71ccf65beaff2142a1eedd9eb16af51d2d2b4bf977c511139d","source":"amazon-inspector","versions":["1.0.10"]},{"id":"IN-MAL-2026-021157","import_time":"2026-10-08T06:34:02.747758915Z","modified_time":"2026-10-08T06:05:04Z","sha256":"48895a51d27fab743e3086d8a580893e6821df1ae96e99c4637a33b3dfd88c1e","source":"amazon-inspector","versions":["1.0.13"]},{"id":"IN-MAL-2026-021160","import_time":"2026-10-08T06:34:02.955861832Z","modified_time":"2026-10-08T06:05:35Z","sha256":"4b770a54548578ff51fe4d28be19feddb4723bb2b43bc4d1b0e7bc9cab86150a","source":"amazon-inspector","versions":["1.0.8"]},{"id":"IN-MAL-2026-021155","import_time":"2026-10-08T06:34:02.627057799Z","modified_time":"2026-10-08T06:04:45Z","sha256":"8637ef3cfe17a312f256c661cf434c975c6e14a029c13a0fc990f9c9edcafd36","source":"amazon-inspector","versions":["1.0.6"]},{"id":"IN-MAL-2026-021158","import_time":"2026-10-08T06:34:02.811926852Z","modified_time":"2026-10-08T06:05:14Z","sha256":"b8873f9f22b17689e074cf4a36128d2ab2abf777240b2f1e9d8f0644a0604743","source":"amazon-inspector","versions":["1.0.11"]},{"id":"IN-MAL-2026-021159","import_time":"2026-10-08T06:34:02.912986005Z","modified_time":"2026-10-08T06:05:26Z","sha256":"c59eee3206c6ceb77bfd31ee6d2b82bfa71986502634ffdd728ab0f174c49305","source":"amazon-inspector","versions":["1.0.12"]},{"id":"IN-MAL-2026-021153","import_time":"2026-10-08T06:34:02.51364222Z","modified_time":"2026-10-08T06:04:26Z","sha256":"2d6272766dbca2ca3686e2904a127f8f52495f52e6bae1f30125388d48ed8743","source":"amazon-inspector","versions":["1.0.14"]},{"id":"IN-MAL-2026-021161","import_time":"2026-10-08T06:34:03.014850777Z","modified_time":"2026-10-08T06:05:45Z","sha256":"359995a0ac54bf55fe41254b1af34cdaf06b648bb854045644ec51210040e18f","source":"amazon-inspector","versions":["1.0.9"]},{"id":"IN-MAL-2026-021163","import_time":"2026-10-08T06:34:03.107790603Z","modified_time":"2026-10-08T06:06:03Z","sha256":"7496a060f3c7a6b2a30947d569889d5ad709025e056970e20752caa9df8f64ca","source":"amazon-inspector","versions":["1.0.1"]},{"id":"IN-MAL-2026-021154","import_time":"2026-10-08T06:34:02.573354284Z","modified_time":"2026-10-08T06:04:37Z","sha256":"81dc266de5a080d063a1181844241ff9bf737bc2e413b13176b1978ae7d2c2b1","source":"amazon-inspector","versions":["1.0.7"]},{"id":"GHSA-qg7r-f2jp-2mmx","import_time":"2026-10-08T13:33:19.402454153Z","modified_time":"2026-10-08T13:26:07Z","ranges":[{"events":[{"introduced":"0"}],"type":"SEMVER"}],"sha256":"306f5b1457c94a2754719e5f1141bcb8d394fab8f5b5ede809677152d6ca2b1d","source":"ghsa-malware"}]},"credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"},{"name":"OX Security","type":"FINDER"}]}数据来源:OpenSSF Malicious Packages · Apache-2.0