CVE-2025-27220: ruby-lang CGI · ReDoS
Affects ruby-lang CGISource CVE Database V5
Not known to be exploited · CVSS 4.0 Medium.
Data as of 26 Oct 2026, 09:08 UTC
- EPSS
- 0.7% chance of exploitation in 30 days – higher than 55% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:LExploitation evidence
Disclosed: evidence found.
CVE published 3 Mar 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by 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 26 Oct 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
RubyGemscgipkg:gem/cgiOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
1. Upgrade the ruby-lang CGI gem to version 0.4.2 or later where the vulnerability is resolved. 2. Implement strict input validation to reject or sanitize inputs that could trigger the vulnerable regular expression, focusing on patterns known to cause excessive backtracking. 3. Employ rate limiting and request throttling on endpoints using the CGI gem to reduce the risk of resource exhaustion from repeated malicious requests. 4. Monitor application performance and logs for unusual spikes in CPU usage or request patterns indicative of ReDoS attempts. 5. Consider deploying Web Application Firewalls (WAFs) with custom rules to detect and block suspicious input patterns targeting the vulnerable method. 6. Conduct regular dependency audits and vulnerability scans to ensure all Ruby gems are up to date and free from known vulnerabilities. 7. Educate development teams about secure coding practices related to regular expressions and input handling to prevent similar issues in future code.
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.