CVE-2017-17790

The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injection attacks, as demonstrated by a…

published December 20, 2017

CVSS
—
EPSS
6%
Percentile
93.2
In the wild
Unconfirmed
What it is

⚠️ A crafty command injection vulnerability lurks in Ruby's resolv.rb up to version 2.4.3, and it all starts with a sneaky pipe symbol! Think of it like a restaurant that allows customers to order off the menu but doesn’t check what’s written on the order slip. If a crafty diner slips in a hidden message, the kitchen might whip up something unexpected! An attacker could exploit this by injecting commands that the Ruby application might execute, potentially leading to unauthorized access or system compromise. While the chances of encountering untrusted input are rare, the consequences could be quite serious if they do arise!

Put simply

Think of it like a restaurant that allows customers to order off the menu but doesn’t check what’s written on the order slip. If a crafty diner slips in a hidden message, the kitchen might whip up something unexpected! The lazy_initialize function utilizes Kernel#open in a way that can be tricked into executing arbitrary commands when it processes inputs starting with a '|' character, posing a significant risk in scenarios where user-supplied data is involved.

What to do

An attacker could exploit this by injecting commands that the Ruby application might execute, potentially leading to unauthorized access or system compromise. While the chances of encountering untrusted input are rare, the consequences could be quite serious if they do arise! To mitigate this, ensure you’re using a safe version of Ruby — update to at least 2.4.4 or later. Additionally, sanitize all input data rigorously and avoid passing untrusted content to functions like lazy_initialize. 🛡️ This is manageable! With a little diligence on your part, you can keep your Ruby applications secure! You've got this! 🎉

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.05913 · 93.2th percentile
Published
2017-12-20T09:00Z
EPSS history
Timeline
  • 20 DEC 09:00Z
    The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injection attacks, as demonstrated by a…
    cvelistv5