# GHSA-mgc4-wqv7-4pxm: SwiftNIO vulnerable to HTTP request smuggling using malformed Transfer-Encoding header

> Attackers can exploit HTTP request smuggling via malformed headers to bypass authentication or routing controls in applications using SwiftNIO.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 May 2023

## What is GHSA-mgc4-wqv7-4pxm?

GHSA-mgc4-wqv7-4pxm is a vulnerability in github.com/apple/swift-nio, published on 18 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact

Affected SwiftNIO systems are vulnerable to request smuggling attacks, in which they parse a given HTTP message differently from other network parties, potentially seeing a different number of requests than other servers. This can lead to failures of authentication, routing, and other issues.

This vulnerability can be found in the bundled copy of the Node.JS HTTP parser used in the `NIOHTTP1` module.

### Workarounds

No workaround is available, users must upgrade.

### References

https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#http-request-smuggling-using-malformed-transfer-encoding-header-critical-cve-2019-15605

## Which versions are affected by GHSA-mgc4-wqv7-4pxm?

4 open source packages ship an affected version, including github.com/apple/swift-nio.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/apple/swift-nio` | SwiftURL | From 1.0.0 | 1.14.2 |
| `github.com/apple/swift-nio` | SwiftURL | From 1.0.0 | 1.14.2 |
| `github.com/apple/swift-nio` | SwiftURL | From 2.0.0 | 2.13.1 |
| `github.com/apple/swift-nio` | SwiftURL | From 2.0.0 | 2.13.1 |

## How do I fix GHSA-mgc4-wqv7-4pxm?

Upgrade github.com/apple/swift-nio to a fixed version for your release line: 1.14.2 or 2.13.1.

## Is GHSA-mgc4-wqv7-4pxm being exploited?

There is no known exploitation of GHSA-mgc4-wqv7-4pxm in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-mgc4-wqv7-4pxm and fix it if it is affected.

What it is: GHSA-mgc4-wqv7-4pxm is a vulnerability in github.com/apple/swift-nio, published on 18 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-mgc4-wqv7-4pxm in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/apple/swift-nio (SwiftURL): affected from 1.0.0; fixed in 1.14.2
- github.com/apple/swift-nio (SwiftURL): affected from 1.0.0; fixed in 1.14.2
- github.com/apple/swift-nio (SwiftURL): affected from 2.0.0; fixed in 2.13.1
- github.com/apple/swift-nio (SwiftURL): affected from 2.0.0; fixed in 2.13.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-mgc4-wqv7-4pxm/ (Markdown: https://insights.sbomify.com/GHSA-mgc4-wqv7-4pxm/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-mgc4-wqv7-4pxm

---
From sbomify Insights: https://insights.sbomify.com/GHSA-mgc4-wqv7-4pxm/
Summaries are generated and may contain mistakes; the official description above is the record.
