{"id":"CVE-2021-41816","details":"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.","aliases":["GHSA-5cqm-crxm-6qpv"],"modified":"2026-04-16T04:30:59.655758485Z","published":"2022-02-06T21:15:07.887Z","related":["CGA-69x2-22v3-4fgq","openSUSE-SU-2024:11657-1","openSUSE-SU-2024:11658-1","openSUSE-SU-2024:11786-1","openSUSE-SU-2024:12712-1","openSUSE-SU-2024:13623-1","openSUSE-SU-2025:14621-1","openSUSE-SU-2025:15819-1"],"references":[{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IUXQCH6FRKANCVZO2Q7D2SQX33FP3KWN/"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UTOJGS5IEFDK3UOO7IY4OTTFGHGLSWZF/"},{"type":"ADVISORY","url":"https://security.netapp.com/advisory/ntap-20220303-0006/"},{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2021-41816"},{"type":"ADVISORY","url":"https://security.gentoo.org/glsa/202401-27"},{"type":"REPORT","url":"https://hackerone.com/reports/1328463"},{"type":"EVIDENCE","url":"https://www.ruby-lang.org/en/news/2021/11/24/buffer-overrun-in-cgi-escape_html-cve-2021-41816/"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/ruby/cgi","events":[{"introduced":"0"},{"fixed":"c9c800715ef268421ce7fbe9bc62d19a2ab67fee"},{"introduced":"0"},{"last_affected":"8f0b2571916ed143328c1834793fe8305b891e1a"},{"introduced":"0"},{"last_affected":"cf0564fe0e01f816c0602456333c82cc8bde8cf7"}],"database_specific":{"versions":[{"introduced":"0"},{"fixed":"0.3.1"},{"introduced":"0"},{"last_affected":"0.2.0"},{"introduced":"0"},{"last_affected":"0.1.0"}]}}],"versions":["v0.1.0","v0.2.0","v0.3.0"],"database_specific":{"unresolved_ranges":[{"events":[{"introduced":"0"},{"last_affected":"34"}]},{"events":[{"introduced":"0"},{"last_affected":"35"}]}],"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-41816.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}