Critical HTTP Response Splitting Vulnerability in JRuby and Ruby Packages

jruby Updated 02 Oct 2025

Summary

18/11/2022
N/A
No i
High
8.8

UBUNTU-CVE-2021-33621: 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. Affects jruby versions 1.5.6-5ubuntu1 – 1.5.6-9+deb8u2build0.14.04.1~esm2. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

JRuby is an implementation of the Ruby programming language on the Java Virtual Machine (JVM). It allows Ruby applications to run on the JVM, enabling integration with Java libraries and frameworks. Ruby, a dynamic, open-source programming language, is widely used for web development and scripting. The vulnerability in question affects various versions of JRuby and Ruby packages, specifically those that utilize the cgi gem, which is responsible for handling Common Gateway Interface (CGI) requests. This vulnerability exposes applications to potential HTTP response splitting attacks, which can lead to severe security issues.

Vulnerability Detail

The cgi gem versions prior to 0.1.0.2, 0.2.x before 0.2.2, and 0.3.x before 0.3.5 for Ruby allow HTTP response splitting. This vulnerability arises when untrusted user input is used to generate an HTTP response or create a CGI::Cookie object. Attackers can exploit this flaw to manipulate HTTP headers, potentially leading to session fixation, cache poisoning, or cross-site scripting (XSS) attacks. The CVSS score for this vulnerability is 8.8, indicating a critical level of risk.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If immediate patching is not feasible, consider implementing input validation and sanitization for any user inputs that are used in HTTP responses. This can help mitigate the risk of HTTP response splitting. Additionally, ensure that your application does not trust user inputs blindly and employs secure coding practices.

Conclusion

The vulnerability in the cgi gem affects various JRuby and Ruby packages, allowing for HTTP response splitting attacks. It is crucial to update the affected packages to their patched versions to mitigate the risk. Implementing secure coding practices and input validation can also help protect your applications until updates can be applied.

See every vulnerability recorded for jruby →

Share this vulnerability

FAQ

HTTP response splitting is a vulnerability that allows an attacker to manipulate the HTTP response headers sent by a web server, potentially leading to various attacks such as cache poisoning and XSS.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By simply uploading a manifest file like package-lock.json, you can check for vulnerabilities without needing to access the code.

Exploiting this vulnerability can lead to severe security issues, including session fixation, cache poisoning, and XSS attacks, which can compromise user data and application integrity.

Yes, implementing input validation and sanitization for user inputs can help mitigate the risk of HTTP response splitting until a patch can be applied.

If you cannot update the package immediately, prioritize implementing secure coding practices and input validation to reduce the risk of exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for jruby.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback