CVE-2025-27219 — Vulnerability in cgi — CVE Details
CGI has Denial of Service (DoS) potential in Cookie.parse
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.50%). Schedule for your next planned update.
Does your project use an affected cgi version?
Paste your Gemfile.lock to check it for CVE-2025-27219 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published March 3, 2025 (634 days ago).
- Last revised September 10, 2026 — 555 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install cgi -v 0.3.7
gem install cgi -v 0.4.2
gem install cgi -v 0.3.5.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (3)
Affects 1 ecosystem: RubyGems (1).
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 5.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L
References
- https://nvd.nist.gov/vuln/detail/CVE-2025-27219ADVISORY
- https://github.com/ruby/cgi/pull/52WEB
- https://github.com/ruby/cgi/pull/53WEB
- https://github.com/ruby/cgi/pull/54WEB
- https://hackerone.com/reports/2936778WEB
- https://github.com/ruby/cgiPACKAGE
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/cgi/CVE-2025-27219.ymlWEB
- https://lists.debian.org/debian-lts-announce/2025/03/msg00008.htmlWEB
- https://www.cve.org/CVERecord?id=CVE-2025-27219WEB
Frequently Asked Questions
- What is CVE-2025-27219?
- CGI has Denial of Service (DoS) potential in Cookie.parse. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.8/10).
- How do I check if my project is affected by CVE-2025-27219?
- CVE-2025-27219 affects cgi. It has a 1.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-27219 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is an above-median EPSS score — 74.5% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2021-41816CRITICAL
Buffer overrun in CGI.escape_html
- CVE-2021-41819HIGH
Cookie Prefix Spoofing in CGI::Cookie.parse
- CVE-2021-33621HIGH
HTTP response splitting in CGI
- CVE-2026-128084MEDIUM
sqlite3-ruby: Possible SQL query truncation when a string is 4 GiB or larger
- CVE-2026-115472MEDIUM
Doorkeeper: When using public clients, any client can revoke any access token
- CVE-2025-27220MEDIUM
CGI has Regular Expression Denial of Service (ReDoS) potential in Util#escapeElement