CVE-2025-27219 is a medium-severity (CVSS 5.8) CWE-770 vulnerability in cgi. A fix is available for cgi — see the affected versions and patch details below.
CGI has Denial of Service (DoS) potential in Cookie.parse
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-27219.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
cgi💎cgi💎cgiReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | cgi | all versions | 0.3.5.1bundle update cgi --conservative |
| 💎RubyGems | cgi | ≥ 0.3.6&&< 0.3.7 | 0.3.7bundle update cgi --conservative |
| 💎RubyGems | cgi | ≥ 0.4.0&&< 0.4.2 | 0.4.2bundle update cgi --conservative |
Affected Products
cgiruby-langDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for cgi, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update cgi to 0.3.5.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-27219 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This issue will cause an excessive resource consumption, potentially resulting in a bad application performance. However, an attacker does have the ability to completely deny service to legitimate users. For this reason, this vulnerability has been rated with a moderate severity.
Do not process large cookies or strings with the CGI::Cookie.parse method from the CGI library. Adding a check to verify and limit the length of the cookie or string before processing it will mitigate this vulnerability.Source: Red Hat security advisory for CVE-2025-27219 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Enterprise Linux 10 | ruby-0:3.3.8-10.el10_0 | RHSA-2025:8131 |
| Red Hat Enterprise Linux 8 | ruby:3.3-8100020250414172630.489197e6 | RHSA-2025:10217 |
| Red Hat Enterprise Linux 8 | ruby:3.1-8100020250407112943.489197e6 | RHSA-2025:4063 |
| Red Hat Enterprise Linux 9 | ruby-0:3.0.7-165.el9_5 | RHSA-2025:4487 |
| Red Hat Enterprise Linux 9 | ruby:3.1-9050020250404144903.9 | RHSA-2025:4488 |
| Red Hat Enterprise Linux 9 | ruby:3.3-9050020250415095239.9 | RHSA-2025:4493 |
Frequently Asked Questions
Is CVE-2025-27219 in your dependencies?
Find it across RubyGems, including transitive dependencies.