{"cve":"CVE-2021-41816","nvd":{"published":"2022-02-06T21:15:07.887","modified":"2026-06-17T04:08:57.320","status":"Modified","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8},"cwes":["CWE-190"],"references":["https://hackerone.com/reports/1328463","https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IUXQCH6FRKANCVZO2Q7D2SQX33FP3KWN/","https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UTOJGS5IEFDK3UOO7IY4OTTFGHGLSWZF/","https://security-tracker.debian.org/tracker/CVE-2021-41816","https://security.gentoo.org/glsa/202401-27"],"products":["fedoraproject:fedora","ruby-lang:cgi"],"source":"nvd","synced_at":"2026-10-19T21:27:20.926095847+00:00"},"epss":{"cve":"CVE-2021-41816","score":0.04898,"percentile":0.9209,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-5cqm-crxm-6qpv","url":"https://osv.dev/vulnerability/GHSA-5cqm-crxm-6qpv","summary":"Buffer overrun in CGI.escape_html","modified":"2026-08-13T20:11:58.269981947Z","packages":[{"ecosystem":"RubyGems","name":"cgi","purl":"pkg:gem/cgi","ranges":[">=0.3.0 <0.3.1"],"fixed":["0.3.1"]},{"ecosystem":"RubyGems","name":"cgi","purl":"pkg:gem/cgi","ranges":[">=0.2.0 <0.2.1"],"fixed":["0.2.1"]},{"ecosystem":"RubyGems","name":"cgi","purl":"pkg:gem/cgi","ranges":["<0.1.0.1"],"fixed":["0.1.0.1"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}