Skip to content

← Public intelligence

RubyGems package

cgi

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

5 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 6.3RubyGemsPublished

    CGI has Regular Expression Denial of Service (ReDoS) potential in Util#escapeElement

    CVE-2025-27220 · GHSA-mhwm-jh88-3gjf

    Affected
    • RubyGems cgi < 0.3.5.1; >= 0.3.6, <= 0.3.6; >= 0.4.0, < 0.4.2
    Fixed in
    0.3.5.10.3.70.4.2· Vendor fix available
    Issue
    There is a possibility for Regular expression Denial of Service (ReDoS) by in the cgi gem. This vulnerability has been assigned the CVE identifier CVE-2025-27220. We recommend upgrading the cgi gem. Details The regular expression used in CGI::Util#escapeElement is vulnerable to ReDoS. The crafted input could lead to a high CPU consumption. This vulnerability only affects Ruby 3.1 and 3.2. If you are using these versions, 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 svalkanov for discovering this issue. Also thanks to nobu for fixing this vulnerability.

    Recommended action: Upgrade to 0.4.2, 0.3.7 or 0.3.5.1 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  2. Medium, CVSS 6.3RubyGemsPublished

    CGI has Denial of Service (DoS) potential in Cookie.parse

    CVE-2025-27219 · GHSA-gh9q-2xrm-x6qv

    Affected
    • RubyGems cgi < 0.3.5.1; >= 0.3.6, <= 0.3.6; >= 0.4.0, < 0.4.2
    Fixed in
    0.3.5.10.3.70.4.2· Vendor fix available
    Issue
    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.

    Recommended action: Upgrade to 0.4.2, 0.3.7 or 0.3.5.1 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  3. High, CVSS 8.8RubyGemsPublished

    HTTP response splitting in CGI

    CVE-2021-33621 · GHSA-vc47-6rqg-c7f5

    Affected
    • RubyGems cgi >= 0.3.0, < 0.3.5; >= 0.2.0, < 0.2.2; < 0.1.0.2
    Fixed in
    0.3.50.2.20.1.0.2· Vendor fix available
    Issue
    Ruby gem cgi.rb prior to versions 0.3.5, 0.2.2 and 0.1.0.2 allow HTTP header injection. If a CGI application using the CGI library inserts untrusted input into the HTTP response header, an attacker can exploit it to insert a newline character to split a header, and inject malicious content to deceive clients. This issue has been patched in versions 0.3.5, 0.2.2 and 0.1.0.2.

    Recommended action: Upgrade to 0.3.5, 0.2.2 or 0.1.0.2 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  4. High, CVSS 7.5RubyGemsPublished

    Cookie Prefix Spoofing in CGI::Cookie.parse

    CVE-2021-41819 · GHSA-4vf4-qmvg-mh7h

    Affected
    • RubyGems cgi >= 0.3.0, <= 0.3.0; >= 0.2.0, <= 0.2.0; < 0.1.0.1
    Fixed in
    0.3.10.1.0.10.2.1· Vendor fix available
    Issue
    CGI::Cookie.parse in Ruby through 2.6.8 mishandles security prefixes in cookie names. This also affects the CGI gem prior to versions 0.3.1, 0.2.1, 0.1.1, and 0.1.0.1 for Ruby.

    Recommended action: Upgrade to 0.3.1, 0.2.1 or 0.1.0.1 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  5. Critical, CVSS 9.8RubyGemsPublished

    Buffer overrun in CGI.escape_html

    CVE-2021-41816 · GHSA-5cqm-crxm-6qpv

    Affected
    • RubyGems cgi >= 0.3.0, < 0.3.1; >= 0.2.0, < 0.2.1; < 0.1.0.1
    Fixed in
    0.3.10.1.0.10.2.1· Vendor fix available
    Issue
    A buffer overrun vulnerability was discovered in CGI.escapehtml. This can lead to a buffer overflow when a user passes a very large string ( 700 MB) to CGI.escapehtml on a platform where long type takes 4 bytes, typically, Windows.

    Recommended action: Upgrade to 0.3.1, 0.2.1 or 0.1.0.1 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →