Skip to main content
VulnerabilityPublished Updated

CVE-2025-27220: CGI has Regular Expression Denial of Service (ReDoS) potential in Util#escapeElement

Affects cgiSource GCVE Database

0
Compare
Authoritative record:CVE-2025-27220· Medium 4.0

Not known to be exploited · CVSS 4.0 Medium : upgrade to 0.3.5.1 when convenient.

Data as of 30 Oct 2026, 16:05 UTC

CVSS 3.1 base score
4.0Medium
How severe the flaw is on the 0–10 CVSS scale.

Thin evidence

One scorer or none
CVSS scores by source
CNA (mitre)CVSS 3.14.0
Patch
Available – fixed in 0.3.5.1, 0.3.7, 0.4.2
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 3 Mar 2025

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.

What to do

Upgrade cgi to 0.3.5.1; cgi to 0.3.7; cgi to 0.4.2.

Affected software

ProductAffectedFixed in
RubyGemscgiAffected
  • <0.3.5.1
Fixed in
  • 0.3.5.1
RubyGemscgiAffected
  • >=0.3.6 <0.3.7
  • =0.3.6
Fixed in
  • 0.3.7
RubyGemscgiAffected
  • >=0.4.0 <0.4.2
Fixed in
  • 0.4.2

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Upgrade the cgi gem to version 0.3.5.1, 0.3.7, 0.4.2 or later to remediate this vulnerability. These versions contain the official fixes. No other mitigation is required if the gem is updated.

Description

A Regular Expression Denial of Service (ReDoS) vulnerability exists in the cgi gem's CGI::Util#escapeElement method affecting certain versions. Crafted input can cause excessive CPU consumption. This impacts cgi gem versions <=0.3.5, 0.3.6, 0.4.0, and 0.4.1. Fixed versions are 0.3.5.1, 0.3.7, and 0.4.2 or later. The vulnerability affects Ruby 3.1 and 3.2 environments using these gem versions.

References

Community reviews

Loading reviews…