Skip to main content

swift-nio-extras CVE-2026-28975

MEDIUM
Improper Handling of Highly Compressed Data (Data Amplification) (CWE-409)
2026-06-12 https://github.com/apple/swift-nio-extras GHSA-6ph5-fww6-vfwv
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify target Swift NIO server accepting compressed HTTP bodies
  2. Delivery
    Craft gzip bomb payload with high amplification ratio
  3. Exploit
    Set Content-Length header to expected decompressed size
  4. Execution
    Send repeated requests to bypass ratio check
  5. Persist
    Server decompresses without limit, exhausting memory
  6. Impact
    Denial of service achieved

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Compression ratio limits
Exploitation Conditions

Exploitation requires that the target application: (1) uses the NIOHTTPRequestDecompressor middleware from swift-nio-extras, and (2) configures it specifically with the .ratio(N) decompression limit rather than .size(N) or no limit. Applications that do not use NIOHTTPRequestDecompressor, or that use .size(N) instead of .ratio(N), are not affected. The attacker must be able to send HTTP requests with a compressed body and a controlled Content-Length header to the server - no authentication is required and no special privilege or account is needed. Limiting factors: the vulnerability is only exploitable on endpoints that actually accept and decompress request bodies; read-only or non-body-accepting endpoints (e.g., GET-only routes) are not a viable target surface even on an otherwise vulnerable server.

Impact

No CVSS vector was provided by the vendor or NVD at time of analysis; the scores below are independently assessed. The attack is network-reachable, requires no authentication, no user interaction, and no special attack complexity - the only prerequisite is that the target application explicitly uses the .ratio(N) configuration rather than .size(N). This is a moderately common configuration pattern, especially in deployments that followed CVE-2020-9840 remediation guidance, increasing the realistic exposure. The vulnerability is purely a denial-of-service primitive with no confidentiality or integrity impact. No EPSS score is available, and the vulnerability is not listed in CISA KEV, suggesting no confirmed active exploitation at time of analysis. However, the bypass technique is trivial to reproduce independently from the advisory description alone, meaning exploit development barrier is very low. Real-world severity is moderate-to-high for affected deployments: a single attacker with sustained HTTP access can repeatedly trigger unbounded memory allocation, potentially crashing or degrading service without any server-side error being raised, which also complicates detection.

Exploit ScenarioDerived

An unauthenticated attacker sends a sequence of HTTP POST requests to a Swift NIO server endpoint that accepts compressed request bodies, each containing a small gzip-encoded payload of highly repetitive data achieving 300:1 or greater compression ratio. Each request includes a falsified Content-Length header set to the expected decompressed size, causing the ratio check to evaluate as decompressed > decompressed * N - always false - and accept the payload without error. Across dozens of concurrent requests the server allocates unbounded memory for each decompressed body, exhausting heap memory and triggering an out-of-memory crash or severe service degradation with no error logged by the decompression middleware.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 12, 2026

Denial of service via gzip bomb in swift-nio-extras NIOHTTPRequestDecompressor affects any Swift server using the .ratio(N) decompression limit, allowing unauthenticated remote attackers to exhaust server memory without limit. The ratio enforcement logic incorrectly uses the attacker-supplied Content-Length request header as the denominator of the compression ratio check instead of the actual number of compressed bytes received, making the check trivially bypassable. No public exploit code has been identified at time of analysis, but the bypass technique is straightforward and requires no special tooling - any HTTP client capable of crafting a gzip payload with a falsified Content-Length header can trigger it repeatedly to sustain memory amplification.

RemediationAI

The primary fix is to upgrade swift-nio-extras to version 1.34.1 or later, which is confirmed patched per the vendor advisory at https://github.com/apple/swift-nio-extras/security/advisories/GHSA-6ph5-fww6-vfwv. The patch unifies request and response decompressor logic so that actual compressed bytes received are accumulated rather than using the Content-Length header. If an immediate upgrade is not feasible, the documented workaround is to switch from .ratio(N) to .size(N) in the NIOHTTPRequestDecompressor configuration - the .size(N) limit caps absolute decompressed output bytes and does not reference any header value, making it immune to this bypass. The trade-off of .size(N) is that it requires knowing an acceptable fixed upper bound on decompressed body size in advance, which may reject legitimate large payloads that .ratio was intended to permit. Applications that switched to .ratio(N) specifically as a CVE-2020-9840 workaround should treat this upgrade as urgent, since their current configuration was adopted under a now-invalid security assumption.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

swift-nio-extras is Apple's supplementary library for Swift NIO, a non-blocking I/O framework for building high-performance network servers in Swift. The affected component is NIOHTTPRequestDecompressor, which transparently decompresses incoming HTTP request bodies. CWE-409 (Improper Handling of Highly Compressed Data - 'Zip Bomb') describes the root cause class: the decompressor fails to account for adversarially crafted compression ratios. Specifically, the .ratio(N) guard evaluates decompressedBytes > Content-Length * N; since Content-Length is an HTTP header under attacker control, setting it to the expected decompressed size makes the check read as decompressed > decompressed * N, which is always false for positive N. This is distinct from CVE-2020-9840, where the .size limit incorrectly measured compressed rather than decompressed bytes - Apple's own advisory for that earlier CVE recommended .ratio(N) as a workaround, meaning users who followed that guidance are now directly affected by this vulnerability. The fix in 1.34.1 accumulates actual bytes received via compressedLength += part.readableBytes, eliminating any reliance on header-supplied values. Affected package: pkg:swift/github.com_apple_swift-nio-extras versions prior to 1.34.1.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

vuln.today AI 7.5 HIGH

Network-reachable, no auth or user interaction needed; only availability is impacted via unbounded memory exhaustion.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 87% exploitable
Threat Intel
1
1 source
Data Quality
2 sources
Confidence: Low
CVE.org EPSS GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:swift/github.com_apple_swift-nio-extras

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy