Executive brief
gnuplot is a graphing utility used to generate plots and charts. This vulnerability allows attackers to inject arbitrary system commands through unsanitized plot title parameters, potentially enabling code execution on systems where user-controlled titles are passed to gnuplot. An attacker could exploit this to execute malicious commands, steal data, or compromise the system.
Technical details
The vulnerability is a command injection flaw (CWE-77) in the gnuplot npm package affecting all versions. The library fails to properly sanitize the plot title parameter before passing it to the underlying gnuplot command-line tool. An attacker who can control the title value supplied to the library can inject newlines and gnuplot commands (including the system() function) to execute arbitrary shell commands. The attack requires the ability to pass a malicious title to the gnuplot function; no authentication is needed if titles are sourced from user input. The proof-of-concept demonstrates creating arbitrary files via injected system() calls. No patch was available at the time of disclosure.
Affected products
- npm gnuplot all versions
Timeline
- 2020-09-04: disclosed
- 2020-09-04: other: No fix available at disclosure; issue remains unfixed