<Vulnerability name="CVE-2026-57236">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Moderate</ThreatSeverity>
    <PublicDate>2026-06-25T14:29:14</PublicDate>
    <Bugzilla id="2492952" url="https://bugzilla.redhat.com/show_bug.cgi?id=2492952" xml:lang="en:us">
nokogiri: Nokogiri: Denial of Service or Information Disclosure via invalid encoding handling
    </Bugzilla>
    <CVSS3 status="draft">
        <CVSS3BaseScore>6.5</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:H</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-825</CWE>
    <Details xml:lang="en:us" source="Mitre">
Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, calling Document#encoding= with an invalid encoding (e.g., a non-string, or a string containing a null byte) raises an exception, but only after freeing the document's current encoding string without replacing it. The document is left referencing freed memory, so the next call to Document#encoding reads invalid memory, which can cause a segfault or leak freed bytes into a Ruby String. Affects the CRuby (libxml2) implementation only; JRuby is not affected. This vulnerability is fixed in 1.19.4.
    </Details>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in Nokogiri, an XML and HTML library for Ruby. When an attacker provides an invalid encoding to the Document#encoding= function, the library frees the document's current encoding string without replacing it. This leaves the document referencing freed memory, which can lead to a denial of service (DoS) due to a segmentation fault or information disclosure by leaking freed memory into a Ruby String.
    </Details>
    <Statement xml:lang="en:us">
This flaw has an Important impact as Nokogiri's CRuby implementation in Red Hat products is vulnerable to a use-after-free when processing invalid encoding values. A remote unauthenticated attacker can trigger a segmentation fault causing denial of service, or leak freed memory contents into a Ruby String causing information disclosure, by providing crafted input that causes an invalid encoding to be set on a document.
    </Statement>
    <Mitigation xml:lang="en:us">
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.
    </Mitigation>
    <PackageState cpe="cpe:/a:redhat:satellite:6">
        <ProductName>Red Hat Satellite 6</ProductName>
        <FixState>Affected</FixState>
        <PackageName>rubygem-nokogiri</PackageName>
    </PackageState>
    <PackageState cpe="cpe:/a:redhat:satellite:6">
        <ProductName>Red Hat Satellite 6</ProductName>
        <FixState>Affected</FixState>
        <PackageName>satellite:el8/rubygem-nokogiri</PackageName>
    </PackageState>
    <References xml:lang="en:us">
https://www.cve.org/CVERecord?id=CVE-2026-57236
https://nvd.nist.gov/vuln/detail/CVE-2026-57236
https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-5v8h-3h3q-446p
    </References>
</Vulnerability>