Advisories for Gem/Cgi package

2025
2022

HTTP response splitting in CGI

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.

Integer Overflow or Wraparound

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.

2021

Duplicate of ./gem/cgi/CVE-2021-41816.yml

A security vulnerability that causes buffer overflow when you pass a very large string ( MB) to CGI.escape_html on a platform where long type takes 4 bytes, typically, Windows. Please update the cgi gem to,1,1 or later. You can use gem update cgi to update it. If you are using bundler, please add gem "cgi", " " to your Gemfile. Alternatively, please update Ruby to This issue has been introduced …