Cyber Resilience

CVE-2025-27220

Ruby-Lang Cgi ≤ 0.3.5.1

Published
04 March 2025
Modified
03 November 2025
CVSS Score v3.1 4.0
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L
EPSS Score 0.0073 51th percentile
Risk Priority 35 floored blend · peak EPSS

Summary

CVE-2025-27220 is a medium-severity Inefficient Regular Expression Complexity (CWE-1333) vulnerability in Ruby-Lang Cgi. Its CVSS base score is 4.0 (Medium).

Operationally, exploitation aligns with the MITRE ATT&CK technique Endpoint Denial of Service (T1499); ranked in the top 49% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SA-15 (Development Process, Standards, and Tools) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2025-27220 is a Regular Expression Denial of Service (ReDoS) vulnerability in the Util#escapeElement method of the CGI gem for Ruby, affecting versions before 0.4.2. Published on 2025-03-04, it is classified under CWE-1333 and carries a CVSS v3.1 base score of 4.0 (AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L).

Remote attackers require no privileges or user interaction to exploit this over the network, though the attack demands high complexity. Exploitation triggers excessive resource consumption via malicious regular expression input, resulting in low-impact availability disruption with a changed scope.

Advisories recommend upgrading the CGI gem to version 0.4.2 or later for mitigation. Key references include the Ruby Advisory Database entry at https://github.com/rubysec/ruby-advisory-db/blob/master/gems/cgi/CVE-2025-27220.yml, a HackerOne disclosure report at https://hackerone.com/reports/2890322, and a Debian LTS announcement at https://lists.debian.org/debian-lts-announce/2025/03/msg00008.html.

EU & UK References

Vulnerability Data

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(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1499 Endpoint Denial of Service Impact
Adversaries may perform Endpoint Denial of Service (DoS) attacks to degrade or block the availability of services to users.
T1499.003 Application Exhaustion Flood Impact
Adversaries may target resource intensive features of applications to cause a denial of service (DoS), denying availability to those applications.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2023-36617Same vendor: Ruby-Lang
CVE-2024-26142Same product: Ruby-Lang Ruby
CVE-2024-49761Same product: Ruby-Lang Ruby
CVE-2023-28756Same product: Ruby-Lang Ruby
CVE-2025-27219Same product: Ruby-Lang Cgi
CVE-2023-28755Same vendor: Ruby-Lang
CVE-2026-46727Same product: Ruby-Lang Ruby
CVE-2026-42245Same vendor: Ruby-Lang
CVE-2023-6688Shared CWE-1333
CVE-2023-45813Shared CWE-1333

Affected Assets

ruby-lang
cgi
0.3.6 · ≤ 0.3.5.1 · 0.4.0 — 0.4.2

Mitigating Controls

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation can discover inefficient regex patterns via performance or static analysis.

Development standards and tools can require safe regex construction and forbid known exponential patterns.

Denial-of-service protections limit resource exhaustion caused by expensive regex evaluation.

Input validation can constrain data that would otherwise trigger worst-case regex complexity.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly prevent inefficient regex via reviews, static analysis, and safe libraries.

ID.RA-01 partial match
prevents

Vulnerability identification processes can discover ReDoS issues in existing code but do not stop their introduction.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing can detect and reject regex patterns with exponential worst-case complexity.

prevents

Secure development lifecycle mandates review of algorithmic efficiency, directly addressing ReDoS-prone regex.

prevents

Application security requirements can specify input-validation rules that limit regex complexity.

prevents

Secure architecture principles encourage avoidance of computationally expensive constructs such as catastrophic backtracking.

prevents

Secure coding standards explicitly prohibit or limit the use of inefficient regular expressions.

References