CVE-2025-27219: Cgi Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-gh9q-2xrm-x6qv
CVSS 5.8
CWE-400 CWE-770
Published
Advisory Summary

CVE-2025-27219 is a MODERATE (CVSS 5.8) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Cgi libraries in the RubyGems ecosystem. The issue involves cgi has denial of service (dos) potential in cookie.parse. Remediation is available by upgrading affected packages to version 0.3.5.1, 0.3.7, 0.4.2.

CVE-2025-27219 at a Glance

CVE Identifier CVE-2025-27219
GHSA Identifier GHSA-gh9q-2xrm-x6qv
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Cgi
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2025-27219

To remediate this vulnerability, upgrade all affected Cgi dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

cgi fixed: 0.3.5.1
Upgrade cgi to 0.3.5.1
cgi fixed: 0.3.7
Upgrade cgi to 0.3.7
cgi fixed: 0.4.2
Upgrade cgi to 0.4.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for cgi

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-27219, inspect your project dependencies for Cgi:

inspect dependencies for cgi

Analyze the terminal output to locate any version of Cgi in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.5.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Cgi, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2025-27219 Affected Cgi Versions

3 component(s)
Fixed Versions:
0.3.5.10.3.70.4.2
Product / Package Ecosystem Affected Versions Fixed Version
cgi
RubyGems
< 0.3.5.1
0.3.5.1
cgi
RubyGems
≥ 0.3.6
< 0.3.7
All 1 versions
0.3.6
0.3.7
cgi
RubyGems
≥ 0.4.0
< 0.4.2
0.4.2

References

Frequently Asked Questions

What is CVE-2025-27219?
CVE-2025-27219 is a security vulnerability in Cgi involving CGI has Denial of Service (DoS) potential in Cookie.parse under CWE-400: Uncontrolled Resource Consumption.
Which Cgi versions are affected?
Affected versions include releases prior to 0.3.5.1, 0.3.7, 0.4.2 across affected packages: cgi.
What version fixes CVE-2025-27219?
Upgrading to 0.3.5.1, 0.3.7, 0.4.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cgi affected?
Yes, cgi is affected in releases prior to 0.3.5.1, 0.3.7, 0.4.2. Upgrade your dependency to 0.3.5.1, 0.3.7, 0.4.2 or later.
What is the CVSS score of CVE-2025-27219?
CVE-2025-27219 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L.
What CWE is associated with CVE-2025-27219?
CVE-2025-27219 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check RubyGems dependencies for CVE-2025-27219?
Run the dependency tree command: 'inspect dependencies for cgi'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gh9q-2xrm-x6qv",
  "modified" : "2025-11-04T00:32:21Z",
  "published" : "2025-03-03T20:53:43Z",
  "aliases" : [ "CVE-2025-27219" ],
  "summary" : "CGI has Denial of Service (DoS) potential in Cookie.parse",
  "details" : "There is a possibility for DoS by in the cgi gem.\nThis vulnerability has been assigned the CVE identifier CVE-2025-27219. We recommend upgrading the cgi gem.\n\n## Details\n\nCGI::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.\n\nPlease update CGI gem to version 0.3.5.1, 0.3.7, 0.4.2 or later.\n\n## Affected versions\n\ncgi gem versions <= 0.3.5, 0.3.6, 0.4.0 and 0.4.1.\n\n## Credits\n\nThanks to lio346 for discovering this issue.\nAlso thanks to mame for fixing this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "cgi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "cgi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.6"
      }, {
        "fixed" : "0.3.7"
      } ]
    } ],
    "versions" : [ "0.3.6" ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "cgi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.4.0"
      }, {
        "fixed" : "0.4.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27219"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/cgi/pull/52"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/cgi/pull/53"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/cgi/pull/54"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/2936778"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/cgi"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/cgi/CVE-2025-27219.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/03/msg00008.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.cve.org/CVERecord?id=CVE-2025-27219"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-03T20:53:43Z",
    "nvd_published_at" : "2025-03-04T00:15:31Z"
  }
}