CVE-2026-28975
Last modified
CVE-2026-28975 is a medium-severity vulnerability rated 6.9/10 on the CVSS scale. ### Impact When `NIOHTTPRequestDecompressor` is configured with `.ratio(N)`, the decompression limit is enforced using the `Content-Length` header value from the incoming request rather than the actual number of compressed bytes received. Since `Content-Length` is attacker-controlled, a malicious client can supply an inflated value that causes the ratio check to always pass, effectively disabling the configured decompression limit. This allows an attacker to send a small, highly-compressed payload (a "gzip bomb") with a falsified `Content-Length` header to bypass the ratio-based protection entirely.
Description
### Impact When `NIOHTTPRequestDecompressor` is configured with `.ratio(N)`, the decompression limit is enforced using the `Content-Length` header value from the incoming request rather than the actual number of compressed bytes received. Since `Content-Length` is attacker-controlled, a malicious client can supply an inflated value that causes the ratio check to always pass, effectively disabling the configured decompression limit. This allows an attacker to send a small, highly-compressed payload (a "gzip bomb") with a falsified `Content-Length` header to bypass the ratio-based protection entirely. The server will decompress the payload without limit, consuming unbounded memory and potentially causing denial of service. For example, a gzip payload containing highly repetitive data can achieve amplification ratios of several hundred to one. Under `.ratio(10)` such a payload should be rejected, but if the attacker sets `Content-Length` to match the decompressed size, the check evaluates `decompressed > decompressed * 10` which is always false, and the payload is accepted without error. Across repeated requests, this allows sustained memory amplification far exceeding the configured limits with no error raised. ### Relationship to CVE-2020-9840 GHSA-xhhr-p2r9-jmm7 (CVE-2020-9840) found that the `.size` limit checked compressed rather than decompressed bytes and recommended `.ratio` as a workaround. This advisory identifies a distinct flaw in the `.ratio` limit itself: it uses the attacker-supplied `Content-Length` header as the denominator rather than actual consumed compressed bytes. The two vulnerabilities are in the same decompression limit enforcement code but involve non-overlapping logic errors. Users who followed the CVE-2020-9840 workaround by switching to `.ratio(N)` are affected by this vulnerability. ### Patches Fixed in swift-nio-extras 1.34.1. The fix unifies the request and response decompressor implementations so that both accumulate actual compressed bytes received (`compressedLength += part.readableBytes`) rather than relying on any header-supplied value. ### Workarounds Use `.size(N)` instead of `.ratio(N)` if a fixed upper bound on decompressed output is acceptable for the application. The `.size` limit is not affected by this vulnerability as it does not reference `Content-Length`. ### Credits NIOExtras is grateful to @nathanielmiller23 for their reporting and assistance with the process.
Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
Weakness Enumeration
References
Timeline
- Published
- Last Modified
- Status
- GHSA
Frequently Asked Questions
What is CVE-2026-28975?
How severe is CVE-2026-28975?
How do I fix CVE-2026-28975?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2026
- CVE-2026-2897A security vulnerability has been detected in funadmin up to…4.8
- CVE-2026-28970Programs using swift-nio is vulnerable to HTTP request smugg…6.3
- CVE-2026-28971The issue was addressed with improved UI handling. This issu…4.3
- CVE-2026-28972An out-of-bounds write issue was addressed with improved inp…6.5
- CVE-2026-28973An integer overflow was addressed with improved input valida…8.6
- CVE-2026-28974This issue was addressed with improved checks to prevent una…7.5
- CVE-2026-28976An information leakage was addressed with additional validat…7.5
- CVE-2026-28977The issue was addressed with improved bounds checks. This is…6.2
- CVE-2026-28978A permissions issue was addressed with additional restrictio…8.8
- CVE-2026-28979An out-of-bounds access issue was addressed with improved bo…6.5
- CVE-2026-2898A vulnerability was detected in funadmin up to 7.1.0-rc4. Th…6.5
- CVE-2026-28980### Summary The `HTTPDecoder` in `NIOHTTP1` enforces no lim…8.7
Are you affected by CVE-2026-28975?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
