{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-41816","id":"CVE-2021-41816","title":"Buffer overrun in CGI.escape_html","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.","descriptionLong":"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.","published":"2022-02-06T00:00:00.000Z","updated":"2026-10-24T10:30:25.605911957Z","reserved":"2021-09-29T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"mitre","metric":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"NVD"},"metrics":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"NVD"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"OSV"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"GitHub"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","rating":"high","source":"NVD"}],"rating":"critical","products":[],"affectedProducts":[{"vendor":"n/a","product":"n/a","defaultStatus":null,"versions":[{"version":"n/a","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"RubyGems","name":"cgi","purl":"pkg:gem/cgi","ranges":[">=0.3.0 <0.3.1",">=0.2.0 <0.2.1","<0.1.0.1"],"fixed":["0.3.1","0.2.1","0.1.0.1"],"advisory":"GHSA-5cqm-crxm-6qpv"}],"cwes":["CWE-190"],"aliases":["GHSA-5cqm-crxm-6qpv"],"references":[{"url":"https://hackerone.com/reports/1328463","tags":["x_transferred","Permissions Required","Third Party Advisory","report","web"]},{"url":"https://www.ruby-lang.org/en/news/2021/11/24/buffer-overrun-in-cgi-escape_html-cve-2021-41816/","tags":["x_transferred","Exploit","Vendor Advisory","evidence"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-41816","tags":["x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://security.netapp.com/advisory/ntap-20220303-0006/","tags":["x_transferred","Third Party Advisory","advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IUXQCH6FRKANCVZO2Q7D2SQX33FP3KWN/","tags":["vendor-advisory","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UTOJGS5IEFDK3UOO7IY4OTTFGHGLSWZF/","tags":["vendor-advisory","x_transferred","web"]},{"url":"https://security.gentoo.org/glsa/202401-27","tags":["vendor-advisory","x_transferred","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41816","tags":["advisory"]},{"url":"https://github.com/ruby/cgi/commit/959ccf0b6a672bcc64aeaa60c6e1f9e728f1e87f","tags":["web"]},{"url":"https://github.com/ruby/cgi/commit/ad079c1cb5f58eba1ffac46da79995fcf94a3a6e","tags":["web"]},{"url":"https://github.com/ruby/cgi/commit/c6a37a671b556eb06140ea89cc465136b24207a6","tags":["web"]},{"url":"https://github.com/ruby/cgi/commit/c728632c1c09d46cfd4ecbff9caaa3651dd1002a","tags":["web"]},{"url":"https://www.ruby-lang.org/en/news/2021/11/24/buffer-overrun-in-cgi-escape_html-cve-2021-41816","tags":["web"]},{"url":"https://security.netapp.com/advisory/ntap-20220303-0006","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UTOJGS5IEFDK3UOO7IY4OTTFGHGLSWZF","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IUXQCH6FRKANCVZO2Q7D2SQX33FP3KWN","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UTOJGS5IEFDK3UOO7IY4OTTFGHGLSWZF","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IUXQCH6FRKANCVZO2Q7D2SQX33FP3KWN","tags":["web"]},{"url":"https://groups.google.com/g/ruby-security-ann/c/4MQ568ZG47c","tags":["web"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/cgi/CVE-2021-41816.yml","tags":["web"]},{"url":"https://github.com/ruby/cgi","tags":["package"]}],"patchReferenced":false,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.04898,"epssPercentile":0.9227,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-41816","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41816","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-41816","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-5cqm-crxm-6qpv","ok":true,"note":"GHSA-5cqm-crxm-6qpv"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-41816","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}