Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. cgi
  4. ›
  5. CVE-2021-41816

CVE-2021-41816: Integer Overflow or Wraparound

February 6, 2022 (updated January 24, 2024)

CGI.escape_html in Ruby 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.

References

  • github.com/advisories/GHSA-5cqm-crxm-6qpv
  • groups.google.com/g/ruby-security-ann/c/4MQ568ZG47c
  • hackerone.com/reports/1328463
  • nvd.nist.gov/vuln/detail/CVE-2021-41816
  • security-tracker.debian.org/tracker/CVE-2021-41816
  • www.ruby-lang.org/en/news/2021/11/24/buffer-overrun-in-cgi-escape_html-cve-2021-41816/

Code Behaviors & Features

Detect and mitigate CVE-2021-41816 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 0.3.1

Fixed versions

  • 0.3.2

Solution

Upgrade to version 0.3.2 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-190: Integer Overflow or Wraparound

Source file

gem/cgi/CVE-2021-41816.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:18 +0000.