CVE-2026-57236

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.
References
Configurations

Configuration 1 (hide)

cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:*

History

25 Oct 2026, 23:10

Type Values Removed Values Added
Summary
  • (es) Nokogiri es una biblioteca XML y HTML de código abierto para el lenguaje de programación Ruby. Antes de la versión 1.19.4, al llamar a Document#encoding= con una codificación no válida (por ejemplo, una no-cadena, o una cadena que contiene un byte nulo) se lanza una excepción, pero solo después de liberar la cadena de codificación actual del documento sin reemplazarla. El documento queda referenciando memoria liberada, por lo que la siguiente llamada a Document#encoding lee memoria no válida, lo que puede causar un segfault o filtrar bytes liberados en una cadena Ruby. Afecta solo a la implementación de CRuby (libxml2); JRuby no se ve afectado. Esta vulnerabilidad está corregida en la versión 1.19.4.

Information

Published : 2026-06-25 15:16

Updated : 2026-10-25 23:10


NVD link : CVE-2026-57236

Mitre link : CVE-2026-57236

CVE.ORG link : CVE-2026-57236


JSON object : View

Products Affected

nokogiri

  • nokogiri
CWE
CWE-416

Use After Free