CVE-2026-28970: SwiftNIO CRLF Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-cq87-8r7h-962v
CWE-93
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-28970
GHSA Identifier GHSA-cq87-8r7h-962v
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')
Affected Product SwiftNIO
Package Ecosystem SwiftURL
Published Date
Last Updated

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.

github.com/apple/swift-nio fixed: 2.100.0
Upgrade github.com/apple/swift-nio to 2.100.0
Verify Direct and Transitive Dependencies

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

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. This vulnerability affects all swift-nio versions from 2.0.0 to 2.99.0. It is fixed in 2.100.0 and later releases. This 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. Exploiting 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. In 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. The 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. The 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. SwiftNIO is grateful to @kuranikaran and @YLChen-007 for their reporting and assistance with the project's process.

CVE-2026-28970 Affected SwiftNIO Versions

1 component(s)
Fixed Versions:
2.100.0
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?
CVE-2026-28970 is a security vulnerability in SwiftNIO involving CRLF Injection in outbound HTTP request URI via NIOHTTPRequestHeadersValidator under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection').
Which SwiftNIO versions are affected?
Affected versions include releases prior to 2.100.0 across affected packages: github.com/apple/swift-nio.
What version fixes CVE-2026-28970?
Upgrading to 2.100.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/apple/swift-nio affected?
Yes, github.com/apple/swift-nio is affected in releases prior to 2.100.0. Upgrade your dependency to 2.100.0 or later.
What CWE is associated with CVE-2026-28970?
CVE-2026-28970 is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection') (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.).
How can I check SwiftURL dependencies for CVE-2026-28970?
Run the dependency tree command: 'inspect dependencies for github.com/apple/swift-nio'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}