CVE-2019-5477CWE-78

A command injection vulnerability in Nokogiri v1.10.3 and earlier allows commands to be executed in a subprocess via Ruby's `Kernel.open` method

published August 16, 2019

CVSS
โ€”
EPSS
6%
Percentile
93.2
In the wild
Unconfirmed
What it is

โš ๏ธ A sneaky command injection hides in Nokogiri! This vulnerability lets attackers run commands on your server if they can trick it into using unsafe filenames. ๐Ÿ”ฅ Think of it like a chef who blindly follows a recipe without checking the ingredients. If someone sneaks in a toxic ingredient labeled as 'secret spice,' it could spoil the entire dish! An attacker could exploit this vulnerability to execute arbitrary commands on your server. If they manage to manipulate the user input to the undocumented `load_file` method, it could lead to complete control over the affected process โ€” a recipe for disaster!

Put simply

Think of it like a chef who blindly follows a recipe without checking the ingredients. If someone sneaks in a toxic ingredient labeled as 'secret spice,' it could spoil the entire dish! This command injection flaw exists in Nokogiri v1.10.3 and earlier due to the `Kernel.open` method being called with user-controlled file names. The vulnerability specifically arises when the method is invoked through the `Nokogiri::CSS::Tokenizer#load_file` function.

What to do

An attacker could exploit this vulnerability to execute arbitrary commands on your server. If they manage to manipulate the user input to the undocumented `load_file` method, it could lead to complete control over the affected process โ€” a recipe for disaster! To protect yourself, upgrade Nokogiri to version 1.10.4 or later, which incorporates a patched version of the Rexical gem (v1.0.7). Ensure you also validate user input thoroughly to avoid mishaps. ๐Ÿ›ก๏ธ You've got this! Follow these steps, and you'll have your defenses up in no time! ๐Ÿš€

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.05899 ยท 93.2th percentile
Weakness
CWE-78 ยท Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Published
2019-08-16T00:00Z
EPSS history
Timeline
  • 16 AUG 00:00Z
    A command injection vulnerability in Nokogiri v1.10.3 and earlier allows commands to be executed in a subprocess via Ruby's `Kernel.open` method
    cvelistv5