Critical Vulnerability in Ruby Packages: ruby2.5 and ruby3.0

ruby2.5 Updated 03 Oct 2025

Summary

23/01/2023
N/A
Yes i
Unrated
Not published

USN-5806-2: ruby2.5, ruby3.0 vulnerability. Affects ruby2.5 versions < 2.5.1-1ubuntu1.13. Fixed in 2.5.1-1ubuntu1.13. 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

Ruby is a dynamic, open-source programming language known for its simplicity and productivity. It is widely used for web development, particularly with the Ruby on Rails framework. The affected packages, ruby2.5 and ruby3.0, are versions of the Ruby interpreter that enable developers to run Ruby applications. These versions are susceptible to a vulnerability that could allow attackers to manipulate HTTP responses generated by applications using the cgi gem, potentially compromising user data and application integrity.

Vulnerability Detail

The vulnerability, identified as CVE-2021-33621, arises from Ruby's improper handling of user input in applications that generate HTTP responses using the cgi gem. An attacker could exploit this flaw to modify the responses sent to users, leading to possible data leakage or unauthorized actions being taken on behalf of the user. This vulnerability affects multiple versions of Ruby, specifically ruby2.5 and ruby3.0, and poses a significant risk to applications relying on these versions.

How To Fix

Minimum fixed version

2.5.1-1ubuntu1.13

This is the first release that contains the fix.

sudo apt-get install --only-upgrade ruby2.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate updating is not feasible, consider implementing input validation and sanitization in your application to mitigate the risk of exploitation. Additionally, review your application's use of the cgi gem and consider alternative methods for generating HTTP responses until the update can be applied.

Conclusion

The vulnerability in ruby2.5 and ruby3.0 poses a significant risk to applications that utilize these versions. It is crucial to update to the patched versions to safeguard against potential exploitation. Additionally, employing best practices in input handling can further enhance application security.

See every vulnerability recorded for ruby2.5 →

Share this vulnerability

FAQ

CVE-2021-33621 is a vulnerability in Ruby that allows attackers to manipulate HTTP responses due to improper handling of user input in the cgi gem.

The affected versions are ruby2.5 and ruby3.0, specifically the versions prior to the patched releases.

You can use Vulert, which monitors open-source vulnerabilities in your software. By uploading your manifest file like package-lock.json, you can check for vulnerabilities without needing to install any software.

If exploited, this vulnerability could lead to unauthorized data access, manipulation of user responses, and overall compromise of application security.

Yes, implementing input validation and sanitization can help mitigate the risk until you can apply the necessary updates.

Related vulnerabilities

Recent vulnerabilities recorded for ruby2.5.

How To Fix

Minimum fixed version

2.5.1-1ubuntu1.13

This is the first release that contains the fix.

sudo apt-get install --only-upgrade ruby2.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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