Critical Code Injection Vulnerability in JRuby and Ruby Packages

jruby Updated 03 Oct 2025

Summary

20/11/2019
N/A
Yes i
High
8.1

UBUNTU-CVE-2019-16255: Ruby through 2.4.7, 2.5.x through 2.5.6, and 2.6.x through 2.6.4 allows code injection if the first argument (aka the "command" argument) to Shell#[] or Shell#test in lib/shell.rb is untrusted data. Affects jruby versions < 1.5.6-9+deb8u2build0.14.04.1~esm2. Fixed in 1.5.6-9+deb8u2build0.14.04.1~esm2. 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 Your last release was probably never penetration tested 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 that runs on the Java Virtual Machine (JVM). It allows Ruby applications to leverage Java libraries and provides a bridge between Ruby and Java. The Ruby packages, including versions 2.3, 2.5, and 2.6, are widely used for web development and scripting. The vulnerability in question affects these packages, allowing untrusted data to be executed as code, which poses a significant security risk.

Vulnerability Detail

Ruby through versions 2.4.7, 2.5.x through 2.5.6, and 2.6.x through 2.6.4 contains a critical vulnerability that allows code injection via the Shell#[] or Shell#test methods in lib/shell.rb. If the first argument to these methods is untrusted data, an attacker can exploit this to execute arbitrary Ruby methods, leading to potential system compromise. This vulnerability has a CVSS score of 8.1, indicating a high severity level.

How To Fix

Minimum fixed version

1.5.6-9+deb8u2build0.14.04.1~esm2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade jruby

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

Workaround

As a temporary workaround, avoid using untrusted data as arguments in Shell#[] or Shell#test methods. Implement input validation to sanitize any user inputs before passing them to these methods.

Conclusion

The vulnerability in JRuby and Ruby packages poses a significant risk due to its potential for code injection. It is crucial for users to update their packages to the latest patched versions and implement input validation as a temporary workaround. Regular monitoring for vulnerabilities using tools like Vulert can help maintain the security of your applications.

See every vulnerability recorded for jruby →

Share this vulnerability

FAQ

The vulnerability allows code injection through untrusted data passed to specific Ruby methods, potentially leading to arbitrary code execution.

Affected versions include Ruby through 2.4.7, 2.5.x through 2.5.6, and 2.6.x through 2.6.4.

You can use Vulert, which monitors open-source vulnerabilities in your software using a manifest file. Check your application at Vulert Scanner.

Implement input validation to sanitize user inputs and avoid using untrusted data in the affected methods as a temporary measure.

The CVSS score of this vulnerability is 8.1, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for jruby.

How To Fix

Minimum fixed version

1.5.6-9+deb8u2build0.14.04.1~esm2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade jruby

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