9.8critical
Buffer overrun in CGI.escape_html
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 5.26% (higher than 92% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-5cqm-crxm-6qpv
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| cgi (RubyGems) | from 0.3.0 before 0.3.1, from 0.2.0 before 0.2.1, before 0.1.0.1 | GitHub Advisory Database |
| ruby-lang cgi | before 0.3.1, up to 0.2.0, up to 0.1.0 | NVD |
| fedoraproject fedora | 34, 35 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
A buffer overrun vulnerability was discovered in CGI.escape_html. This can lead to a buffer overflow when a user passes a very large string (> 700 MB) to CGI.escape_html on a platform where long type takes 4 bytes, typically, Windows.
NVD (es)
El archivo CGI.escape_html en Ruby versiones anteriores a 2.7.5 y 3.x versiones anteriores a 3.0.3, presenta un desbordamiento de enteros y un desbordamiento de búfer resultante por medio de una cadena larga en plataformas (como Windows) donde size_t y long tienen diferentes números de bytes. Esto también afecta a CGI gem versiones anteriores a 0.3.1 para Ruby
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-41816 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5cqm-crxm-6qpv changed 2026-08-13 | CC-BY-4.0 |
| NVD | CVE-2021-41816 changed 2026-06-17 | Public domain |