CVE-2021-21328 Denial of Service
Attackers can cause denial of service by sending unlimited requests with unique paths, exhausting system resources in Vapor apps using metrics backends.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-21328?
CVE-2021-21328 is a medium-severity denial of service vulnerability in vapor, published on 26 Feb 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Vapor is a web framework for Swift. In Vapor before version 4.40.1, there is a DoS attack against anyone who Bootstraps a metrics backend for their Vapor app. The following is the attack vector: 1. send unlimited requests against a vapor instance with different paths. this will create unlimited counters and timers, which will eventually drain the system. 2. downstream services might suffer from this attack as well by being spammed with error paths. This has been patched in 4.40.1. The `DefaultResponder` will rewrite any undefined route paths for to `vapor_route_undefined` to avoid unlimited counters.
Weakness: CWE-400
Which versions are affected by CVE-2021-21328?
2 open source packages ship an affected version, including github.com/vapor/vapor. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/vapor/vapor SwiftURL | All versions | 4.40.1 |
github.com/vapor/vapor SwiftURL | All versions | 4.40.1 |
Products include Vapor Project Vapor.
How do I fix CVE-2021-21328?
Upgrade github.com/vapor/vapor to 4.40.1 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2021-21328 being exploited?
There is no known exploitation of CVE-2021-21328 in the wild and no public exploit code.
Other vulnerabilities in vapor
Sources
Also known as GHSA-gcj9-jj38-hwmc.