CVE-2025-27220
HIGH 7.5CVSS 3.1CGI has Regular Expression Denial of Service (ReDoS) potential in Util#escapeElement
In the CGI gem before 0.4.2 for Ruby, a Regular Expression Denial of Service (ReDoS) vulnerability exists in the Util#escapeElement method.
- Published
- 4 Mar 2025
- Last modified
- 10 Sep 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-1333
- Also known as
- GHSA-mhwm-jh88-3gjf
- Sources
- NVDJSONOSV GHSA-mhwm-jh88-3gjfJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | 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 | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | cve@mitre.org (Secondary) | CVSS 3.1 | MEDIUM 4.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L |
| OSV | GitHub | CVSS 3.1 | MEDIUM 4.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | ruby-lang | cgicpe:2.3:a:ruby-lang:cgi:*:*:*:*:*:ruby:*:* |
< 0.3.5.1 | 0.3.5.1 |
| NVD | ruby-lang | cgicpe:2.3:a:ruby-lang:cgi:*:*:*:*:*:ruby:*:* |
>= 0.4.0, < 0.4.2 | 0.4.2 |
| NVD | ruby-lang | cgicpe:2.3:a:ruby-lang:cgi:0.3.6:*:*:*:*:ruby:*:* |
= 0.3.6 | |
| OSV | RubyGems | cgi | < 0.3.5.1 | 0.3.5.1 |
| OSV | RubyGems | cgi | >= 0.3.6, < 0.3.7 | 0.3.7 |
| OSV | RubyGems | cgi | >= 0.4.0, < 0.4.2 | 0.4.2 |
References
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/cgi/CVE-2025-27220.yml · Third Party Advisory, WEB
- https://hackerone.com/reports/2890322 · Permissions Required, 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
History
- 25 Nov 2026 20:57 UTC · NVD: first stored (published 4 Mar 2025)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 3 Mar 2025)