CVE-2023-25826

9.8 CRITICAL

📋 TL;DR

CVE-2023-25826 is an unauthenticated remote command injection vulnerability in OpenTSDB's legacy HTTP query API. Attackers can execute arbitrary operating system commands on the OpenTSDB host system by injecting crafted commands into API parameters. This affects OpenTSDB installations with the legacy HTTP API enabled.

💻 Affected Systems

Products:
  • OpenTSDB
Versions: Versions prior to 2.4.2
Operating Systems: All operating systems running OpenTSDB
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with the legacy HTTP query API enabled. The vulnerability exists due to an incomplete fix for CVE-2020-35476.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the OpenTSDB host system leading to data theft, ransomware deployment, lateral movement within the network, and persistent backdoor installation.

🟠

Likely Case

Unauthenticated attackers executing arbitrary commands to steal sensitive data, disrupt monitoring services, or use the system as a pivot point for further attacks.

🟢

If Mitigated

Limited impact with proper network segmentation, API restrictions, and monitoring in place, potentially only service disruption if commands are blocked.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Public exploit code is available, making this easily weaponizable. The vulnerability bypasses regex validation implemented after CVE-2020-35476.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: OpenTSDB 2.4.2

Vendor Advisory: https://github.com/OpenTSDB/opentsdb/pull/2275

Restart Required: Yes

Instructions:

1. Upgrade OpenTSDB to version 2.4.2 or later. 2. Apply the patch from GitHub PR #2275 if upgrading isn't possible. 3. Restart the OpenTSDB service after patching.

🔧 Temporary Workarounds

Disable Legacy HTTP Query API

all

Disable the vulnerable legacy HTTP query API endpoint if not required for functionality.

Modify OpenTSDB configuration to set 'tsd.http.query.enable' to false

Network Access Control

linux

Restrict network access to OpenTSDB HTTP API endpoints using firewall rules.

iptables -A INPUT -p tcp --dport 4242 -s trusted_ips -j ACCEPT
iptables -A INPUT -p tcp --dport 4242 -j DROP

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate OpenTSDB from untrusted networks
  • Deploy a web application firewall (WAF) with command injection rules in front of OpenTSDB

🔍 How to Verify

Check if Vulnerable:

Check if OpenTSDB version is below 2.4.2 and the legacy HTTP query API is enabled in configuration.

Check Version:

curl -s http://opentsdb-host:4242/api/version | grep version

Verify Fix Applied:

Verify OpenTSDB version is 2.4.2 or later and test that command injection attempts are properly blocked.

📡 Detection & Monitoring

Log Indicators:

  • Unusual command execution patterns in system logs
  • HTTP requests with shell metacharacters in query parameters
  • Failed authentication attempts followed by API exploitation

Network Indicators:

  • HTTP requests containing shell commands or special characters in query parameters
  • Unusual outbound connections from OpenTSDB host

SIEM Query:

source="opentsdb.log" AND ("cmd.exe" OR "/bin/sh" OR "bash" OR "|" OR ";" OR "$" OR "`")

🔗 References

📤 Share & Export