CVE-2021-33621: High severity ruby vulnerability

Published Nov 18, 2022
·
Updated

A vulnerability was found in Ruby that allows HTTP header injection. A CGI application using the CGI library may insert untrusted input into the HTTP response header. This issue can allow an attacker to insert a newline character to split a header and inject malicious content to deceive clients.

Other sources

cgi.rb in Ruby through 2.6.x, through 3.0x, and through 3.1.x allows HTTP header injection. If a CGI application using the CGI library inserts untrusted input into the HTTP response header, an attacker can exploit it to insert a newline character to split a header, and inject malicious content to deceive clients.

References: https://www.ruby-lang.org/en/security/ https://www.ruby-lang.org/en/news/2022/11/22/http-response-splitting-in-cgi-cve-2021-33621/ https://github.com/rubysec/ruby-advisory-db/blob/master/gems/cgi/CVE-2021-33621.yml https://github.com/ruby/cgi/compare/v0.1.0.1...v0.1.0.2

Red Hat

Ruby gem cgi.rb prior to versions 0.3.5, 0.2.2 and 0.1.0.2 allow HTTP header injection. If a CGI application using the CGI library inserts untrusted input into the HTTP response header, an attacker can exploit it to insert a newline character to split a header, and inject malicious content to deceive clients. This issue has been patched in versions 0.3.5, 0.2.2 and 0.1.0.2.

GitHub

The cgi gem before 0.1.0.2, 0.2.x before 0.2.2, and 0.3.x before 0.3.5 for Ruby allows HTTP response splitting. This is relevant to applications that use untrusted user input either to generate an HTTP response or to create a CGI::Cookie object.

Affected Software

15 affected componentsFixes available
redhat/rh-ruby27-ruby<0:2.7.8-132.el7
0:2.7.8-132.el7
rubygems/cgi<0.1.0.2
0.1.0.2
rubygems/cgi>=0.2.0<0.2.2
0.2.2
rubygems/cgi>=0.3.0<0.3.5
0.3.5
debian/ruby2.7<=2.7.4-1+deb11u1
2.7.4-1+deb11u5
debian/ruby3.1
3.1.2-7+deb12u13.1.2-8.5
ruby-lang Cgi Ruby<0.1.0.2
ruby-lang Cgi Ruby>=0.2.0<0.2.2
ruby-lang Cgi Ruby>=0.3.0<0.3.5
Fedoraproject Fedora=35
Fedoraproject Fedora=36
Fedoraproject Fedora=37
ruby-lang Ruby>=2.7.0<2.7.7
ruby-lang Ruby>=3.0.0<3.0.5
ruby-lang Ruby>=3.1.0<3.1.3

Event History

Nov 18, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·11:15 PM
DescriptionSeverityWeaknessAffected Software
Nov 19, 2022
Advisory Published
via GitHub·12:30 AM
Nov 30, 2022
Data Sourced
via Red Hat·04:50 PM
DescriptionSeverityAffected Software
Feb 1, 2024
Data Sourced
via Launchpad·12:01 AM
Description
Sep 16, 2024
Data Sourced
via Ubuntu·02:33 AM
RemedyDescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the vulnerability ID for the Ruby gem cgi.rb vulnerability?

The vulnerability ID for the Ruby gem cgi.rb vulnerability is CVE-2021-33621.

2

What is the severity of CVE-2021-33621?

CVE-2021-33621 has a severity rating of 8.8 (High).

3

Which software versions are affected by CVE-2021-33621?

Ruby gem cgi.rb versions 0.1.0.2, 0.2.x (up to 0.2.2), and 0.3.x (up to 0.3.5) are affected by CVE-2021-33621.

4

How can an attacker exploit CVE-2021-33621?

An attacker can exploit CVE-2021-33621 by inserting untrusted input into the HTTP response header of a CGI application using the CGI library, causing header injection and potentially injecting malicious content.

5

Are there any remediation steps available for CVE-2021-33621?

Yes, remediation steps are available for CVE-2021-33621. Please refer to the references provided for more information.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203