Automated Threat Modeling

Overview of CVE-2026-137479: Traefik Compress Middleware zstd Encoder Memory Exhaustion

A brief summary of CVE-2026-137479, an unauthenticated memory exhaustion denial of service in the Traefik Compress middleware zstd encoder. Covers the root cause, the fix in 3.7.18 and 3.8.0-rc.2, and detection approaches.

CVE Analysis

10 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-26

Overview of CVE-2026-137479: Traefik Compress Middleware zstd Encoder Memory Exhaustion

Introduction

A client that opens many compressed requests and reads them slowly can make Traefik hold about 18 MiB of zstd encoder state per response, with no upper bound, until the proxy process runs out of memory and crashes. Traefik often runs as the edge proxy or Kubernetes ingress, so that crash interrupts every route behind the instance, and the attacker needs no credentials.

Traefik Proxy is an MIT-licensed reverse proxy and ingress controller from Traefik Labs, a company founded in 2015 in Lyon, France. In March 2026 the vendor reported more than 3.4B Docker Hub downloads and 62,000 GitHub stars, and a later article cites more than 1,000 contributors. SUSE K3s uses Traefik as its default ingress, and the vendor names Nutanix Kubernetes Platform and OVHcloud Managed Kubernetes Service among its platform users.

CVE-2026-137479 (GHSA-x5pf-cqh3-2gv8) is scored 7.5 High under CVSS 3.1 and 8.7 High under CVSS 4.0. The impact is limited to availability, with no confidentiality or integrity impact. VulnCheck is the CNA. Traefik published the advisory on November 12, 2026, and NVD published the CVE on November 26, 2026.

Technical information

Root cause

The weakness is CWE-770, allocation of resources without limits or throttling. In pkg/middlewares/compress/compress.go, the function newZstdHandler defines a factory, newZstdWriter, that runs for every response that negotiates zstd. In affected releases, that factory creates the encoder with no options:

writer, err := zstd.NewWriter(rw)

With no options, each encoder uses the klauspost/compress library defaults, including an 8 MiB window. Per the fix PR, that works out to about 18 MiB per encoder. Each encoder stays allocated until its response is fully written. Total memory therefore scales with the number of concurrent, slowly drained responses, and nothing caps that number.

The problem is sustained resource allocation tied to response lifetime. There is no memory corruption or code execution primitive involved.

When the vulnerable path is reached

Traefik's Compress middleware supports gzip, Brotli and Zstandard, and its encodings option defaults to gzip, br, zstd. Zstandard is therefore enabled unless an operator removes it. A response goes through the zstd encoder only when all of the following hold:

  • The route uses the Compress middleware, and zstd is in its encodings list. That includes the default list.
  • The client's Accept-Encoding header offers zstd. A missing header normally disables compression unless defaultEncoding is set, and an explicitly empty header disables it.
  • The response is not already encoded.
  • The response matches the configured content-type inclusion or exclusion rules.
  • The response body exceeds minResponseBodyBytes, which defaults to 1024 bytes.

These are applicability conditions only. The vendor does not offer them as workarounds.

Attack flow

  1. The attacker finds a route behind an affected Traefik instance that uses the Compress middleware and returns a body large enough to be compressed.
  2. The attacker sends many concurrent requests that offer zstd in Accept-Encoding. Each matching response gets its own encoder holding about 18 MiB.
  3. The attacker reads each response very slowly, so no response finishes and no encoder is released.
  4. Process memory grows with the number of stalled responses until Traefik exhausts memory and crashes.

The advisory does not publish a required connection count, a measured time to crash, or a standalone exploit. The related Brotli advisory notes that many compressed responses can be held in flight over a single HTTP/2 connection. Similar multiplexing would likely work against the zstd path.

Severity vectors

  • CVSS 3.1, 7.5 High: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • CVSS 4.0, 8.7 High: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Both vectors describe the same issue: a network attack with low complexity, no privileges and no user interaction. The scores differ only because they come from different CVSS versions.

Threat context

As of November 26, 2026, we found no confirmed exploitation in the wild and no named threat actor in the reviewed sources. VulDB lists KEV status as "no", activity as "very low" and EPSS as 0.00000. The advisory credits jjsaunier as the reporter. That is a research credit, not attacker attribution.

The vendor advisory still shows "No known CVE". The CVE.org record, however, references GHSA-x5pf-cqh3-2gv8 directly, which links the two.

Patch information

Traefik fixed this in v3.7.18 and v3.8.0-rc.2, published November 10, 2026. Both releases list GHSA-x5pf-cqh3-2gv8 under fixed CVEs, and NVD marks 3.7.18 and 3.8.0-rc.2 as unaffected.

The code change is PR #14167, "Limit zstd encoder memory in the Compress middleware" by @juliens. It was merged into the v3.7 branch on November 2, 2026 as commit ce805310. The end-of-life v3.1 through v3.6 lines will not get a backport.

The change

The patch adds no pooling, no connection limits and no new configuration option. It passes explicit, memory-conscious options to the encoder constructor. According to the PR, these are the same options the library's own gzhttp zstd writer uses. The patched factory reads:

newZstdWriter := func(rw http.ResponseWriter) (CompressionWriter, string, error) { writer, err := zstd.NewWriter(rw, zstd.WithEncoderLevel(zstd.SpeedFastest), zstd.WithEncoderConcurrency(1), zstd.WithLowerEncoderMem(true), zstd.WithWindowSize(128<<10), ) if err != nil { return nil, "", fmt.Errorf("creating zstd writer: %w", err) }

The inline comment added by the patch states the rationale: each in-flight response holds one encoder until it is fully written. The default options use about 18 MiB per encoder, while the gzhttp options use less than 1 MiB. Each option reduces a different part of the per-encoder footprint:

  • WithWindowSize(128<<10) lowers the window from 8 MiB to 128 KiB. Window size largely determines the history buffer cost, so this is the largest saving.
  • WithEncoderConcurrency(1) has each encoder process one block at a time instead of keeping state for several blocks in flight.
  • WithLowerEncoderMem(true) tells the library to prefer smaller allocations, at a small cost in speed.
  • WithEncoderLevel(zstd.SpeedFastest) selects the lightest compression level, which uses smaller match-finding tables. That suits a reverse proxy compressing on the fly.

The advisory states the patched encoder uses less than 1 MiB per response, "with no change to the compressed output." The patch does not limit how many responses can be open at once. Instead, each response becomes roughly 18 times or more cheaper, so an attacker needs about that much more concurrency to exhaust memory.

Regression test

The commit adds TestZstdWindowSize to compress_test.go. The test sends a 1 MiB body through the middleware with Accept-Encoding: zstd and checks that the response is zstd encoded. It then decodes the body with a reader that rejects any window larger than 128 KiB:

reader, err := zstd.NewReader(rw.Body, zstd.WithDecoderMaxWindow(128<<10))

The decoded body must match the original exactly. If the window option is ever removed, this strict decoder fails and the test catches the regression. Checking the window size, the main memory driver, is more stable than measuring heap usage directly.

Scope

The diff touches 2 files with 39 additions and 1 deletion: about 9 lines of production code in compress.go and 30 lines of test. Gzip and Brotli handling are unchanged, and so is the middleware's configuration surface, so upgrading needs no config edits.

Detection methods

None of the reviewed sources publish a ready-made Sigma, YARA, Snort/Suricata or Nuclei rule, or any concrete IoC, for this CVE. Detection comes down to two tasks: finding exposed instances, and watching for the resource exhaustion pattern the bug produces.

As a rule of thumb, each slow, zstd-compressed, in-flight response on a vulnerable instance costs roughly 18 times more memory than it does after the patch.

Exposure audit

InfraStack suggests a three-step check:

  1. Run traefik version on each instance. Flag anything from v3.1.0 through v3.7.17, plus v3.8.0-rc.1. Traefik v2 is not affected, because zstd compression only arrived in v3.1.0.
  2. Search both static and dynamic configuration for a Compress middleware whose enabled encodings include zstd. Since zstd is in the default list, treat a Compress middleware with no explicit encodings list as exposed.
  3. Combine the two results. An affected version running Compress with zstd is exposed. Instances without the Compress middleware, or with zstd removed from the encodings list, are listed as not affected.

Flag the end-of-life v3.1 through v3.6 lines permanently in your inventory, since they will never get a fix. Software composition and vulnerability scanners that track the Go module github.com/traefik/traefik/v3 can match it against the same ranges.

Runtime signals

Kripta's write-up names two early warning signs: unusual memory growth in the proxy process, and sudden jumps in open connections. These translate into the following alerts:

  • Process memory: Alert on fast, sustained growth in Traefik's resident memory (container, pod or host RSS) that does not match a normal rise in traffic. Also alert on OOM kills or unexpected restarts of the Traefik container, since a crash is the end state of this attack.
  • Concurrency versus throughput: Look for a high count of in-flight requests or open connections paired with very low bytes per second toward those clients. That pattern looks different from a normal traffic spike.
  • Compression context: Correlate spikes with requests whose Accept-Encoding offers zstd on routes that use the Compress middleware. Routes that return large responses deserve particular attention, because they keep encoders alive longest. One client, or a small set of clients, opening many concurrent zstd requests and draining them slowly is a strong indicator.
  • HTTP/2 streams: Because many responses can be held over a single HTTP/2 connection, the TCP connection count may stay flat during an attack. Monitor in-flight requests or HTTP/2 streams per client as well.

Triage after patching

A memory exhaustion alert on v3.7.18 or v3.7.19 may come from the Brotli counterpart (GHSA-3rh5-223h-cpwr), which is triggered with Accept-Encoding: br and fixed only in v3.7.20 and v3.8.0. Check which encoding the suspicious slow clients negotiated before deciding which flaw is involved.

All of these runtime signals are generic denial of service indicators. They show resource exhaustion consistent with this CVE, not proof that it was exploited. Pair them with the exposure audit, since only an affected version with zstd compression enabled can produce this specific failure.

Affected systems and versions

  • Affected: Traefik 3.1.0 through 3.7.17, and 3.8.0-rc.1, when the Compress middleware has zstd enabled. Zstd is in the default encodings list.
  • End-of-life and affected without a fix: the 3.1, 3.2, 3.3, 3.4, 3.5 and 3.6 branches. Migrate to a patched 3.7 or 3.8 release.
  • Fixed for this CVE: 3.7.18 and 3.8.0-rc.2.
  • Not affected: Traefik v2, since zstd support began in 3.1.0. Also not affected: instances without the Compress middleware, or with zstd removed from the encodings list.

The separate Brotli advisory (GHSA-3rh5-223h-cpwr) affects 3.0.0 through 3.7.19 and 3.8.0-rc.1 through 3.8.0-rc.3, and is fixed in 3.7.20 and 3.8.0. In short, 3.7.18 or 3.8.0-rc.2 fixes CVE-2026-137479, while 3.7.20 or 3.8.0 addresses both documented encoder issues.

Vendor security history

Traefik's November 12, 2026 security announcement for 2.11.62, 3.7.18 and 3.8.0-rc.2 shipped this fix in a batch with several other issues:

  • High severity: an ingress client certificate verification bypass, a protected route bypass, and ForwardAuth credential reuse.
  • Medium severity: BasicAuth CPU consumption.

The Brotli counterpart followed on November 24, 2026.

Traefik's security policy keeps reports private until a fix is available and reproduces findings before accepting them. Fixes ship before advisories are published, and the advisories include affected ranges, CVSS data, mitigations and reporter credit. The record shows a working remediation process, though disclosure volume says nothing about how few flaws exist.

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