[CVE-2025-27219] Denial of Service in CGI::Cookie.parse
The CGI::Cookie.parse method in the Ruby cgi gem took super-linear time to parse certain cookie strings. An attacker could feed a maliciously crafted cookie string to cause a denial of service, leading to service disruptions and increased costs.
- Disclosed after 2 months
Summary by the program
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.
The report
Hi, I made a report in #2936778 Advisory: https://www.ruby-lang.org/en/news/2025/02/26/security-advisories/
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.
Impact
An attacker could make a Denial of Service vulnerability that cause service disruptions and increased costs.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the parsing algorithm had super-linear time complexity for certain inputs, causing excessive CPU use.
Impact
An attacker could cause a denial of service, leading to service disruptions and increased costs.
What the attacker needed
Ability to send a crafted cookie string
The fix
The cgi gem should be upgraded to a version that fixes the parsing complexity.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A cookie is a small piece of data a website stores in your browser. The Ruby library that reads cookies could become very slow when given a specially crafted cookie, which could make a website stop responding. This is called a denial of service because the attacker denies normal service to others.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.