CVE-2025-27220
ADVISORY - githubSummary
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.
Common Weakness Enumeration (CWE)
Inefficient Regular Expression Complexity
Inefficient Regular Expression Complexity
Inefficient Regular Expression Complexity
NIST
2.2
CVSS SCORE
4mediumGitHub
2.2
CVSS SCORE
6.3mediumDebian
-
Ubuntu
3.9
CVSS SCORE
7.5mediumAlma
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumRed Hat
2.2
CVSS SCORE
4mediumRocky
-
CVSS SCORE
N/AlowRocky
-
CVSS SCORE
N/AlowRocky
-
CVSS SCORE
N/AlowOracle
-
CVSS SCORE
N/AmediumOracle
-
CVSS SCORE
N/AmediumOracle
-
CVSS SCORE
N/AmediumChainguard
CGA-2g28-g23g-qx95
-
Chainguard
CGA-6xvp-v5pg-cvj9
-
Chainguard
CGA-f8wr-vggg-73rm
-
Chainguard
CGA-p8hc-p46m-gh5w
-
Chainguard
CGA-x5qx-wpxw-hg6p
-
Photon
CVE-2025-27220
-
CVSS SCORE
7.5highminimos
MINI-2wvv-m9c2-w53p
-
minimos
MINI-49jr-937q-vx25
-
minimos
MINI-cr6c-4q8v-9pq4
-
minimos
MINI-g3g5-ghh3-73cw
-
minimos
MINI-h83f-xfjx-qhqq
-
minimos
MINI-hgqx-qqw9-vr8x
-
minimos
MINI-jpgx-h29f-cpw7
-
minimos
MINI-jvpw-x8wj-36rp
-
minimos
MINI-mcw7-xvch-4wp2
-
minimos
MINI-qr83-65c3-3p4m
-
minimos
MINI-v7jm-jpr4-x324
-
minimos
MINI-wcpv-vhcx-3jfh
-
minimos
MINI-x449-3rrp-g8vq
-