Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
AV:N reflects Nokogiri's predominant use in web apps processing external XSLT; AC:H captures use-after-free heap-layout complexity; S:C and I:H/A:H align with upstream libxslt ratings.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Lifecycle Timeline
4DescriptionCVE.org
Nokogiri before 1.18.4 bundles a vulnerable version of libxslt (prior to 1.1.43) that contains two use-after-free vulnerabilities: CVE-2025-24855 (use-after-free of the XPath context node due to xsltEvalXPathStringNs leaking xpathCtxt->node) and CVE-2024-55549 (use-after-free related to excluded result prefixes/namespaces). Processing crafted XSLT can trigger memory corruption. Nokogiri 1.18.4 upgrades the bundled libxslt to 1.1.43 to resolve these issues.
AnalysisAI
Use-after-free memory corruption in Nokogiri before 1.18.4 exposes Ruby applications to potential heap corruption and process compromise when processing attacker-supplied XSLT stylesheets. The root cause is Nokogiri's bundled libxslt dependency (prior to v1.1.43), which contains two distinct UAF bugs: CVE-2025-24855 (XPath context node leaked by xsltEvalXPathStringNs) and CVE-2024-55549 (namespace prefix handling corruption). No public exploit code has been identified at time of analysis, and CISA KEV listing is absent; a vendor-released patch (Nokogiri 1.18.4) is available.
Technical ContextAI
Nokogiri is a Ruby gem for parsing HTML and XML that ships a statically bundled copy of libxslt, the GNOME XSLT processing library, rather than relying on the system-provided version. This bundling strategy means Nokogiri carries its own libxslt vulnerability surface independent of OS package updates. The two underlying flaws are classic CWE-416 (Use After Free) defects in libxslt's XSLT evaluation engine: CVE-2025-24855 occurs because xsltEvalXPathStringNs leaks a reference to xpathCtxt->node, allowing it to be freed while still reachable; CVE-2024-55549 corrupts memory in the excluded result prefixes/namespaces code path. Both are triggered by parsing crafted XSLT stylesheets. Affected product is identified via CPE cpe:2.3:a:sparklemotion:nokogiri:*:*:*:*:*:*:*:*, covering all Nokogiri versions prior to 1.18.4 across all platforms.
RemediationAI
Upgrade Nokogiri to version 1.18.4 or later; this is the vendor-confirmed fix (https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-mrxw-mxhj-p664) and upgrades the bundled libxslt to v1.1.43. In most Ruby/Bundler projects this is accomplished with 'bundle update nokogiri' followed by pinning '~> 1.18.4' in the Gemfile. If an immediate upgrade is not possible, a compensating control is to disable or gate any application pathway that accepts XSLT stylesheets from untrusted sources - rejecting externally supplied XSLT at the application boundary eliminates the attack surface without requiring a gem update, though this may break intended functionality for applications that rely on user-supplied transforms. Applications using a system-provided libxslt rather than Nokogiri's bundled copy should verify the system libxslt is at v1.1.43 or newer; if it is, the exposure from this specific vector is mitigated at the OS level.
Nokogiri is an open source XML and HTML library for Ruby. Rated high severity (CVSS 8.2), this vulnerability is remotely
A command injection vulnerability in Nokogiri v1.10.3 and earlier allows commands to be executed in a subprocess via Rub
Memory-corruption denial of service (and potential code execution) affects the Ruby Nokogiri gem before 1.18.3, which bu
Out-of-bounds memory read in Nokogiri (CRuby) versions before 1.19.4 crashes the host Ruby process when application code
Denial-of-service in Nokogiri before 1.19.3 stems from three distinct ReDoS vulnerabilities in the CSS selector tokenize
Heap-based buffer under-read in libxml2's XML Schema identity constraint processor affects all Nokogiri releases prior t
Nokogiri is an open source XML and HTML library for the Ruby programming language. Rated high severity (CVSS 7.5), this
Nokogiri is an open source XML and HTML library for Ruby. Rated high severity (CVSS 7.5), this vulnerability is remotely
Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. Rated high sever
Unchecked return value in Nokogiri's CRuby extension (versions 1.5.1 through 1.19.0) causes the `canonicalize` method to
Heap memory leaks in Nokogiri's XSLT transform method (versions before 1.19.3) enable gradual denial of service against
Out-of-bounds read in Nokogiri's `NodeSet#[]` method (all versions before 1.19.4) enables an attacker who can supply a l
Same weakness CWE-416 – Use After Free
View allSame technique Use After Free
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2025-210773
GHSA-7jxm-3c74-9v37