CVEfocus › CVE database › CVE-2021-41816

CVE-2021-41816

CVSS 9.8 CriticalEPSS 4.9% (higher than 93% of CVEs)Published 2022-02-06Updated 2024-08-04Assigner: mitre

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.

What to do

Fixed builds are available from Alpine, RubyGems, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

16Fixed
1Fix pending
86Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04ruby3.0Fixed3.0.2-7ubuntu2UBUNTU-CVE-2021-41816
Ubuntu 20.04ruby2.7Fixed2.7.0-5ubuntu1.6UBUNTU-CVE-2021-41816
Ubuntu 16.04ruby2.3Fix pending
Red Hat Enterprise Linux 9rubyNot affected
Red Hat Enterprise Linux 9ruby-default-gemsNot affected
Red Hat Enterprise Linux 9ruby-develNot affected
Red Hat Enterprise Linux 9ruby-docNot affected
Red Hat Enterprise Linux 9ruby-libsNot affected
Red Hat Enterprise Linux 9rubygem-bigdecimalNot affected
Red Hat Enterprise Linux 9rubygem-bundlerNot affected
Red Hat Enterprise Linux 9rubygem-io-consoleNot affected
Red Hat Enterprise Linux 9rubygem-irbNot affected
Red Hat Enterprise Linux 9rubygem-jsonNot affected
Red Hat Enterprise Linux 9rubygem-minitestNot affected
Red Hat Enterprise Linux 9rubygem-power_assertNot affected
Red Hat Enterprise Linux 9rubygem-psychNot affected
Red Hat Enterprise Linux 9rubygem-rakeNot affected
Red Hat Enterprise Linux 9rubygem-rbsNot affected
Red Hat Enterprise Linux 9rubygem-rdocNot affected
Red Hat Enterprise Linux 9rubygem-rexmlNot affected
Red Hat Enterprise Linux 9rubygem-rssNot affected
Red Hat Enterprise Linux 9rubygem-test-unitNot affected
Red Hat Enterprise Linux 9rubygem-typeprofNot affected
Red Hat Enterprise Linux 9rubygemsNot affected
Red Hat Enterprise Linux 9rubygems-develNot affected
Red Hat Enterprise Linux 8rubyNot affected
Red Hat Enterprise Linux 8ruby-bundled-gemsNot affected
Red Hat Enterprise Linux 8ruby-default-gemsNot affected
Red Hat Enterprise Linux 8ruby-develNot affected
Red Hat Enterprise Linux 8ruby-docNot affected
Red Hat Enterprise Linux 8ruby-irbNot affected
Red Hat Enterprise Linux 8ruby-libsNot affected
Red Hat Enterprise Linux 8rubygem-abrtNot affected
Red Hat Enterprise Linux 8rubygem-abrt-docNot affected
Red Hat Enterprise Linux 8rubygem-bigdecimalNot affected
Red Hat Enterprise Linux 8rubygem-bsonNot affected
Red Hat Enterprise Linux 8rubygem-bson-docNot affected
Red Hat Enterprise Linux 8rubygem-bundlerNot affected
Red Hat Enterprise Linux 8rubygem-bundler-docNot affected
Red Hat Enterprise Linux 8rubygem-did_you_meanNot affected
Red Hat Enterprise Linux 8rubygem-io-consoleNot affected
Red Hat Enterprise Linux 8rubygem-irbNot affected
Red Hat Enterprise Linux 8rubygem-jsonNot affected
Red Hat Enterprise Linux 8rubygem-minitestNot affected
Red Hat Enterprise Linux 8rubygem-mongoNot affected
Red Hat Enterprise Linux 8rubygem-mongo-docNot affected
Red Hat Enterprise Linux 8rubygem-mysql2Not affected
Red Hat Enterprise Linux 8rubygem-mysql2-docNot affected
Red Hat Enterprise Linux 8rubygem-net-telnetNot affected
Red Hat Enterprise Linux 8rubygem-opensslNot affected
Red Hat Enterprise Linux 8rubygem-pgNot affected
Red Hat Enterprise Linux 8rubygem-pg-docNot affected
Red Hat Enterprise Linux 8rubygem-power_assertNot affected
Red Hat Enterprise Linux 8rubygem-psychNot affected
Red Hat Enterprise Linux 8rubygem-raccNot affected
Red Hat Enterprise Linux 8rubygem-rakeNot affected
Red Hat Enterprise Linux 8rubygem-rbsNot affected
Red Hat Enterprise Linux 8rubygem-rdocNot affected
Red Hat Enterprise Linux 8rubygem-rexmlNot affected
Red Hat Enterprise Linux 8rubygem-rssNot affected
Red Hat Enterprise Linux 8rubygem-test-unitNot affected
Red Hat Enterprise Linux 8rubygem-typeprofNot affected
Red Hat Enterprise Linux 8rubygem-xmlrpcNot affected
Red Hat Enterprise Linux 8rubygemsNot affected
Red Hat Enterprise Linux 8rubygems-develNot affected
Red Hat Enterprise Linux 7rubyNot affected
Red Hat Enterprise Linux 7ruby-develNot affected
Red Hat Enterprise Linux 7ruby-docNot affected
Red Hat Enterprise Linux 7ruby-irbNot affected
Red Hat Enterprise Linux 7ruby-libsNot affected
Red Hat Enterprise Linux 7ruby-tcltkNot affected
Red Hat Enterprise Linux 7rubygem-bigdecimalNot affected
Red Hat Enterprise Linux 7rubygem-io-consoleNot affected
Red Hat Enterprise Linux 7rubygem-jsonNot affected
Red Hat Enterprise Linux 7rubygem-minitestNot affected
Red Hat Enterprise Linux 7rubygem-psychNot affected
Red Hat Enterprise Linux 7rubygem-rakeNot affected
Red Hat Enterprise Linux 7rubygem-rdocNot affected
Red Hat Enterprise Linux 7rubygemsNot affected
Red Hat Enterprise Linux 7rubygems-develNot affected
Red Hat Enterprise Linux 6rubyNot affected
Red Hat Enterprise Linux 6ruby-develNot affected
Red Hat Enterprise Linux 6ruby-docsNot affected
Red Hat Enterprise Linux 6ruby-irbNot affected
Red Hat Enterprise Linux 6ruby-libsNot affected
Red Hat Enterprise Linux 6ruby-rdocNot affected
Red Hat Enterprise Linux 6ruby-riNot affected
Red Hat Enterprise Linux 6ruby-staticNot affected
Red Hat Enterprise Linux 6ruby-tcltkNot affected
Alpine Linux 3.24rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.23rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.22rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.21rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.20rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.19rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.18rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.17rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.16rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.15rubyFixed3.0.3-r0ALPINE-CVE-2021-41816
Alpine Linux 3.14rubyFixed2.7.5-r0ALPINE-CVE-2021-41816
Alpine Linux 3.13rubyFixed2.7.5-r0ALPINE-CVE-2021-41816
Alpine Linux 3.12rubyFixed2.7.5-r0ALPINE-CVE-2021-41816
RubyGems librarycgiFixed0.3.1GHSA-5cqm-crxm-6qpv

What the vendor says

As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.