8.2

CVE-2026-57236: Nokogiri: Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception

Analyzed
AliasesUBUNTU-CVE-2026-57236DEBIAN-CVE-2026-57236GHSA-5v8h-3h3q-446p
Published 25-06-2026Last modified 25-06-2026

Vulnerability summary

CVE-2026-57236 is a high (CVSS 8.2) Use After Free vulnerability in nokogiri. EPSS estimates a 0.34% chance of exploitation in the next 30 days, higher than 29.5% of scored vulnerabilities.

Priority
Routine

Not severe (CVSS 1.7, network access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
8.2/10
010
High · v3.1 (NVD)
EPSS score
0.34%
0%100%
Low · -0.09 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 5

Timeline

  1. 25-06-2026
    PublishedVulnerability first disclosed.
  2. 25-06-2026
    Last modifiedVulnerability information updated.

Description

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.

CVSS metrics

8 scores · 6 sources · 2 versions

EPSS trend

Probability

0.34%

Chance of exploitation in the next 30 days

Percentile

30%

Versus all other CVEs

30-day change

Decrease -0.09 pp

From 0.43% on 04-11-2026

04-11-202604-12-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.

Alpine1 product
  • ruby-nokogiri< 1.19.4-r0
Debian1 product
  • ruby-nokogiriAll versions (No fix recorded) | < 1.19.4+dfsg-1
Nokogiri1 product
RubyGems1 product
  • nokogiri< 1.19.4
Sparklemotion1 product
Ubuntu1 product
  • ruby-nokogiriAll versions (No fix recorded)

6 vendors · 6 products

References

7 links