# CVE-2025-27219: CGI has Denial of Service (DoS) potential in Cookie.parse

> An attacker can cause a denial of service by sending extremely large cookies to applications using the Ruby CGI library.

- **Severity:** Medium 5.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Mar 2025
- **Updated:** 3 Nov 2025
- **Also known as:** ALPINE-CVE-2025-27219, AZL-57828, AZL-57923, CLEANSTART-2026-BY72007, CLEANSTART-2026-JU41543, DEBIAN-CVE-2025-27219, ECHO-66e4-e8d1-c7e8, GHSA-gh9q-2xrm-x6qv, MINI-39rw-4457-p7w3, MINI-5gxg-72f4-6jwp, MINI-74xg-j2pp-528j, MINI-8rf2-q5jm-5h55, MINI-95rv-j253-f8mg, MINI-c3jm-49p9-5m72, MINI-f8r8-846q-v9p9, MINI-gcvh-xjcv-w237, MINI-jpfc-wfmm-5w9j, MINI-p94m-62w2-jpfp, MINI-pwmx-3r6c-9m64, MINI-wc4p-57pq-43p9, MINI-xff6-mfj2-mh8h, UBUNTU-CVE-2025-27219

## What is CVE-2025-27219?

CVE-2025-27219 is a medium-severity denial of service vulnerability in ruby-lang CGI, published on 3 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling)

## Which versions are affected by CVE-2025-27219?

6 open source packages ship an affected version, including cgi. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cgi` | RubyGems | All versions | 0.3.5.1 |
| `cgi` | RubyGems | All versions | 0.3.5.1 |
| `cgi` | RubyGems | From 0.3.6 | 0.3.7 |
| `cgi` | RubyGems | From 0.3.6 | 0.3.7 |
| `cgi` | RubyGems | From 0.4.0 | 0.4.2 |
| `cgi` | RubyGems | From 0.4.0 | 0.4.2 |

Products: Ruby-Lang Cgi.

## How do I fix CVE-2025-27219?

Upgrade cgi to a fixed version for your release line: 0.3.5.1, 0.3.7 or 0.4.2.

## Is CVE-2025-27219 being exploited?

There is no known exploitation of CVE-2025-27219 in the wild and no public exploit code.

## Other vulnerabilities in ruby-lang CGI

- [CVE-2025-27220](https://insights.sbomify.com/CVE-2025-27220/): CGI has Regular Expression Denial of Service (ReDoS) potential in Util#escapeElement (medium 4.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-27219 and fix it if it is affected.

What it is: CVE-2025-27219 is a medium-severity denial of service vulnerability in ruby-lang CGI, published on 3 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-27219 in the wild and no public exploit code.

Affected packages and fixed versions:
- cgi (RubyGems): affected all versions; fixed in 0.3.5.1
- cgi (RubyGems): affected all versions; fixed in 0.3.5.1
- cgi (RubyGems): affected from 0.3.6; fixed in 0.3.7
- cgi (RubyGems): affected from 0.3.6; fixed in 0.3.7
- cgi (RubyGems): affected from 0.4.0; fixed in 0.4.2
- cgi (RubyGems): affected from 0.4.0; fixed in 0.4.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-27219/ (Markdown: https://insights.sbomify.com/CVE-2025-27219/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-27219
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-27219
- OSV: https://osv.dev/vulnerability/CVE-2025-27219

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-27219/
Summaries are generated and may contain mistakes; the official description above is the record.
