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.
CVE-2026-57236
This high-severity CVE scores 8.2 under NVD CVSS v3. EPSS exploit probability: 0.3%, top 75% of all CVEs by exploit prediction. GitHub Security Advisory data not yet ingested — confidence will rise once GHSA publishes (typical lag: hours to days for open-source ecosystem CVEs; never for infrastructure-only CVEs).
- High severity, but no confirmed exploitation yet
No vendor fix yet — apply a workaround or compensating control (WAF / firewall / segmentation) and watch for a patch.
- CVSS v3
- 8.2
- EG Score
- 8.2(medium)
- EPSS
- 25.1%
- KEV
- Not listed
Published
June 25, 2026
Last Modified
June 26, 2026
Advisory Details (1)
Auto-updated Jun 26, 2026Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception · Advisory · sparklemotion/nokogiri · GitHub
https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-5v8h-3h3q-446pVendor Advisories for CVE-2026-57236(1)
These vendors published their own advisory mentioning this CVE — often with vendor-specific remediation steps + affected product lists not in NVD.
Frequently asked(5)
What is CVE-2026-57236?
When was CVE-2026-57236 disclosed?
Is CVE-2026-57236 actively exploited?
What is the CVSS score of CVE-2026-57236?
How do I remediate CVE-2026-57236?
Dependency Blast Radius
Explore the affected products and dependency analysis for CVE-2026-57236
Is Your Infrastructure Affected by CVE-2026-57236?
EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.