CVE-2026-10618

Hugo's default fenced-code-block renderer writes attribute values taken from the code-fence info string into the rendered HTML without escaping them. New in markup/internal/attributes/attributes.go converts every attribute value from a byte slice to a string as it is stored, deliberately dropping the escaping that used to happen there, and RenderAttributes in the same file escapes only values that are still byte slices, so its escaping branch is never reached and every value is written verbatim. The function's documentation states that it performs HTML escaping of string attributes, which it does not. A quote inside an attribute value in the info string therefore terminates the attribute and allows a further attribute, including an event handler, to be placed on the wrapper element, and the script runs for every visitor who loads the page. This path is reached under the default configuration, with code fences enabled and without goldmark's unsafe setting or any custom render hook. Attribute names beginning with on are filtered when the attributes are parsed, so injection is achieved through the value rather than the name.
Configurations

Configuration 1 (hide)

cpe:2.3:a:gohugo:hugo:*:*:*:*:*:*:*:*

History

12 Oct 2026, 15:10

Type Values Removed Values Added
Summary
  • (es) El renderizador predeterminado de bloques de código vallados de Hugo escribe los valores de atributos tomados de la cadena de información de la valla de código en el HTML renderizado sin escaparlos. Lo nuevo en markup/internal/attributes/attributes.go convierte cada valor de atributo de un segmento de bytes a una cadena a medida que se almacena, eliminando deliberadamente el escape que solía ocurrir allí, y RenderAttributes en el mismo archivo escapa solo los valores que aún son segmentos de bytes, por lo que su rama de escape nunca se alcanza y cada valor se escribe textualmente. La documentación de la función establece que realiza el escape HTML de los atributos de cadena, lo cual no hace. Una comilla dentro de un valor de atributo en la cadena de información, por lo tanto, termina el atributo y permite que un atributo adicional, incluyendo un gestor de eventos, se coloque en el elemento contenedor, y el script se ejecuta para cada visitante que carga la página. Esta ruta se alcanza bajo la configuración predeterminada, con las vallas de código habilitadas y sin la configuración unsafe de goldmark ni ningún render hook personalizado. Los nombres de atributos que comienzan con on se filtran cuando se analizan los atributos, por lo que la inyección se logra a través del valor en lugar del nombre.

29 Sep 2026, 19:13

Type Values Removed Values Added
CPE cpe:2.3:a:gohugo:hugo:*:*:*:*:*:*:*:*
First Time Gohugo
Gohugo hugo
References () https://github.com/gohugoio/hugo - () https://github.com/gohugoio/hugo - Product
References () https://github.com/gohugoio/hugo/blob/v0.165.0/markup/goldmark/codeblocks/render.go - () https://github.com/gohugoio/hugo/blob/v0.165.0/markup/goldmark/codeblocks/render.go - Product
References () https://github.com/gohugoio/hugo/blob/v0.165.0/markup/highlight/highlight.go - () https://github.com/gohugoio/hugo/blob/v0.165.0/markup/highlight/highlight.go - Product
References () https://github.com/gohugoio/hugo/blob/v0.165.0/markup/internal/attributes/attributes.go - () https://github.com/gohugoio/hugo/blob/v0.165.0/markup/internal/attributes/attributes.go - Product
References () https://www.vulncheck.com/advisories/hugo-through-stored-cross-site-scripting-via-unescaped-code-fence-attribute-values - () https://www.vulncheck.com/advisories/hugo-through-stored-cross-site-scripting-via-unescaped-code-fence-attribute-values - Third Party Advisory

24 Aug 2026, 11:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-08-24 11:16

Updated : 2026-10-12 15:10


NVD link : CVE-2026-10618

Mitre link : CVE-2026-10618

CVE.ORG link : CVE-2026-10618


JSON object : View

Products Affected

gohugo

  • hugo
CWE
CWE-79

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')