{"id":"CVE-2021-41816","published":"2022-02-06T00:00:00Z","modified":"2024-08-04T03:22:24Z","title":"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…","vendor":null,"product":null,"tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.04898,"percentile":0.92294,"provenance":"source"},"cwes":[],"references":[{"url":"https://hackerone.com/reports/1328463","tags":[]},{"url":"https://www.ruby-lang.org/en/news/2021/11/24/buffer-overrun-in-cgi-escape_html-cve-2021-41816/","tags":[]},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-41816","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20220303-0006/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IUXQCH6FRKANCVZO2Q7D2SQX33FP3KWN/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UTOJGS5IEFDK3UOO7IY4OTTFGHGLSWZF/","tags":["vendor-advisory"]},{"url":"https://security.gentoo.org/glsa/202401-27","tags":["vendor-advisory"]}],"priority":{"score":18.5,"factors":[{"name":"EPSS percentile","points":18.46}]},"affected":[{"ecosystem":"RubyGems","package":"cgi","vulnerableRanges":[">=0.3.0, <0.3.1",">=0.2.0, <0.2.1","<0.1.0.1"],"patched":["0.3.1","0.2.1","0.1.0.1"],"from":["GHSA-5cqm-crxm-6qpv"],"provenance":"source"}],"summary":{"text":"The flaw is an integer overflow leading to a buffer overflow in CGI.escape_html, which lives in Ruby before 2.7.5 and in 3.x before 3.0.3, and also in the CGI gem before 0.3.1. It occurs on platforms such as Windows where size_t and long have different byte sizes, and it is triggered by passing a long string to the function.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:13:50Z"},"euvd":{"id":"EUVD-2021-2447","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-41816","published":"2022-02-06","fixed":"0.3.1","kev":false},{"cve":"CVE-2021-41819","published":"2022-01-01","fixed":"0.3.1","kev":false},{"cve":"CVE-2021-33621","published":"2022-11-18","fixed":"0.3.5","kev":false,"link":{"from":"CVE-2021-41816","to":"CVE-2021-33621","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:cgi","fromFixed":"0.3.1","toFixed":"0.3.5","daysApart":285},{"kind":"version-step","provenance":"source","package":"RubyGems:cgi","fromFixed":"0.2.1","toFixed":"0.2.2","daysApart":285}]}},{"cve":"CVE-2025-27219","published":"2025-03-03","fixed":"0.4.2","kev":false}],"package":"RubyGems:cgi"}}