7.5high
Keepalive Connections Causing Denial Of Service in puma
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.60% (higher than 76% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-q28m-8xjw-8vr5
Description
Puma is a concurrent HTTP 1.1 server for Ruby/Rack applications. The fix for CVE-2019-16770 was incomplete. The original fix only protected existing connections that had already been accepted from having their requests starved by greedy persistent-connections saturating all threads in the same process. However, new connections may still be starved by greedy persistent-connections saturating all threads in all processes in the cluster. A `puma` server which received more concurrent `keep-alive` connections than the server had threads in its threadpool would service only a subset of connections, denying service to the unserved connections. This problem has been fixed in `puma` 4.3.8 and 5.3.1. Setting `queue_requests false` also fixes the issue. This is not advised when using `puma` without a reverse proxy, such as `nginx` or `apache`, because you will open yourself to slow client attacks (e.g. slowloris). The fix is very small and a git patch is available for those using unsupported versions of Puma.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| puma puma | < 4.3.8, >= 5.0.0, < 5.3.1, before 4.3.8, from 5.0.0 before 5.3.1 | CVE List, NVD |
| puma (RubyGems) | before 4.3.8, from 5.0.0 before 5.3.1 | GitHub Advisory Database |
| debian debian_linux | 10.0 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
Puma is a concurrent HTTP 1.1 server for Ruby/Rack applications. The fix for CVE-2019-16770 was incomplete. The original fix only protected existing connections that had already been accepted from having their requests starved by greedy persistent-connections saturating all threads in the same process. However, new connections may still be starved by greedy persistent-connections saturating all threads in all processes in the cluster. A `puma` server which received more concurrent `keep-alive` connections than the server had threads in its threadpool would service only a subset of connections, denying service to the unserved connections. This problem has been fixed in `puma` 4.3.8 and 5.3.1. Setting `queue_requests false` also fixes the issue. This is not advised when using `puma` without a reverse proxy, such as `nginx` or `apache`, because you will open yourself to slow client attacks (e.g. slowloris). The fix is very small and a git patch is available for those using unsupported versions of Puma.
GitHub Advisory Database
This vulnerability is related to CVE-2019-16770.
Impact
The fix for CVE-2019-16770 was incomplete. The original fix only protected existing connections that had already been accepted from having their requests starved by greedy persistent-connections saturating all threads in the same process. However, new connections may still be starved by greedy persistent-connections saturating all threads in all processes in the cluster.
A puma server which received more concurrent keep-alive connections than the server had threads in its threadpool would service only a subset of connections, denying service to the unserved connections.
Patches
This problem has been fixed in puma 4.3.8 and 5.3.1.
Workarounds
Setting queue_requests false also fixes the issue. This is not advised when using puma without a reverse proxy, such as nginx or apache, because you will open yourself to slow client attacks (e.g. slowloris).
The fix is very small. A git patch is available here for those using unsupported versions of Puma.
For more information
If you have any questions or comments about this advisory:
- Open an issue in Puma.
- To report problems with this fix or to report another vulnerability, see our security policy.
Acknowledgements
Thank you to @MSP-Greg, @wjordan and @evanphx for their review on this issue.
Thank you to @ioquatix for providing a modified fork of wrk which made debugging this issue much easier.
NVD (es)
Puma es un servidor HTTP versión 1.1 concurrente para aplicaciones Ruby/Rack. La solución para CVE-2019-16770 estaba incompleta. La corrección original solo protegía las conexiones existentes que ya habían sido aceptadas para evitar que sus peticiones se vieran muertas por conexiones persistentes codiciosas que saturaban todos los hilos en el mismo proceso. Sin embargo, es posible que las conexiones persistentes codiciosas sigan privando a las nuevas conexiones que saturan todos los subprocesos en todos los procesos del clúster. Un servidor "puma" que recibiera más conexiones "keep-alive" simultáneas de las que el servidor tenía subprocesos en su grupo de subprocesos daría servicio sólo a un subconjunto de conexiones, negando el servicio a las conexiones no atendidas. Este problema se ha solucionado en "puma" versiones 4.3.8 y 5.3.1. La configuración de "queue_requests false" también soluciona el problema. Esto no se recomienda cuando se usa "puma" sin un proxy inverso, como "nginx" o "apache", porque te expondrás a ataques lentos de clientes (por ejemplo, slowloris). La solución es muy pequeña y hay un parche de git disponible para aquellos que usan versiones no compatibles de Puma
References
| https://github.com/puma/puma/security/advisories/GHSA-q28m-8xjw-8vr5 | patch, third-party-advisory, web | |
| https://gist.github.com/nateberkopec/4b3ea5676c0d70cbb37c82d54be25837 | patch, third-party-advisory, web | |
| https://github.com/puma/puma/security/policy | third-party-advisory, web | |
| https://rubygems.org/gems/puma | product, third-party-advisory, web | |
| https://security.gentoo.org/glsa/202208-28 | third-party-advisory, vendor-advisory, web | |
| https://lists.debian.org/debian-lts-announce/2022/08/msg00015.html | mailing-list, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-29509 | advisory | |
| https://github.com/puma/puma | package | |
| https://github.com/rubysec/ruby-advisory-db/blob/master/gems/puma/CVE-2021-29509.yml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-29509 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-q28m-8xjw-8vr5 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-29509 changed 2026-06-17 | Public domain |