llamaCVEVulnerability Intelligence
/
Advisory · GitHub · RubyGems · nokogiri

GHSA-PHWJ-RPRQ-35PP

Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Attr#value=` or `#content=`

Parche disponible
Descargar PNG JSON
CVSS
—
low
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -1 d de la divulgación
Exposición152 dDesde la divulgación, 19 jun 2026, 11:37 a. m.
Detección150 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Parche 1.19.4
Monitoreo
Detectada
18 jun 26
19 jun 26
10 sept 26
17 nov 26
19 nov 26
18 jun 26
27 jul 26
3 sept 26
12 oct 26
19 nov 26
FechaFaseEventoDetalle
Remediación Parche 1.19.4 nokogiri · -1 d desde divulgación
Divulgación Publicada GHSA-PHWJ-RPRQ-35PP divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

Nokogiri’s CRuby native extension could leave a Ruby wrapper pointing to freed memory when replacing the value of an XML attribute. If Ruby code had already accessed an attribute child node, `Nokogiri::XML::Attr#value=` could free the underlying native child node while the wrapper remained reachable through the document node cache. A later use of the freed child node or a Ruby GC mark could dereference an invalid pointer, causing an invalid read and a possible segfault.

Nokogiri 1.19.4 preserves any already-wrapped attribute child nodes before replacing the attribute value.

JRuby is not affected.

Severity

The Nokogiri maintainers have evaluated this as low severity. Reaching it requires an unusual API-usage pattern that does not arise during normal use. The application must directly access an attribute's child node and then replace that same attribute's value via `Attr#value=` or `#content=`. Nokogiri 1.19.4 makes this pattern safe with no change to the public API. Already-wrapped attribute child nodes are preserved before the value is replaced.

Mitigation

Upgrade to Nokogiri 1.19.4 or later.

As a workaround, avoid accessing attribute child nodes directly via `Attr#child` or similar before mutating the same attribute’s value.

Credit

This issue was responsibly reported by Zheng Yu from depthfirst.com.

Versiones

Rangos afectados

Afectada Corregida Última
nokogiri< 1.19.4
1.19.4
1.19.7
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
rubygemsnokogiri
Corregida 1.19.4 -1 d 1.19.7 no afectada
Versiones corregidas1.19.4
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Otrahttps://github.com/sparklemotion/nokogiri/security/advisories/GHSA-phwj-rprq-35pp
Otrahttps://github.com/sparklemotion/nokogiri

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.