Automated Threat Modeling

Quick Look: Thanos Receive CVE-2026-144679, Tenant ID Path Traversal Leading to Local TSDB Deletion

A brief summary of CVE-2026-144679, a path traversal flaw in Thanos Receive through 0.42.5 where a tenant ID of '.' or '..' can lead tenant pruning to delete all local TSDB data. Covers the root cause, the unmerged candidate patch, interim hardening, and detection guidance.

CVE Analysis

9 min read

Gaurav Sarraf
Gaurav Sarraf

2026-12-03

Quick Look: Thanos Receive CVE-2026-144679, Tenant ID Path Traversal Leading to Local TSDB Deletion

Introduction

A single remote write request that names its tenant . or .. can leave a Thanos Receive instance set up to delete all of its local TSDB data the next time inactive tenants are pruned. The deletion happens later, during routine housekeeping, rather than when the request arrives, so the result can look like unexplained, receiver-wide metrics loss instead of an attack.

Thanos is an open-source project that extends Prometheus deployments with a highly available metrics system, a global query view, and long-term storage. The Cloud Native Computing Foundation accepted it in 2019 and moved it to incubation in 2020. That places it in the core of the cloud-native observability ecosystem, although the sources we reviewed do not establish a market-share figure. Its Receive component accepts Prometheus remote writes and stores them in per-tenant TSDBs on local disk. That is the component affected here.

CVE-2026-144679 is classified as CWE-22 and rated 7.4 High under CVSS 3.1 and 8.3 High under CVSS 4.0. The two scores come from different scoring versions and do not conflict. The CVSS 3.1 vector rates attack complexity as high, privileges and user interaction as none, confidentiality impact as none, and integrity and availability impact as high. The disclosure credits Zachariah Mithani of AploSec.

Technical information

Where the tenant ID comes from

Receive assigns every write to a tenant, and every tenant gets its own TSDB directory named after the tenant ID. The tenant can come from three places:

  • The default THANOS-TENANT HTTP header.
  • An operator-configured header. GetTenantFromHTTP reads the custom header first, but falls back to THANOS-TENANT when the custom header is empty.
  • A client certificate field (Organization, OrganizationalUnit or CommonName) when certificate-based tenancy is configured.

All three paths go through the same validator, IsTenantValid.

Root cause

The only check between the tenant ID and the filesystem is this function in pkg/tenancy/tenancy.go, unchanged in both the v0.42.5 tag and the current main branch:

func IsTenantValid(tenant string) error { if tenant != path.Base(tenant) { return errors.New("tenant name not valid") } return nil }

The intent is that a safe name is its own last path element, so a/b fails because path.Base("a/b") is b. Slash-based traversal such as ../foo is rejected the same way. The gap is that path.Base(".") returns . and path.Base("..") returns ... Both special values equal their own base name, so both pass unchanged and no error is produced.

Receive then builds the tenant TSDB directory by joining the configured data directory with the tenant ID (see pkg/receive/multitsdb.go). With . the joined path resolves to the data directory itself; with .. it resolves to the parent of the data directory. Neither is an ordinary tenant folder.

From an accepted write to os.RemoveAll

The deletion happens during tenant pruning, not at the initial write. Based on the 0.42.5 source:

  1. Receive periodically looks for tenants that have been inactive for longer than the retention period.
  2. It marks such a tenant as inactive and logs that event with the tenant name.
  3. After the applicable checks (the source describes a check that all blocks have been uploaded before pruning) and a delay, it closes the tenant with data deletion enabled, logging that the tenant is being deleted due to inactivity.
  4. The close operation calls os.RemoveAll on the tenant TSDB directory.

When that directory is the data directory or its parent, VulnCheck states the result is deletion of all local TSDB data. The precise scope depends on the resolved path and on what the Receive process is permitted to access on the filesystem.

Attack flow

Based on the VulnCheck advisory and the source, the disclosed method looks like this:

  1. The attacker reaches a Receive remote write endpoint that does not require authentication.
  2. The attacker sends one accepted write with the tenant header set to exactly . or ... The validator accepts it silently.
  3. Receive associates that tenant with a TSDB path resolving to the data directory or its parent.
  4. The attacker stops writing for that tenant.
  5. Once the tenant has been inactive past the retention period, pruning closes it with deletion enabled and os.RemoveAll removes the resolved directory.

Nothing visibly breaks when the request is made, and that gap between steps 2 and 5 matters to attackers and defenders alike.

Impact and limits

The reported consequence is destruction of locally stored metrics, which affects integrity and availability. The advisory does not establish data theft, remote code execution, or deletion of object storage data for this CVE.

Patch information

No official fix for CVE-2026-144679 has been merged or released. The VulnCheck advisory still lists Thanos 0.42.5 and earlier as affected, and IsTenantValid in both v0.42.5 and main still contains the vulnerable check. OpenCVE likewise reports that remediation information is not yet available.

Candidate patch: PR #8949, commit 4f5aa8a

Thanos maintainer Saswata Mukherjee opened PR #8949 ("receive: Stricter tenant validation") on July 29, 2026. It is a two-file change (22 additions, 1 deletion) that imports path/filepath and replaces the validator condition with:

if !filepath.IsLocal(tenant) || tenant != path.Base(tenant) || tenant == "." { return errors.New("tenant name not valid") }

Each condition covers something different:

  • filepath.IsLocal(tenant) from the Go standard library rejects empty strings, absolute paths such as /, and any path containing a .. element. This is what stops ...
  • tenant != path.Base(tenant) is the original check and still rejects names containing separators, such as ./ or a/b.
  • tenant == "." is required because IsLocal treats . as a valid local path (it is the root). Without it, . would still resolve to the data directory.

The commit also adds regression cases to TestIsTenantValid in pkg/receive/handler_test.go, checking that .., ., / and ./ each return tenant name not valid.

Why it was not merged

The author closed the PR the same day, commenting: "This is no longer needed I think as we use os.Root everywhere now." The commit message also argues the issue is not critical because Thanos has no built-in authentication and remote write endpoints should not be exposed publicly. The os.Root reference points to PR #8797, merged on June 3, 2026, which limits the Receiver's filesystem access to its data directory so that .. can no longer reach outside it.

Confining access to a root does not appear to stop ., because . is the root itself. This reading comes from how Go's os.Root works and was not confirmed against Thanos's code, but it is consistent with VulnCheck still listing 0.42.5 as vulnerable.

PR #8806 ("fix(receive): validate tenant label", merged May 6, 2026, and reflected in the 0.42.0 release notes) is sometimes cited as the fix. It applies IsTenantValid() to tenant IDs taken from metric labels when the split tenant label option is set, matching the existing handling for header and certificate tenants. It routes more input through the validator but leaves the validator unchanged, so . and .. still pass.

Interim options

  • Self-maintained builds: the one-line change from commit 4f5aa8a to pkg/tenancy/tenancy.go is the smallest change that blocks both values at validation. Treat it as unofficial until an upstream release includes an equivalent fix.
  • Authenticating proxy: a published Thanos hardening guide recommends placing an authenticating reverse proxy in front of Receive. The proxy authenticates the client (for example with client certificates or bearer tokens), derives the tenant from that identity, and sets the tenant header itself instead of trusting a client-supplied value. Make sure clients cannot bypass the proxy and reach Receive directly. This is general hardening, not a vendor-certified fix.
  • Retention (operational consideration only): in the 0.42.5 source, tsdb.retention defaults to 15 days, 0d disables the retention policy, and the pruning function returns immediately when the retention duration is zero. This is a source-based observation about the pruning path, not a published workaround. Infinite local retention also changes storage behavior, so assess the consequences before changing it.

Detection methods

No vendor-published or community detection content exists yet. As of December 3, 2026, CVETodo found no published Sigma, Suricata, YARA or Nuclei rules and no public exploit, and no source lists attacker IPs, domains or hashes. The CVE advisory reports no confirmed incident or named threat actor, and Rapid7 lists the CVE as absent from the CISA KEV catalog with no EPSS score. Neither proves that exploitation has not occurred. Detection therefore relies on watching the triggering input and the damage that follows. The guidance below is analyst derived from the advisory and source code, not vendor validated, and should be tuned against your own Receive traffic.

Input signals

  • Exact . or .. tenant values are the real exploit attempt. They are accepted silently and nothing is logged as an error.
  • Slash-based variants such as ../x suggest probing. Receive rejects them with tenant name not valid. Seeing that error in Receive responses or logs may indicate someone testing tenant header traversal before trying the working values.

Request-level detection (primary signal)

Alert on any write to Receive where the whole tenant header value is exactly . or ...

  • Check both headers. Because GetTenantFromHTTP falls back to THANOS-TENANT when the custom header is empty, inspecting only your custom header can miss an attacker who sends the default one.
  • Enable header logging. Most reverse proxies, ingress controllers and service mesh sidecars in front of Receive do not record request headers by default. Capture the tenant header on the remote write path, or this signal is invisible.
  • Prefer allowlists. Real tenant IDs are usually a small, known set. Alerting on any tenant outside that set catches . and .. along with other malformed values, in line with CVETodo's advice to watch for malformed or malicious tenant IDs.
  • Review certificate-derived tenants. When a certificate tenant field is configured, a client certificate whose Organization, OrganizationalUnit or CommonName is . or .. would be accepted the same way.

Use the delay before deletion

  • Search historical proxy and ingress logs for the patterns above. A match means an instance may be waiting to wipe itself, which you can address before pruning runs.
  • Look for a tenant ID seen in only one write that never appears again, matching VulnCheck's described pattern of one write followed by silence.

Impact detection

CVEFeed's guidance includes monitoring tenant pruning for unexpected deletions. Normal pruning removes one inactive tenant's directory, so watch for:

  • Receive log events marking a tenant named . or .. as inactive or deleting it due to inactivity, or pruning that affects the root of the data directory instead of a tenant subdirectory. These events alone do not establish malicious activity.
  • File integrity or audit alerts for large recursive deletions under the Receive data path, especially when every tenant's TSDB disappears at once.
  • Receiver-wide data loss, where every tenant on one Receive instance shows a simultaneous gap in local data, which points to this bug rather than routine retention.

Exposure checks

Inventory Thanos Receive deployments at 0.42.5 or earlier and check whether remote write is reachable by unauthenticated clients. Prioritize header logging and alerting on those instances.

Affected systems and versions

  • Product: Thanos (thanos-io), Receive component.
  • Versions: Thanos 0.42.5 and all earlier versions, per the VulnCheck advisory and the CVE record. The vulnerable IsTenantValid check is also still present on the current main branch, and no fixed release has been identified.
  • Exposure conditions:
    • The Receive remote write interface is reachable by clients that are not authenticated, or by any client able to set the tenant header.
    • Tenant identity is taken from the THANOS-TENANT header, a custom-configured header (with fallback to THANOS-TENANT), or a client certificate field.
    • Tenant pruning is active. In the 0.42.5 source, tsdb.retention defaults to 15 days, and pruning returns immediately when retention is set to 0d.
  • Related but distinct: the 0.42.0 change from PR #8806 added validation for tenants derived from split tenant labels. It does not fix this issue.

Vendor security history

The Thanos project states that it applies extensive testing and static analysis to pull requests and provides a private vulnerability reporting channel. Its security policy is explicit that local metric storage is not encrypted and that its server HTTP APIs do not provide configurable authorization or TLS, which is consistent with the maintainer position that remote write endpoints should not be exposed publicly. Tenant handling has seen recent security work: release 0.42.0 added traversal validation for tenant IDs extracted from split tenant labels (PR #8806), and PR #8797 moved Receive filesystem access onto os.Root. Neither change alters the validator logic that lets . and .. through, and the reviewed sources do not establish a quantitative track record or response time.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization