CVE-2026-28970: SwiftNIO CRLF Injection Vulnerability
MODERATECVE-2026-28970 is a MODERATE crlf injection vulnerability (CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')) affecting SwiftNIO libraries in the SwiftURL ecosystem. The issue involves crlf injection in outbound http request uri via niohttprequestheadersvalidator. Remediation is available by upgrading affected packages to version 2.100.0.
CVE-2026-28970 at a Glance
How to Fix CVE-2026-28970
To remediate this vulnerability, upgrade all affected SwiftNIO dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/apple/swift-nio to 2.100.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/apple/swift-nio
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-28970, inspect your project dependencies for SwiftNIO:
inspect dependencies for github.com/apple/swift-nio
Analyze the terminal output to locate any version of SwiftNIO in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.100.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection'), where the product uses crlf (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes crlf sequences from inputs. In SwiftNIO, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-28970 Affected SwiftNIO Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/apple/swift-nio
|
SwiftURL |
≥ 2.0.0
< 2.100.0
|
2.100.0
|
References
Frequently Asked Questions
What is CVE-2026-28970?
Which SwiftNIO versions are affected?
What version fixes CVE-2026-28970?
Is github.com/apple/swift-nio affected?
What CWE is associated with CVE-2026-28970?
How can I check SwiftURL dependencies for CVE-2026-28970?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cq87-8r7h-962v",
"modified" : "2026-06-12T15:07:01Z",
"published" : "2026-06-12T15:07:01Z",
"aliases" : [ "CVE-2026-28970" ],
"summary" : "SwiftNIO: CRLF Injection in outbound HTTP request URI via NIOHTTPRequestHeadersValidator",
"details" : "Programs using swift-nio is vulnerable to HTTP request smuggling and HTTP response splitting attacks, caused by insufficient validation of outbound HTTP/1.1 request and response start line components.\n\nThis vulnerability affects all swift-nio versions from 2.0.0 to 2.99.0. It is fixed in 2.100.0 and later releases. \n \nThis vulnerability is caused by the `NIOHTTPRequestHeadersValidator` and `NIOHTTPResponseHeadersValidator` channel handlers only validating header field names and values, while leaving the request URI, request method, and response reason phrase unvalidated. An attacker who can influence the content of these fields — for example by controlling a URL path or a custom HTTP method in a proxy application — can inject CR/LF sequences or other control characters into the HTTP start line. This allows construction of arbitrary additional HTTP requests or responses on the wire, a classic HTTP request smuggling or HTTP response splitting attack.\n\nExploiting this vulnerability requires the attacker to influence the content of outbound HTTP start line fields. In proxy applications that forward attacker-controlled URIs or methods, this is straightforward. For clients, a malicious server that triggers a redirect to a crafted URL could exploit the URI validation gap. For servers, any client that can cause the server to emit a crafted response reason phrase could exploit the response splitting gap. \n \nIn vulnerable applications, where attacker controlled data is supplied to these fields, the attack is low-effort: injecting a CRLF sequence into a URI or reason phrase requires only a single crafted request. Successful exploitation can allow an attacker to smuggle additional HTTP requests past intermediaries or split HTTP responses, potentially bypassing WAFs or poisoning web caches. However, most applications are not vulnerable at all.\n \nThe risk can be mitigated by ensuring that all user-controlled input is sanitized before being used in HTTP start line components. However, this mitigation places the burden on application developers and is error-prone.\n \nThe issue is fixed by extending `NIOHTTPRequestHeadersValidator` to validate request URIs against the character set defined in RFC 9112 Section 3.2 and RFC 3986 Section 3, and to validate custom HTTP methods against the token grammar defined in RFC 9110. `NIOHTTPResponseHeadersValidator` is extended to validate custom response reason phrases against RFC 9112 Section 4. Applications that use these validator channel handlers — which are installed by default when using `addHTTPClientHandlers()` or `addHTTPServerHandlers()` — will reject invalid outbound messages with an HTTPParserError.invalidHeaderToken error rather than emitting them to the network.\n\nSwiftNIO is grateful to @kuranikaran and @YLChen-007 for their reporting and assistance with the project's process.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:H/SA:N/E:U"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "SwiftURL",
"name" : "github.com/apple/swift-nio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.100.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.99.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/apple/swift-nio/security/advisories/GHSA-cq87-8r7h-962v"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apple/swift-nio"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-93" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-12T15:07:01Z",
"nvd_published_at" : null
}
}