CVE-2019-5477Nokogiri
Critical 9.8 No auth needed
Follow: this CVE · Nokogiri · Nokogiri We alert you by email or Slack (account required).
- 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.
What to do
- Apply the vendor's security update for Nokogiri.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How 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)
| Vendor | Product | Versions |
|---|---|---|
| nokogiri | nokogiri | ≤ 1.10.3 |
| canonical | ubuntu_linux | 16.04 |
| canonical | ubuntu_linux | 18.04 |
| canonical | ubuntu_linux | 19.04 |
| canonical | ubuntu_linux | 19.10 |
| debian | debian_linux | 8.0 |
| debian | debian_linux | 10.0 |
Official advisories
- ruby4.0-rubygem-nokogiri-1.18.9-1.4 on GA media · SUSE · openSUSE-SU-2026:10356-1 · Mar 13, 2026 Critical
Vendor, CERT and distribution advisories that name this CVE. Original titles.
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch Third Party Advisory
- github.com Release Notes
- hackerone.com Permissions Required
- lists.debian.org Mailing List Third Party Advisory
- lists.debian.org Mailing List Third Party Advisory
- lists.debian.org Mailing List Third Party Advisory
- security.gentoo.org Third Party Advisory
- usn.ubuntu.com Third Party Advisory