CVE-2026-57236
published low CVSS 4.0 · 1.7Nokogiri: Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| sparklemotion | — | nokogiri< 1.19.4 | Affected | Not stated | GitHub_M |
| Alpine Linux | edge | ruby-nokogiri | Fixed | 1.19.4-r0 | Package fix record |
| Alpine Linux | v3.24 | ruby-nokogiri | Fixed | 1.19.4-r0 | Package fix record |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 1.7 / 10
- Severity
- low
- Provider
- GitHub_M · cna
- Vector string
- CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| sparklemotion | nokogiri | < 1.19.4 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-416 CWE-416: Use After Free
References
1Provider assertions
2GitHub_M · cna
Nokogiri: Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- c492ab75ce04f18e0db40a88edae95e9a79bb37c85aafa1b5b839e2da1420d2f
- Ingested
- 23 Sep 2026, 09:21:43 UTC
- Source record
- Official CVE record