CVE-2025-27219
JSON

5.8medium

CGI has Denial of Service (DoS) potential in Cookie.parse

Severity
5.8medium CVSS:3.1 by mitre
Exploit likelihood
0.85% (higher than 59% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-gh9q-2xrm-x6qv

Description

In the CGI gem before 0.4.2 for Ruby, the CGI::Cookie.parse method in the CGI library contains a potential Denial of Service (DoS) vulnerability. The method does not impose any limit on the length of the raw cookie value it processes. This oversight can lead to excessive resource consumption when parsing extremely large cookies.

Affected

Product or packageVersionsReported by
ruby-lang CGIbefore 0.3.5.1, from 0.3.6 before 0.3.7, from 0.4.0 before 0.4.2, 0.3.6CVE List, NVD
cgi (RubyGems)before 0.3.5.1, from 0.3.6 before 0.3.7, from 0.4.0 before 0.4.2GitHub Advisory Database

All scores

mitre5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L
GitHub5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-400CWE-770

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the CGI gem before 0.4.2 for Ruby, the CGI::Cookie.parse method in the CGI library contains a potential Denial of Service (DoS) vulnerability. The method does not impose any limit on the length of the raw cookie value it processes. This oversight can lead to excessive resource consumption when parsing extremely large cookies.

GitHub Advisory Database

There is a possibility for DoS by in the cgi gem. This vulnerability has been assigned the CVE identifier CVE-2025-27219. We recommend upgrading the cgi gem.

Details

CGI::Cookie.parse took super-linear time to parse a cookie string in some cases. Feeding a maliciously crafted cookie string into the method could lead to a Denial of Service.

Please update CGI gem to version 0.3.5.1, 0.3.7, 0.4.2 or later.

Affected versions

cgi gem versions <= 0.3.5, 0.3.6, 0.4.0 and 0.4.1.

Credits

Thanks to lio346 for discovering this issue. Also thanks to mame for fixing this vulnerability.

NVD (es)

En la gema CGI anterior a la versión 0.4.2 para Ruby, el método CGI::Cookie.parse de la librería CGI contiene una posible vulnerabilidad de denegación de servicio (DoS). El método no impone ningún límite en la longitud del valor de cookie sin procesar que procesa. Este descuido puede provocar un consumo excesivo de recursos al analizar cookies extremadamente grandes.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-27219 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-gh9q-2xrm-x6qv changed 2026-09-10CC-BY-4.0
NVDCVE-2025-27219 changed 2026-06-17Public domain