CVE-2021-21328
JSON

5.3medium

Denial of Service

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.86% (higher than 79% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-gcj9-jj38-hwmc

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.

Affected

Product or packageVersionsReported by
vapor vapor<= 4.40.0CVE List
github.com/vapor/vapor (SwiftURL)before 4.40.1GitHub Advisory Database
vapor_project vaporbefore 4.40.1NVD

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P

Classification

What each source says

CVE List

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.

GitHub Advisory Database
Impact

This is a DoS attack against anyone who Bootstraps a metrics backend for their Vapor app with the following 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
Patches

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.

Workarounds

Don't bootstrap a metrics system or upgrade to 4.40.1

For more information

If you have any questions or comments about this advisory:

NVD (es)

Vapor es un framework para Swift.&#xa0;En Vapor versiones anteriores a 4.40.1, se presenta un ataque DoS contra cualquiera que inicie un backend de métricas para su aplicación Vapor.&#xa0;El siguiente es el vector de ataque: 1. Enviar peticiones ilimitadas contra una instancia de vapor con diferentes rutas,&#xa0;esto creará contadores y temporizadores ilimitados, que eventualmente agotarán el sistema.&#xa0;2. Los servicios aguas abajo también pueden sufrir este ataque al recibir spam con rutas de error.&#xa0;Esto ha sido parcheado en versión 4.40.1.&#xa0;El "DefaultResponder" reescribirá cualquier ruta de rutas no definida para "vapor_route_undefined" para evitar contadores ilimitados

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21328 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-gcj9-jj38-hwmc changed 2026-07-08CC-BY-4.0
NVDCVE-2021-21328 changed 2026-06-17Public domain