Live threats

All CVEs / Nokogiri

CVE-2019-5477Nokogiri

Critical 9.8 No auth needed

Priority
74
CVSS 3.1
9.8
EPSS
6.1%
probability of exploitation in 30 days · percentile 94
Auth required
No
Published
Aug 16, 2019
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-78
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Nokogiri.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
RubyGems nokogiri < 1.10.4 1.10.4 gem "nokogiri", ">= 1.10.4"
RubyGems rexical < 1.0.7 1.0.7 gem "rexical", ">= 1.0.7"

Per OSV / GitHub Advisories (GHSA-cr5j-953j-xw5p). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
nokogirinokogiri≤ 1.10.3
canonicalubuntu_linux16.04
canonicalubuntu_linux18.04
canonicalubuntu_linux19.04
canonicalubuntu_linux19.10
debiandebian_linux8.0
debiandebian_linux10.0

Official advisories

Vendor, CERT and distribution advisories that name this CVE. Original titles.

Official sources

References

Links published by the sources. Open them with care.