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

Source: https://junglewise.ai/threats/cve-2025-27220-cgi-has-regular-expression-denial-of-service-redos-potential-in  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-03-03  
License: CC BY 4.0 with a link back

CVE-2025-27220 · Severity: low · CVSS 3.1 · Published 2025-03-03

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

Technologies: [cgi (RubyGems)](https://junglewise.ai/threats/technologies/cgi). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2025-27220 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-27220 being exploited in the wild.

**How severe is CVE-2025-27220?** Low severity, with a CVSS score of 3.1, published 3 March 2025.

**Which products and versions are affected?** cgi (RubyGems) ECOSYSTEM:introduced=0,fixed=0.3.5.1.

**Is there a fix for CVE-2025-27220?** Yes. cgi (RubyGems): upgrade to 0.3.5.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2025-27220?** Check whether you run cgi (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- cgi (RubyGems): upgrade to 0.3.5.1 or later

  ```sh
  bundle update cgi
  ```


## Affected products

- cgi (RubyGems) ECOSYSTEM:introduced=0,fixed=0.3.5.1

## Identifiers

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

## Related threats

- [CGI has Denial of Service (DoS) potential in Cookie.parse](https://junglewise.ai/threats/cve-2025-27219-cgi-has-denial-of-service-dos-potential-in-cookie-parse)
- [HTTP response splitting in CGI](https://junglewise.ai/threats/cve-2021-33621-http-response-splitting-in-cgi)
- [Cookie Prefix Spoofing in CGI::Cookie.parse](https://junglewise.ai/threats/cve-2021-41819-cookie-prefix-spoofing-in-cgi-cookie-parse)
- [Buffer overrun in CGI.escape_html](https://junglewise.ai/threats/cve-2021-41816-buffer-overrun-in-cgi-escape-html)
