Back
CVE-2021-41816CGI.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…
- 9.8CriticalCVSS base score
- 4.9%Exploitation in 30 daysEPSS · top 7.8% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
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.
Timeline
ID reserved
By mitre
- 4 months later
· 4 months later
Published
- 2 years later
· 2 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Modified | 3.1 | Critical9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 4.9% · top 7.8% of all CVEs (16 Nov 2026)
Loading the EPSS history…
The list uses the assigner's score when there is one, then CISA's, then NVD's: Critical 9.8.
Affected products
n/a
- affected n/a
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- RubyGemscgiGHSA-5cqm-crxm-6qpv (opens in a new tab)
References
References7
- https://hackerone.com/reports/1328463 (opens in a new tab)x_transferred
- https://www.ruby-lang.org/en/news/2021/11/24/buffer-overrun-in-cgi-escape_html-cve-2021-41816/ (opens in a new tab)x_transferred
- https://security-tracker.debian.org/tracker/CVE-2021-41816 (opens in a new tab)x_transferred
- https://security.netapp.com/advisory/ntap-20220303-0006/ (opens in a new tab)x_transferred
- FEDORA-2022-82a9edac27 (opens in a new tab)vendor-advisoryx_transferred
- FEDORA-2022-8cf0124add (opens in a new tab)vendor-advisoryx_transferred
- GLSA-202401-27 (opens in a new tab)vendor-advisoryx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-2447 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-5cqm-crxm-6qpv (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-41816)Record last updated .