CVE-2021-41816: CGI.escape_html in Ruby before 2.7.5 and 3.x before 3.0.3 has an integer overflow and resultant buffer overflo
CVE-2021-41816 is a critical-severity flaw (CVSS 9.8) affecting cgi, fedora. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
CGI.escape_html in Ruby before 2.7.5 and 3.x before 3.0.3 has an integer overflow and resultant buffer overflow via a long string on platforms (such as Windows) where size_t and long have different numbers of bytes. This also affects the CGI gem before 0.3.1 for Ruby.
Why this priority
- Critical severity
- EPSS top 8%: very likely to be exploited
- Public exploit reference
- Remotely exploitable, no login, no user action
A fixed release or distro patch exists.
Risk facts
| CVSS score | 9.8 (Critical) |
| Attack vector | Network (remote) |
| Attack complexity | Low |
| Privileges needed | None |
| User interaction | None |
| EPSS exploit chance | 4.9% (top 8%) |
| CISA exploited list | No |
| Weakness | CWE-190 |
| Published | 2022-02-06 |
| Last modified | 2026-06-17 |
Last updated 2026-06-17 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Updated Record last modified
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2021-41816?
cgi: upgrade to 0.3.1; fedora: mitigate or apply the listed mitigation. Exact commands for each OS are on this page.
Is CVE-2021-41816 being exploited?
CVE-2021-41816 is not on the CISA Known Exploited Vulnerabilities list at the time of the last update. Check again, as this can change.
What does CVE-2021-41816 affect?
CVE-2021-41816 affects cgi, fedora. Severity is critical (CVSS 9.8). CGI.escape_html in Ruby before 2.7.5 and 3.x before 3.0.3 has an integer overflow and resultant buffer overflow via a long string on platforms (such as Windows) where size_t and long have different numbers of bytes. This also affects the CG
How urgent is CVE-2021-41816?
Priority 67/100. Critical severity; EPSS top 8%: very likely to be exploited; Public exploit reference; Remotely exploitable, no login, no user action
Software pages
Windows vulnerabilities · Ruby vulnerabilities
Related CVEs
- CVE-2025-27220 MEDIUM 4.0 UPGRADE In the CGI gem before 0.4.2 for Ruby, a Regular Expression Denial of Service (ReDoS) vulnerability exists in t
- CVE-2025-27219 MEDIUM 5.8 UPGRADE In the CGI gem before 0.4.2 for Ruby, the CGI::Cookie.parse method in the CGI library contains a potential Den
- CVE-2021-41819 HIGH 7.5 DOWNGRADE UPGRADE CGI::Cookie.parse in Ruby through 2.6.8 mishandles security prefixes in cookie names
- CVE-2021-33621 HIGH 8.8 UPGRADE MITIGATE The cgi gem before 0.1.0.2, 0.2.x before 0.2.2, and 0.3.x before 0.3.5 for Ruby allows HTTP response splitting