CVE-2026-144679 — Thanos-io Thanos (0.42.5) — CWE-22
Thanos through 0.42.5 contains a path traversal vulnerability in Receive that allows unauthenticated remote-write clients to target the data directory by supplying '.' or '..' as the tenant ID. Attackers can send one write with such a THANOS-TENANT header and stop writing, causing tenant pruning to call os.RemoveAll and delete all local TSDB data.
Thanos through 0.42.5 contains a path traversal vulnerability in Receive that allows unauthenticated remote-write clients to target the data directory by supplying '.' or '..' as the tenant ID. Attackers can send one write with such a THANOS-TENANT header and stop writing, causing tenant pruning to call os.RemoveAll and delete all local TSDB data.
🎯 What is this vulnerability?
CVE-2026-144679 is a Path Traversal (CWE-22) vulnerability in Thanos (a scalable, highly available Prometheus-compatible long-term storage solution) up to version 0.42.5.
The flaw resides in the Receive component, which handles data ingestion via the Prometheus Remote Write protocol. The vulnerability stems from a lack of proper input validation and sanitization on the THANOS-TENANT header.
1. Missing Validation: The Receive service accepts a tenant ID from the THANOS-TENANT HTTP header. It fails to validate that this ID is a safe filesystem path component.
2. Path Traversal: An attacker can supply . (current directory) or .. (parent directory) as the tenant ID.
3. Logic Flaw in Pruning: Thanos has a background process that prunes (deletes) tenants that have not received data for a certain period. When a tenant ID is . or .., the pruning logic incorrectly resolves the path to the root data directory of the Thanos instance.
4. Destructive Action: The pruning process calls os.RemoveAll on the resolved path. Since the path resolves to the root data directory, all local TSDB (Time Series Database) data is deleted.
CVSS Vector Analysis:
- AV:N / PR:N / UI:N: Exploitable remotely without authentication or user interaction.
- AC:H (High Complexity): The attacker must time the request correctly to trigger the pruning logic, or the pruning interval must be short enough to be triggered shortly after the malicious write. It is not a simple "send request and get RCE" but requires understanding the internal pruning lifecycle.
- I:H / A:H: High impact on Integrity (data deletion) and Availability (service disruption due to data loss).
- C:N: No direct confidentiality impact (data is deleted, not exfiltrated).
- Target Identification: Identify Thanos
receiveendpoints. These are typically exposed on port10902(default forthanos receive) or behind a reverse proxy. - Version Check: Check the
User-Agentor response headers for Thanos version. Versions ≤ 0.42.5 are vulnerable. - Service Verification: Confirm the endpoint accepts Prometheus Remote Write requests. A simple
curlwith a valid remote write payload (even empty) should return a200 OKor202 Accepted.
⚡ Attack Chain
1. Discovery & Reconnaissance
2. Exploitation
The attacker sends a single Remote Write request with a maliciousTHANOS-TENANT header. The goal is to create a "tenant" that resolves to the root data directory.Illustrative PoC (curl):
Note: The exact URI path for the remote write endpoint in Thanos Receive is typically/api/v1/receiveor similar, depending on configuration. TheTHANOS-TENANTheader is the critical vector. The payload body must be a valid Prometheus Remote Write protobuf message (even if empty or minimal) to be accepted by the ingestion pipeline.
# Generate a minimal valid Prometheus Remote Write protobuf payload
# This is a base64-encoded empty or minimal timeseries message
PAYLOAD=$(echo -n "" | base64)
# Send the malicious request
# The key is the THANOS-TENANT header set to '.' or '..'
curl -X POST "http://<THANOS_RECEIVE_HOST>:10902/api/v1/receive" \
-H "Content-Type: application/x-protobuf" \
-H "THANOS-TENANT: ." \
--data-binary "$PAYLOAD"Mechanism:
1. The request is accepted by the Receive service.
2. The tenant ID . is stored in the internal tenant registry.
3. The background pruning process runs (interval depends on configuration, e.g., every 5 minutes).
4. The pruner identifies tenant . as inactive (if no further writes are sent).
5. The pruner constructs the path: <DATA_DIR>/. which resolves to <DATA_DIR>.
6. os.RemoveAll(<DATA_DIR>) is executed.
7. All TSDB data is deleted.
3. Post-Exploitation
🌍 Real World Impact
Practical Consequences:
🛡️ Remediation & Mitigation
1. Upgrade
. and .. and other unsafe path components.2. Workarounds (If Immediate Upgrade is Not Possible)
10902) to only trusted Prometheus instances. Use firewall rules to block external access.THANOS-TENANT headers containing . or ...Example Nginx Configuration:
location /api/v1/receive {
# Reject malicious tenant IDs
if ($http_thanos_tenant ~* "(\.\.)|(\.)") {
return 403;
}
proxy_pass http://thanos_receive_backend;
}3. Detection
os.RemoveAll calls or pruning events involving tenant IDs . or ...THANOS-TENANT headers set to . or ...auditd or inotify to monitor the Thanos data directory for mass deletion events.Example Log Pattern (Thanos Logs):
level=error ts=2026-12-04T12:00:00Z caller=pruner.go:123 msg="failed to prune tenant" tenant="." err="permission denied"(Note: The exact log message may vary, but the presence of tenant="." or tenant=".." in pruning logs is a strong IoC.)
⚠️ Urgency
Note: While the exploit complexity is high, the impact is severe (complete data loss). In environments where Thanos is exposed to the internet or untrusted internal networks, this should be treated as a critical vulnerability despite the "High" CVSS score.
[🤖 CVE Professor AI Security Engine]
FOFA Query