This module exploits an unauthenticated command injection vulnerability in the yrange parameter in OpenTSDB through 2.4.0 (CVE-2020-35476) in order to achieve unauthenticated remote code execution as the root user. The module first attempts to obtain the OpenTSDB version via the api. If the version is 2.4.0 or lower, the module performs additional checks to obtain the configured metrics and aggregators. It then randomly selects one metric and one aggregator and uses those to instruct the target server to plot a graph. As part of this request, the yrange parameter is set to the payload, which will then be executed by the target if the latter is vulnerable. This module has been successfully tested against OpenTSDB version 2.3.0.
Exploit database
Vulnerability
CVE-2020-35476
Vulnerability details
- Score
- 9.8
- Severity
- critical
CVSS 3.1 · NVD
Vector string
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HDescription
A remote code execution vulnerability occurs in OpenTSDB through 2.4.0 via command injection in the yrange parameter. The yrange value is written to a gnuplot file in the /tmp directory. This file is then executed via the mygnuplot.sh shell script. (tsd/GraphHandler.java attempted to prevent command injections by blocking backticks but this is insufficient.)
CVE ProgramExploit source choices
4 sourcesOpenTSDB 2.4.0 unauthenticated command injection
2020-11-18opentsdb_yrange_cmd_injection.rb
arpsyndicate/kenzer-templates
essential templates for kenzer [DEPRECATED]
2020-09-185,308 files · 118 stars
addy-shetty/laazy_sqli-labs
addy-shetty/laazy_sqli-labs source repository
2025-04-076 files · 0 stars
cyberctf/vulhub-opentsdb-cve-2020-35476
Vulhub opentsdb/CVE-2020-35476: OpenTSDB Gnuplot Command Injection (CVE-2020-35476), run with Isoloom
2026-10-0819 files · 0 stars