Executive brief
Tesla is a popular HTTP client library for the Elixir programming language. A vulnerability exists where the library fails to limit the size of decompressed data when receiving responses from a server. An attacker-controlled server can send a specially crafted, highly compressed 'decompression bomb' that expands to gigabytes in memory, causing the application to crash or freeze and resulting in a denial of service.
Technical details
The vulnerability exists in the `Tesla.Middleware.DecompressResponse` and `Tesla.Middleware.Compression` components. The `decompress_body/2` function in `lib/tesla/middleware/compression.ex` recursively calls `:zlib.gunzip/1` or `:zlib.unzip/1` based on the `content-encoding` header without enforcing any output size limits. By providing multiple encoding tokens (e.g., 'gzip, gzip, gzip'), an attacker can achieve exponential data amplification. A small network payload can thus materialize as gigabytes of data on the BEAM heap, leading to memory exhaustion (CWE-409). The issue is fixed in version 1.18.3.
Affected products
- elixir-tesla tesla >= 0.6.0, < 1.18.3
Timeline
- 2026-06-02: disclosed: Initial disclosure and NVD publication
- 2026-07-10: advisory: GitHub Advisory published/reviewed
- 1.18.3: patched