Loading...
Skip to main content

CVE-2019-5477

CRITICAL

Nokogiri Command Injection Vulnerability

Published August 19, 2019Updated February 18, 2024Source: osv

Summary

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. Processes are vulnerable only if the undocumented method `Nokogiri::CSS::Tokenizer#load_file` is being called with unsafe user input as the filename. This vulnerability appears in code generated by the Rexical gem versions v1.0.6 and earlier. Rexical is used by Nokogiri to generate lexical scanner code for parsing CSS queries. The underlying vulnerability was addressed in Rexical v1.0.7 and Nokogiri upgraded to this version of Rexical in Nokogiri v1.10.4.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update nokogiri to 1.10.4 or later
gem install nokogiri -v 1.10.4
Bundler
Update rexical to 1.0.7 or later
gem install rexical -v 1.0.7

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

PackageEcosystemAffectedFixed In
nokogiri
rubygems
1.0.0, 1.0.1, 1.0.2, 1.0.3 (+109 more)1.10.4
rexical
rubygems
1.0.3, 1.0.4, 1.0.5, 1.0.5.beta1 (+1 more)1.0.7

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-78
    OS Command InjectionMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2019-5477?
Nokogiri Command Injection Vulnerability This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2019-5477?
CVE-2019-5477 affects nokogiri and rexical. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2019-5477 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-cr5j-953j-xw5p

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies