CVEfocus › CVE database › CVE-2025-27220

CVE-2025-27220

CVSS 4.0 MediumEPSS 1.3% (higher than 71% of CVEs)Published 2025-03-03Updated 2025-11-03Assigner: mitre

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

CWE-1333

What to do

Fixed builds are available from AlmaLinux, Debian, Red Hat, Rocky Linux, RubyGems, Ubuntu: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

103Fixed
7Fix pending
2Under investigation
26Will not fix
35Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10jrubyFix pendingUBUNTU-CVE-2025-27220
Ubuntu 26.04jrubyUnder investigationUBUNTU-CVE-2025-27220
Ubuntu 25.10jrubyWill not fix
fixed in CGI gem versions 0.3.5.1, 0.3.7, 0.4.2
UBUNTU-CVE-2025-27220
Ubuntu 25.10ruby3.3Fixed3.3.7-1ubuntu2UBUNTU-CVE-2025-27220
Ubuntu 24.04jrubyUnder investigationUBUNTU-CVE-2025-27220
Ubuntu 24.04ruby3.2Fixed3.2.3-1ubuntu0.24.04.5UBUNTU-CVE-2025-27220
Ubuntu 22.04ruby3.0Fixed3.0.2-7ubuntu2.10UBUNTU-CVE-2025-27220
Ubuntu 20.04jrubyWill not fix
fixed in CGI gem versions 0.3.5.1, 0.3.7, 0.4.2
UBUNTU-CVE-2025-27220
Ubuntu 20.04ruby2.7Fixed2.7.0-5ubuntu1.18UBUNTU-CVE-2025-27220
Ubuntu 18.04jrubyFix pendingUBUNTU-CVE-2025-27220
Ubuntu 18.04ruby2.5Fix pending2.5.1-1ubuntu1.16+esm4 (Ubuntu Pro)UBUNTU-CVE-2025-27220
Ubuntu 16.04jrubyFix pendingUBUNTU-CVE-2025-27220
Ubuntu 16.04ruby2.3Fix pending2.3.1-2~ubuntu16.04.16+esm10 (Ubuntu Pro)UBUNTU-CVE-2025-27220
Ubuntu 14.04jrubyFix pendingUBUNTU-CVE-2025-27220
Debian 14ruby3.3Fixed3.3.7-2DEBIAN-CVE-2025-27220
Debian 13ruby3.3Fixed3.3.7-2DEBIAN-CVE-2025-27220
Debian 12ruby3.1Fix pendingDEBIAN-CVE-2025-27220
Red Hat Enterprise Linux 10rubyNot affected
Red Hat Enterprise Linux 10ruby-bundled-gemsNot affected
Red Hat Enterprise Linux 10ruby-default-gemsNot affected
Red Hat Enterprise Linux 10ruby-develNot affected
Red Hat Enterprise Linux 10ruby-docNot affected
Red Hat Enterprise Linux 10ruby-libsNot affected
Red Hat Enterprise Linux 10rubygem-bigdecimalNot affected
Red Hat Enterprise Linux 10rubygem-bundlerNot affected
Red Hat Enterprise Linux 10rubygem-io-consoleNot affected
Red Hat Enterprise Linux 10rubygem-irbNot affected
Red Hat Enterprise Linux 10rubygem-jsonNot affected
Red Hat Enterprise Linux 10rubygem-minitestNot affected
Red Hat Enterprise Linux 10rubygem-power_assertNot affected
Red Hat Enterprise Linux 10rubygem-psychNot affected
Red Hat Enterprise Linux 10rubygem-raccNot affected
Red Hat Enterprise Linux 10rubygem-rakeNot affected
Red Hat Enterprise Linux 10rubygem-rbsNot affected
Red Hat Enterprise Linux 10rubygem-rdocNot affected
Red Hat Enterprise Linux 10rubygem-rexmlNot affected
Red Hat Enterprise Linux 10rubygem-rssNot affected
Red Hat Enterprise Linux 10rubygem-test-unitNot affected
Red Hat Enterprise Linux 10rubygem-typeprofNot affected
Red Hat Enterprise Linux 10rubygemsNot affected
Red Hat Enterprise Linux 10rubygems-develNot affected
Red Hat Enterprise Linux 9rubyFixed
Will not fix
0:3.1.7-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9ruby-bundled-gemsFixed0:3.1.7-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4488
Red Hat Enterprise Linux 9ruby-default-gemsFixed
Will not fix
0:3.0.7-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9ruby-develFixed
Will not fix
0:3.0.7-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9ruby-docFixed
Will not fix
0:3.1.7-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9ruby-libsFixed
Will not fix
0:3.1.7-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9rubygem-bigdecimalFixed
Will not fix
0:3.0.0-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-bundlerFixed
Will not fix
0:2.2.33-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-io-consoleFixed
Will not fix
0:0.5.11-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9rubygem-irbFixed
Will not fix
0:1.3.5-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-jsonFixed
Will not fix
0:2.5.1-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-minitestFixed
Will not fix
0:5.14.2-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-mysql2Fixed0:0.5.4-1.module+el9.1.0+15737+76195479RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-mysql2-docFixed0:0.5.4-1.module+el9.1.0+15737+76195479RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-pgFixed0:1.3.5-1.module+el9.1.0+15737+76195479RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-pg-docFixed0:1.3.5-1.module+el9.1.0+15737+76195479RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-power_assertFixed
Will not fix
0:2.0.1-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9rubygem-psychFixed
Will not fix
0:4.0.4-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9rubygem-rakeFixed
Will not fix
0:13.0.6-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9rubygem-rbsFixed
Will not fix
0:2.7.0-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9rubygem-rdocFixed
Will not fix
0:6.3.4.1-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-rexmlFixed
Will not fix
0:3.2.5-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-rssFixed
Will not fix
0:0.3.1-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9rubygem-test-unitFixed
Will not fix
0:3.3.7-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygem-typeprofFixed
Will not fix
0:0.21.3-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 9rubygemsFixed
Will not fix
0:3.2.33-165.el9_5RHSA-2025:4488
Red Hat Enterprise Linux 9rubygems-develFixed
Will not fix
0:3.3.27-146.module+el9.5.0+23003+a4c328ceRHSA-2025:4487
Red Hat Enterprise Linux 8rubyFixed0:3.1.7-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8ruby-bundled-gemsFixed0:3.1.7-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8ruby-default-gemsFixed0:3.1.7-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8ruby-develFixed0:3.1.7-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8ruby-docFixed0:3.1.7-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8ruby-irbNot affected
Red Hat Enterprise Linux 8ruby-libsFixed0:3.1.7-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-abrtFixed0:0.4.0-1.module+el8.10.0+21470+43ec8058RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-abrt-docFixed0:0.4.0-1.module+el8.10.0+21470+43ec8058RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-bigdecimalFixed0:3.1.1-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-bsonNot affected
Red Hat Enterprise Linux 8rubygem-bson-docNot affected
Red Hat Enterprise Linux 8rubygem-bundlerFixed0:2.3.27-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-bundler-docNot affected
Red Hat Enterprise Linux 8rubygem-did_you_meanNot affected
Red Hat Enterprise Linux 8rubygem-io-consoleFixed0:0.5.11-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-irbFixed0:1.4.1-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-jsonFixed0:2.6.1-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-minitestFixed0:5.15.0-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-mongoNot affected
Red Hat Enterprise Linux 8rubygem-mongo-docNot affected
Red Hat Enterprise Linux 8rubygem-mysql2Fixed0:0.5.3-3.module+el8.10.0+21470+43ec8058RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-mysql2-docFixed0:0.5.3-3.module+el8.10.0+21470+43ec8058RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-net-telnetNot affected
Red Hat Enterprise Linux 8rubygem-opensslNot affected
Red Hat Enterprise Linux 8rubygem-pgFixed0:1.3.2-1.module+el8.10.0+21470+43ec8058RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-pg-docFixed0:1.3.2-1.module+el8.10.0+21470+43ec8058RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-power_assertFixed0:2.0.1-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-psychFixed0:4.0.4-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-raccNot affected
Red Hat Enterprise Linux 8rubygem-rakeFixed0:13.0.6-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-rbsFixed0:2.7.0-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-rdocFixed0:6.4.1.1-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-rexmlFixed0:3.3.9-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-rssFixed0:0.3.1-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-test-unitFixed0:3.5.3-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-typeprofFixed0:0.21.3-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygem-xmlrpcNot affected
Red Hat Enterprise Linux 8rubygemsFixed0:3.3.27-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 8rubygems-develFixed0:3.3.27-145.module+el8.10.0+23011+f9d508f8RHSA-2025:4063
Red Hat Enterprise Linux 7rubyWill not fix
Out of support scope
Red Hat Enterprise Linux 7ruby-develWill not fix
Out of support scope
Red Hat Enterprise Linux 7ruby-docWill not fix
Out of support scope
Red Hat Enterprise Linux 7ruby-irbWill not fix
Out of support scope
Red Hat Enterprise Linux 7ruby-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 7ruby-tcltkWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygem-bigdecimalWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygem-io-consoleWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygem-jsonWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygem-minitestWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygem-psychWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygem-rakeWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygem-rdocWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygemsWill not fix
Out of support scope
Red Hat Enterprise Linux 7rubygems-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6rubyWill not fix
Out of support scope
Red Hat Enterprise Linux 6ruby-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6ruby-docsWill not fix
Out of support scope
Red Hat Enterprise Linux 6ruby-irbWill not fix
Out of support scope
Red Hat Enterprise Linux 6ruby-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 6ruby-rdocWill not fix
Out of support scope
Red Hat Enterprise Linux 6ruby-riWill not fix
Out of support scope
Red Hat Enterprise Linux 6ruby-staticWill not fix
Out of support scope
Red Hat Enterprise Linux 6ruby-tcltkWill not fix
Out of support scope
AlmaLinux 9rubygem-mysql2Fixed0.5.4-1.module_el9.1.0+8+503f6fbdALSA-2025:4488
AlmaLinux 9rubygem-mysql2-docFixed0.5.4-1.module_el9.1.0+8+503f6fbdALSA-2025:4488
AlmaLinux 9rubygem-pgFixed1.3.5-1.module_el9.1.0+8+503f6fbdALSA-2025:4488
AlmaLinux 9rubygem-pg-docFixed1.3.5-1.module_el9.1.0+8+503f6fbdALSA-2025:4488
AlmaLinux 8rubyFixed3.1.7-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8ruby-bundled-gemsFixed3.1.7-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8ruby-default-gemsFixed3.1.7-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8ruby-develFixed3.1.7-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8ruby-docFixed3.1.7-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8ruby-libsFixed3.1.7-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-abrtFixed0.4.0-1.module_el8.9.0+3746+91b8233aALSA-2025:4063
AlmaLinux 8rubygem-abrt-docFixed0.4.0-1.module_el8.10.0+3854+02eaa59aALSA-2025:4063
AlmaLinux 8rubygem-bigdecimalFixed3.1.1-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-bundlerFixed2.3.27-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-io-consoleFixed0.5.11-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-irbFixed1.4.1-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-jsonFixed2.6.1-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-minitestFixed5.15.0-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-mysql2Fixed0.5.3-3.module_el8.10.0+3854+02eaa59aALSA-2025:4063
AlmaLinux 8rubygem-mysql2-docFixed0.5.3-3.module_el8.10.0+3854+02eaa59aALSA-2025:4063
AlmaLinux 8rubygem-pgFixed1.3.2-1.module_el8.9.0+3746+91b8233aALSA-2025:4063
AlmaLinux 8rubygem-pg-docFixed1.3.2-1.module_el8.10.0+3854+02eaa59aALSA-2025:4063
AlmaLinux 8rubygem-power_assertFixed2.0.1-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-psychFixed4.0.4-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-rakeFixed13.0.6-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-rbsFixed2.7.0-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-rdocFixed6.4.1.1-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-rexmlFixed3.3.9-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-rssFixed0.3.1-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-test-unitFixed3.5.3-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygem-typeprofFixed0.21.3-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygemsFixed3.3.27-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
AlmaLinux 8rubygems-develFixed3.3.27-145.module_el8.10.0+3984+cf55e3dfALSA-2025:4063
Rocky Linux 9rubyFixed0:3.0.7-165.el9_5RLSA-2025:4488
Rocky Linux 9rubygem-mysql2Fixed0:0.5.4-1.module+el9.5.0+31847+8b291b93RLSA-2025:4488
Rocky Linux 9rubygem-pgFixed0:1.3.5-1.module+el9.5.0+31847+8b291b93RLSA-2025:4488
Rocky Linux 8rubyFixed0:3.1.7-145.module+el8.10.0+1957+16e0d1a2RLSA-2025:4063
Rocky Linux 8rubygem-abrtFixed0:0.4.0-1.module+el8.10.0+1820+f3fffb92RLSA-2025:4063
Rocky Linux 8rubygem-mysql2Fixed0:0.5.3-3.module+el8.10.0+1744+6c504228RLSA-2025:4063
Rocky Linux 8rubygem-pgFixed0:1.3.2-1.module+el8.10.0+1826+b62220b4RLSA-2025:4063
RubyGems librarycgiFixed0.3.5.1GHSA-mhwm-jh88-3gjf

What the vendor says

As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.