CVE-2022-3215 SwiftNIO vulnerable to Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting')

High 7.5 Published Updated

Attackers can inject newlines into HTTP headers via user input, bypassing security controls and causing cache poisoning or XSS in SwiftNIO applications.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-3215?

CVE-2022-3215 is a high-severity vulnerability in SwiftNIO, published on 28 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

NIOHTTP1 and projects using it for generating HTTP responses can be subject to a HTTP Response Injection attack. This occurs when a HTTP/1.1 server accepts user generated input from an incoming request and reflects it into a HTTP/1.1 response header in some form. A malicious user can add newlines to their input (usually in encoded form) and "inject" those newlines into the returned HTTP response. This capability allows users to work around security headers and HTTP/1.1 framing headers by injecting entirely false responses or other new headers. The injected false responses may also be treated as the response to subsequent requests, which can lead to XSS, cache poisoning, and a number of other flaws. This issue was resolved by adding validation to the HTTPHeaders type, ensuring that there's no whitespace incorrectly present in the HTTP headers provided by users. As the existing API surface is non-failable, all invalid characters are replaced by linear whitespace.

Weakness: CWE-74, CWE-113

Which versions are affected by CVE-2022-3215?

6 open source packages ship an affected version, including github.com/apple/swift-nio. It affects 1 product.

PackageAffectedFixed in
github.com/apple/swift-nio SwiftURLAll versions2.29.1
github.com/apple/swift-nio SwiftURLAll versions2.29.1
github.com/apple/swift-nio SwiftURLFrom 2.39.02.39.1
github.com/apple/swift-nio SwiftURLFrom 2.39.02.39.1
github.com/apple/swift-nio SwiftURLFrom 2.41.02.42.0
github.com/apple/swift-nio SwiftURLFrom 2.41.02.42.0

Products include Apple Swiftnio.

How do I fix CVE-2022-3215?

Upgrade github.com/apple/swift-nio to a fixed version for your release line: 2.29.1, 2.39.1 or 2.42.0.

Is CVE-2022-3215 being exploited?

There is no known exploitation of CVE-2022-3215 in the wild and no public exploit code.

Sources

Also known as GHSA-7fj7-39wj-c64f.

Is CVE-2022-3215 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free