Breaking News: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials
Read the Report
Learn How MCP Is Bypassing a Decade of Cloud Security Best Practices
Read the Report
Are you exposed? Connect a repo in minutes.
Scan your repos free

CVE-2021-41816

ruby: buffer overflow in CGI.escape_html

Overview

Published
6 Feb 2022
Modified
17 Jun 2026
Critical CVE
1 Registry packages
87 OS packages
6 Linux distributions
Yes Fix available

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.

Source: OX vulnerability database

Severity

9.8 · CRITICAL

CVSS 3.1 base score, scored by NVD.

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Weakness: CWE-190

Affected packages · 1

Packages affected by CVE-2021-41816
EcosystemPackageVulnerableFixed in
RubyGems cgi >=0.3.0, <0.3.1>=0.2.0, <0.2.1<0.1.0.1 0.3.10.2.10.1.0.1~> 0.1.0.1~> 0.1.1

Open a package to see all its vulnerabilities.

Operating systems · 50 fixes

Photon OS 1 release · 1 package

fixed 1
ruby
Photon OS fixes for CVE-2021-41816
ReleasePackageFixed in
4.0 ruby +1 2.7.4-9.ph4

Red Hat 1 release · 34 packages

fixed 34
rh-ruby30-rubygem-typeprof rh-ruby27-rubygem-net-telnet rh-ruby30-rubygem-rss rh-ruby27-rubygem-xmlrpc rh-ruby27-rubygem-io-console rh-ruby30-rubygem-io-console +28
Red Hat fixes for CVE-2021-41816
ReleasePackageFixed inAdvisory
7 rh-ruby30-rubygem-typeprof 0:0.15.2-149.el7 RHSA-2022:6855
7 rh-ruby27-rubygem-net-telnet 0:0.2.0-131.el7 RHSA-2022:6856
7 rh-ruby30-rubygem-rss 0:0.2.9-149.el7 RHSA-2022:6855
7 rh-ruby27-rubygem-xmlrpc 0:0.3.0-131.el7 RHSA-2022:6856
7 rh-ruby27-rubygem-io-console 0:0.5.6-131.el7 RHSA-2022:6856
7 rh-ruby30-rubygem-io-console 0:0.5.7-149.el7 RHSA-2022:6855

28 more rows

alpine 4 releases · 1 package

fixed 4
ruby
alpine fixes for CVE-2021-41816
ReleasePackageFixed in
3.22 ruby 3.0.3-r0
3.23 ruby 3.0.3-r0
3.24 ruby 3.0.3-r0
edge ruby 3.0.3-r0

debian 1 release · 1 package

fixed 1
ruby2-7
debian fixes for CVE-2021-41816
ReleasePackageFixed in
11 ruby2-7 2.7.4-1+deb11u1

openSUSE 1 release · 7 packages

fixed 7
libruby2-7-2-7 libruby3-0-3-0 libruby3-1-3-1 libruby3-2-3-2 libruby3-3-3-3 libruby3-4-3-4 +1
openSUSE fixes for CVE-2021-41816
ReleasePackageFixed inAdvisory
Tumbleweed libruby2-7-2-7 +5 2.7.5-1.1 openSUSE-SU-2024:11657-1
Tumbleweed libruby3-0-3-0 +5 3.0.3-1.1 openSUSE-SU-2024:11658-1
Tumbleweed libruby3-1-3-1 +5 3.1.0-1.1 openSUSE-SU-2024:11786-1
Tumbleweed libruby3-2-3-2 +5 3.2.1-1.1 openSUSE-SU-2024:12712-1
Tumbleweed libruby3-3-3-3 +5 3.3.0-1.2 openSUSE-SU-2024:13623-1
Tumbleweed libruby3-4-3-4 +5 3.4.1-1.1 openSUSE-SU-2025:14621-1

1 more row

ubuntu 3 releases · 2 packages

fixed 3
ruby2-7 ruby3-0
ubuntu fixes for CVE-2021-41816
ReleasePackageFixed in
20.04 ruby2-7 2.7.0-5ubuntu1.6
20.04-ESM ruby2-7 2.7.0-5ubuntu1.6
22.04 ruby3-0 3.0.2-7ubuntu2

References

Show all 24 references

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.