CVE-2019-5477 · hackerone
CVE-2019-5477
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.
Published 2019-08-16, last changed 2026-06-17. Weakness: CWE-78.
How to fix
Upgrade to a fixed version: nokogiri 1.10.4 (RubyGems); rexical 1.0.7 (RubyGems). For the version that clears every advisory for your installed version, ask an agent for get_remediation.
Where the flaw is in the code
Fixed in sparklemotion/nokogiri by 5d30128343. Functions changed by the fix: initialize, text, cdata, comment, to_xml, method_missing, insert, scan_setup, action, scan_str, load_file, scan_file. Regression tests: test/xml/test_builder.rb. Confidence: inferred (code changed near the fix, but no record names this exact commit as the fix).
Timeline
| 2019-08-16 | Published |
| 2019-08-19 | Package advisory GHSA-cr5j-953j-xw5p |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 6.14% |
| 2026-12-02 | Code-level analysis added |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-cr5j-953j-xw5p | nokogiri (RubyGems) | 1.10.4 |
| GHSA-cr5j-953j-xw5p | rexical (RubyGems) | 1.0.7 |
Also known as: GHSA-cr5j-953j-xw5p
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2026-126064 | 2026-11-10 | 2 | Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Node#[]=` or `#lang=` |
| CVE-2026-126063 | 2026-11-10 | 2.3 | Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer |
| CVE-2026-126062 | 2026-11-10 | 3.7 | Nokogiri : Possible SSRF on JRuby when resolving external DTDs or entities with `NONET` set |
| CVE-2026-79772 | 2026-08-25 | 6.9 | Nokogiri before 1.19.1 Unchecked Return Value canonicalize |
| CVE-2026-79771 | 2026-08-25 | 6.9 | Nokogiri before 1.19.3 Memory Leak via XSLT Transform |
| CVE-2026-79770 | 2026-08-25 | 8.7 | Nokogiri before 1.19.3 ReDoS via CSS selector tokenizer |
| CVE-2026-57438 | 2026-06-25 | 6.6 | Nokogiri: Possible Use-After-Free in XInclude Processing |
| CVE-2026-57437 | 2026-06-25 | 5.3 | Nokogiri: Possible Use-After-Free when directly using `NokogirI::XML::XPathContext` beyond document lifetime |
Add it to your agent
One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.
claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp
Then ask for triage_cve CVE-2019-5477, or call /api/v1/vulnerabilities/CVE-2019-5477. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.