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
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
- Aug 16, 2019
- Updated
- Jun 16, 2026
- EPSS
- 5.9% · 93th percentile
- CWE
- CWE-78
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
41
Plan
Add it to your regular patch cycle.
- CVSS
- 39 / 40 · 9.8 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 2 / 30 · 5.9%
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| nokogiri | nokogiri | cpe:2.3:a:nokogiri:nokogiri |
| canonical | ubuntu linux | cpe:2.3:o:canonical:ubuntu_linux |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- canonical ubuntu linux16.04
- canonical ubuntu linux18.04
- canonical ubuntu linux19.04
- canonical ubuntu linux19.10
- debian debian linux10.0
- debian debian linux8.0
- nokogiri nokogiriup to 1.10.3 inclusive
Versions reported by the vendor
Affected version ranges reported by the assigning authority (hackerone). Independent of NVD's CPE analysis and usually ahead of it.
n/a Nokogiri (ruby gem)
- Fixed in v1.10.4affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:10 | rexical | before 1.0.5-2+deb10u1 | 1.0.5-2+deb10u1 |
| Debian:10 | ruby-nokogiri | before 1.10.0+dfsg1-2+deb10u1 | 1.10.0+dfsg1-2+deb10u1 |
| Debian:12 | rexical | before 1.0.7-1 | 1.0.7-1 |
| Debian:12 | ruby-nokogiri | before 1.10.4+dfsg1-1 | 1.10.4+dfsg1-1 |
| Debian:8 | ruby-nokogiri | before 1.6.3.1+ds-1+deb8u1 | 1.6.3.1+ds-1+deb8u1 |
| openSUSE:Leap 15.2 | rubygem-nokogiri | before 1.8.5-lp152.4.3.1 | 1.8.5-lp152.4.3.1 |
| RubyGems | nokogiri | before 1.10.4 | 1.10.4 |
| RubyGems | rexical | before 1.0.7 | 1.0.7 |
| SUSE:HPE Helion OpenStack 8 | ardana-ansible | before 8.0+git.1566374355.c509923-3.67.3 | 8.0+git.1566374355.c509923-3.67.3 |
| SUSE:HPE Helion OpenStack 8 | ardana-glance | before 8.0+git.1566376789.be0fe01-3.17.3 | 8.0+git.1566376789.be0fe01-3.17.3 |
| SUSE:HPE Helion OpenStack 8 | ardana-horizon | before 8.0+git.1565816064.5d4f73f-3.18.3 | 8.0+git.1565816064.5d4f73f-3.18.3 |
| SUSE:HPE Helion OpenStack 8 | ardana-input-model | before 8.0+git.1566517401.98450e6-3.33.3 | 8.0+git.1566517401.98450e6-3.33.3 |
| SUSE:HPE Helion OpenStack 8 | ardana-manila | before 8.0+git.1568835837.2452e7a-1.21.3 | 8.0+git.1568835837.2452e7a-1.21.3 |
| SUSE:HPE Helion OpenStack 8 | ardana-neutron | before 8.0+git.1568220097.74ee4b4-3.33.3 | 8.0+git.1568220097.74ee4b4-3.33.3 |
| SUSE:HPE Helion OpenStack 8 | ardana-nova | before 8.0+git.1566902754.c58ff69-3.35.3 | 8.0+git.1566902754.c58ff69-3.35.3 |
| SUSE:HPE Helion OpenStack 8 | ardana-octavia | before 8.0+git.1568373448.bcaee7e-3.20.3 | 8.0+git.1568373448.bcaee7e-3.20.3 |
| SUSE:HPE Helion OpenStack 8 | ardana-tempest | before 8.0+git.1566471887.fd2fec7-3.27.3 | 8.0+git.1566471887.fd2fec7-3.27.3 |
| SUSE:HPE Helion OpenStack 8 | galera-3 | before 25.3.25-4.6.3 | 25.3.25-4.6.3 |
| SUSE:HPE Helion OpenStack 8 | grafana | before 4.6.5-4.6.3 | 4.6.5-4.6.3 |
| SUSE:HPE Helion OpenStack 8 | mariadb | before 10.2.25-4.14.2 | 10.2.25-4.14.2 |
| SUSE:HPE Helion OpenStack 8 | mariadb-connector-c | before 3.1.2-3.12.3 | 3.1.2-3.12.3 |
| SUSE:HPE Helion OpenStack 8 | novnc | before 1.0.0-3.6.3 | 1.0.0-3.6.3 |
| SUSE:HPE Helion OpenStack 8 | openstack-cinder | before 11.2.3~dev16-3.21.4 | 11.2.3~dev16-3.21.4 |
| SUSE:HPE Helion OpenStack 8 | openstack-cinder-doc | before 11.2.3~dev16-3.21.3 | 11.2.3~dev16-3.21.3 |
+70
Same product
nokogiri: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-79770Nokogiri before 1.19.3 ReDoS via CSS selector tokenizer34Monitor
- CVE-2022-29181Improper Handling of Unexpected Data Type in Nokogiri33Monitor
- CVE-2022-23476Unchecked return value from xmlTextReaderExpand in Nokogiri31Monitor
- CVE-2022-24836Inefficient Regular Expression Complexity in Nokogiri31Monitor
- CVE-2012-6685Nokogiri before 1.5.4 is vulnerable to XXE attacks31Monitor
- CVE-2021-41098Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby30Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| debian:rexical | 1.0.7-1 · Debian:12 | Package registry (OSV) |
| debian:ruby-nokogiri | 1.10.4+dfsg1-1 · Debian:12 | Package registry (OSV) |
| opensuse:rubygem-nokogiri | 1.8.5-lp152.4.3.1 · openSUSE:Leap 15.2 | Package registry (OSV) |
| RubyGems:nokogiri | 1.10.4 | Package registry (OSV) |
| RubyGems:rexical | 1.0.7 | Package registry (OSV) |
| suse:crowbar-core | 4.0+git.1570463621.40b11cd48-9.54.1 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:crowbar-openstack | 4.0+git.1569429513.e7016b2b6-9.59.1 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:grafana | 4.6.5-1.11.2 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:novnc | 1.0.0-12.1 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:openstack-keystone | 10.0.3~dev9-7.18.2 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:openstack-keystone-doc | 10.0.3~dev9-7.18.2 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:openstack-neutron | 9.4.2~dev21-7.32.1 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:openstack-neutron-doc | 9.4.2~dev21-7.32.1 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:openstack-neutron-lbaas | 9.2.2~dev11-4.18.3 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:openstack-neutron-lbaas-doc | 9.2.2~dev11-4.18.3 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:openstack-nova | 14.0.11~dev13-4.34.3 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
| suse:openstack-nova-doc | 14.0.11~dev13-4.34.2 · SUSE:OpenStack Cloud 7 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
No commit or PR link among the references.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-78 · Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvd-primary
Root cause
User input is inserted as text into a shell command. The shell may interpret special characters in the input as part of the command.
The bug in code
The whole CWE-78 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
const host = req.body.host;exec("ping -c 1 " + host, onResult);Fixed
const host = req.body.host;if (!/^[a-z0-9.-]{1,253}$/i.test(host)) return res.sendStatus(400);execFile("ping", ["-c", "1", host], onResult);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Command Line Execution through SQL InjectionCAPEC-108likelihood: Low · Very High
- Command DelimitersCAPEC-15likelihood: High · High
- Exploiting Multiple Input Interpretation LayersCAPEC-43likelihood: Medium · High
- Argument InjectionCAPEC-6likelihood: High · High
- OS Command InjectionCAPEC-88likelihood: High · High
ATT&CK techniques
—
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpChange log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- github.com/sparklemotion/nokogiri/issues/1915
- github.com/tenderlove/rexical/blob/master/CHANGELOG.rdoc
- hackerone.com/reports/650835
- lists.debian.org/debian-lts-announce/2019/09/msg00027.html
- lists.debian.org/debian-lts-announce/2022/10/msg00018.html
- lists.debian.org/debian-lts-announce/2022/10/msg00019.html
- security.gentoo.org/glsa/202006-05
- usn.ubuntu.com/4175-1/
Vendor advisories and official records. Exploit/PoC links are deliberately left out.