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

- Severity: Medium 4.0 (CVSS:3.1, scored by mitre) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.76%, higher than 56% of CVEs (2026-12-01)
- Published: 2025-03-03T00:00:00.000Z
- Modified: 2026-09-10T03:50:56.878Z
- Also known as: GHSA-mhwm-jh88-3gjf
- Weaknesses: CWE-1333
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: mitre

## Description

In the CGI gem before 0.4.2 for Ruby, a Regular Expression Denial of Service (ReDoS) vulnerability exists in the Util#escapeElement method.

(As written by CVE List.)

## Affected

- ruby-lang CGI: before 0.3.5.1; from 0.3.6 before 0.3.7; from 0.4.0 before 0.4.2; 0.3.6
- cgi (RubyGems): before 0.3.5.1; from 0.3.6 before 0.3.7; from 0.4.0 before 0.4.2

## Every score

- mitre: CVSS:3.1 4.0 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L`
- GitHub: CVSS:3.1 4.0 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://hackerone.com/reports/2890322> (permissions-required, web)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/cgi/CVE-2025-27220.yml> (third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2025/03/msg00008.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-27220> (advisory)
- <https://github.com/ruby/cgi/pull/52> (web)
- <https://github.com/ruby/cgi/pull/53> (web)
- <https://github.com/ruby/cgi/pull/54> (web)
- <https://github.com/ruby/cgi> (package)
- <https://www.cve.org/CVERecord?id=CVE-2025-27220> (web)
- <https://www.ruby-lang.org/en/news/2025/02/26/security-advisories> (web)

## Sources

- CVE List: [CVE-2025-27220](https://www.cve.org/CVERecord?id=CVE-2025-27220), CVE Terms of Use, modified 2025-11-03
- GitHub Advisory Database: [GHSA-mhwm-jh88-3gjf](https://github.com/advisories/GHSA-mhwm-jh88-3gjf), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-27220](https://nvd.nist.gov/vuln/detail/CVE-2025-27220), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-27220 · Whole record: https://cve.day/CVE-2025-27220.json · Rebuilt by cve.day 2026-11-25T22:58:54.934Z
