FlawAtlas
Search the atlas
CVE-2021-41816 Critical

Buffer overrun in CGI.escape_html

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.

Exploit probability 4.8%
Published December 14, 2021
Required by Not available
Last source change August 13, 2026

02 / AFFECTED SOFTWARE

Affected packages

RubyGems cgi

3 explicit affected versions

Unknown Unknown

3 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

04 / EVIDENCE

Source records

Open Source Vulnerabilities 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 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.

View original source
Open Source Vulnerabilities GHSA-5cqm-crxm-6qpv

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.

View original source

05 / REFERENCES

Further evidence