CVE-2025-27220: High severity ruby vulnerability

Published Mar 3, 2025
·
Updated

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

Other sources

There is a possibility for Regular expression Denial of Service (ReDoS) by in the cgi gem. This vulnerability has been assigned the CVE identifier CVE-2025-27220. We recommend upgrading the cgi gem.

Details

The regular expression used in CGI::Util#escapeElement is vulnerable to ReDoS. The crafted input could lead to a high CPU consumption.

This vulnerability only affects Ruby 3.1 and 3.2. If you are using these versions, please update CGI gem to version 0.3.5.1, 0.3.7, 0.4.2 or later.

Affected versions

cgi gem versions <= 0.3.5, 0.3.6, 0.4.0 and 0.4.1.

Credits

Thanks to svalkanov for discovering this issue. Also thanks to nobu for fixing this vulnerability.

GitHub

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

11 affected componentsFixes available
rubygems/cgi>=0.4.0<0.4.2
0.4.2
rubygems/cgi=0.3.6
0.3.7
rubygems/cgi<0.3.5.1
0.3.5.1
All of the following
Any of the following
ruby-lang Cgi Ruby<0.3.5.1
ruby-lang Cgi Ruby>=0.4.0<0.4.2
ruby-lang Cgi Ruby=0.3.6
Any of the following
ruby-lang Ruby=3.1.0
ruby-lang Ruby=3.2.0
debian/ruby2.7<=2.7.4-1+deb11u1
2.7.4-1+deb11u5
debian/ruby3.1<=3.1.2-7+deb12u1
debian/ruby3.3
3.3.8-2

Event History

Mar 3, 2025
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
Advisory Published
via GitHub·10:05 PM
Mar 4, 2025
Data Sourced
via Red Hat·12:01 AM
DescriptionSeverityAffected Software
Apr 7, 2025
Data Sourced
via Launchpad·03:37 PM
Description
Apr 19, 2025
Data Sourced
via Ubuntu·03:39 PM
RemedyDescriptionSeverityAffected Software
May 13, 2025
Data Sourced
via Debian·03:45 PM
DescriptionAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the risk associated with CVE-2025-27220?

CVE-2025-27220 is associated with a Regular expression Denial of Service (ReDoS) vulnerability in the cgi gem.

2

How do I fix CVE-2025-27220?

To resolve CVE-2025-27220, upgrade the cgi gem to version 0.4.2 or later.

3

Which versions of the cgi gem are affected by CVE-2025-27220?

CVE-2025-27220 affects cgi gem versions below 0.4.2 and specifically versions 0.4.0 to 0.4.1, and 0.3.6.

4

Why is CVE-2025-27220 considered a Denial of Service vulnerability?

CVE-2025-27220 is classified as a Denial of Service vulnerability because an attacker can exploit the regex patterns to cause excessive resource consumption.

5

Where can I find more information about CVE-2025-27220?

More details about CVE-2025-27220 can typically be found in security advisories from the project maintainers or trusted vulnerability databases.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203